<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="ab-output-042.xml"
        name="ab-output-042.xml"
        expected="pass">
   <t:info>
      <t:title>Output port 42 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2021-06-10</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added attribute 'queryBinding' to schematron's schema.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2020-09-28</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added new tests</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests that documents appear in the right order on p:output.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
         <p:output port="result"/>
         <p:if test="true()">
            <p:output port="result" sequence="true">
               <p:inline>
                  <doc1/>
               </p:inline>
               <p:pipe step="producer"/>
            </p:output>
            <p:identity name="producer">
               <p:with-input>
                  <doc2/>
               </p:with-input>
            </p:identity>
         </p:if>
         <p:wrap-sequence wrapper="result"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="result">The document root is not 'result'.</s:assert>
               <s:assert test="result/*[1]/name()='doc1'">The first child element of result is not named doc1.</s:assert>
               <s:assert test="result/*[2]/name()='doc2'">The second child element of result is not named doc2.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-output-042.xml">
      <result>
         <doc1/>
         <doc2/>
      </result>
   </t:result>
</t:test>
