Static option 001 (NW)

This test demonstrates that a static option that doesn’t have an initializer can be used in a nested p:declare-step. Added because this combination revealed a bug in XML Calabash.

Test is expected to pass.

Options

NameInitializer
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?" static="true"/>
   <p:output port="result"/>
   <p:declare-step type="s:inner-step">
      <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">external value</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() = 'external value'">The result is incorrect.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

14 Jun 2025, Norm Tovey-Walsh
Initial test