nw-option-value-002

Test that option values passed to steps override only the outer-most default values.

Test nw-option-value-002.xml is expected to pass.

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:s="http://example.com/ns/steps" 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>
MorganaXProc passing XML Calabash passing

Options

$opt

select = 'external-value'

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" 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.