nw-option-value-001

Test that an option value passed to a step overrides its default value.

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

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:x="http://dummy" version="3.0">
   <p:output port="result"/>
   <p:option name="top-level" select="'top'"/>
   <p:declare-step type="x:inner">
      <p:output port="result"/>
      <p:option name="inner" select="'fail'"/>
      <p:identity>
         <p:with-input>
            <inner>{$inner}</inner>
         </p:with-input>
      </p:identity>
   </p:declare-step>
   <p:identity name="two">
      <p:with-input>
         <top>{$top-level}</top>
      </p:with-input>
   </p:identity>
   <x:inner name="one" inner="pass"/>
   <p:wrap-sequence wrapper="wrapper">
      <p:with-input>
         <p:pipe step="one"/>
         <p:pipe step="two"/>
      </p:with-input>
   </p:wrap-sequence>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<s:schema xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
   <s:pattern>
      <s:rule context="/*">
         <s:assert test="self::wrapper">The pipeline root is not wrapper.</s:assert>
      </s:rule>
      <s:rule context="/wrapper">
         <s:assert test="inner[.='pass']">Inner has the wrong value.</s:assert>
         <s:assert test="top[.='top']">Top has the wrong value.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

12 Jul 2019 18:51, Norman Walsh

Test that option values passed to steps override the default values.