XS 001 -23 (AB)

Tests cycles from context item of option value.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0"
                xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
   <p:output port="result"/>
   <p:identity depends="adder">
      <p:with-input>
         <result/>
      </p:with-input>
   </p:identity>
   <p:add-attribute name="adder" match="/*"
                    attribute-name="att">
      <p:with-option name="attribute-value"
                     select="xs:string(40+2)"/>
      <p:with-input>
         <doc/>
      </p:with-input>
   </p:add-attribute>
</p:declare-step>

Result

<doc xmlns:t="http://xproc.org/ns/testsuite/3.0"
     xmlns:xs="http://www.w3.org/2001/XMLSchema" att="42"/>

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 root element is not doc.</s:assert>
         <s:assert test="doc/@att">There is no attribute "att" on doc.</s:assert>
         <s:assert test="doc/@att='42'">The attribute value of att is not 42.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

23 Nov 2021, Achim Berndzen
Changed test according to 3.0-specification#1043: Pipeline doesn't construct a loop.
11 Apr 2020, Achim Berndzen
New test.