AB for-each 014

Tests output port with inline and pipe

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" version="3.0">
   <p:output port="result"/>
   <p:identity>
      <p:with-input>
         <doc1/>
         <doc2/>
         <doc3/>
      </p:with-input>
   </p:identity>
   <p:for-each>
      <p:output port="result" sequence="true">
         <p:inline>
            <res/>
         </p:inline>
         <p:pipe step="id"/>
      </p:output>
      <p:identity name="id"/>
      <p:identity>
         <p:with-input>
            <foo/>
         </p:with-input>
      </p:identity>
   </p:for-each>
   <p:wrap-sequence wrapper="result"/>
</p:declare-step>

Result

<result xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <res/>
   <doc1/>
   <res/>
   <doc2/>
   <res/>
   <doc3/>
</result>

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="result">The pipeline root is not result.</s:assert>
         <s:assert test="count(result/*)=6">Wrapper does not have six children.</s:assert>
         <s:assert test="result/*[1]/name()='res'">First child is not 'res'.</s:assert>
         <s:assert test="result/*[2]/name()='doc1'">Second child is not 'doc1'.</s:assert>
         <s:assert test="result/*[3]/name()='res'">Third child is not 'res'.</s:assert>
         <s:assert test="result/*[4]/name()='doc2'">Forth child is not 'doc2'.</s:assert>
         <s:assert test="result/*[5]/name()='res'">fifth child is not 'res'.</s:assert>
         <s:assert test="result/*[6]/name()='doc3'">Sixth child is not 'doc3'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
18 Sep 2019, Achim Berndzen
Initial test