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" 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 xmlns="">{$inner}</inner></p:with-input>
    </p:identity>
  </p:declare-step>

  <p:identity name="two">
    <p:with-input><top xmlns="">{$top-level}</top></p:with-input>
  </p:identity>

  <x:inner xmlns:x="http://dummy" 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:s="http://purl.oclc.org/dsdl/schematron">
         <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

12 Jul 2019 18:51, Norman Walsh

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