nw-option-value-002
Test that option values passed to steps override
only the outer-most default values.
Test is expected to pass.
Options
Name | Initializer |
---|
opt | 'external-value' |
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:s="http://example.com/ns/steps"
xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="main" version="3.1"
exclude-inline-prefixes="#all">
<p:option name="opt" as="xs:string?"
select="'outer-default'"/>
<p:output port="result"/>
<p:declare-step type="s:inner-step">
<p:option name="opt" as="xs:string?"
select="'inner-default'"/>
<p:output port="result"/>
<p:identity>
<p:with-input>
<value>{$opt}</value>
</p:with-input>
</p:identity>
</p:declare-step>
<s:inner-step/>
</p:declare-step>
Result
<value xmlns:t="http://xproc.org/ns/testsuite/3.0">inner-default</value>
Schematron checks
<s:schema xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
queryBinding="xslt2">
<s:pattern>
<s:rule context="/">
<s:assert test="value">The pipeline root is not “value”.</s:assert>
<s:assert test="value/text() = 'inner-default'">The result is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 14 Jun 2025, Norman Walsh
- Initial test.