Static options 054

Tests static option set by test runner.

Test is expected to pass.

Options

NameInitializer
static42

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="main" version="3.0">
   <p:output port="result"/>
   <p:option name="static" static="true" select="99"/>
   <p:identity>
      <p:with-input>
         <doc>{$static}</doc>
      </p:with-input>
   </p:identity>
</p:declare-step>

Result

<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">42</doc>

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="doc">The document root is not 'doc'.</s:assert>
         <s:assert test="doc/text()='42'">The text value of doc is not the right answer.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

01 Feb 2022, Achim Berndzen
Test added.