<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-if-034.xml"
        name="ab-if-034.xml"
        expected="pass">
   <t:info>
      <t:title>p:if-034 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2023-12-10</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>New tests</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Test p:if with a sequence as DRP and test="false()".</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
         <p:output port="result"/>
         <p:identity>
            <p:with-input>
               <doc/>
               <doc/>
            </p:with-input>
         </p:identity>
         <p:if test="false()" name="if">
            <p:for-each>
               <p:add-attribute match="/doc"
                                attribute-name="a"
                                attribute-value="{p:iteration-position()}"/>
            </p:for-each>
         </p:if>
         <p:wrap-sequence wrapper="result"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="/result">Root element is not 'result'.</s:assert>
               <s:assert test="count(/result/*)=2">Root should only have one child.</s:assert>
               <s:assert test="/result/*[1]/name()='doc'">First child of 'result' is not 'doc'.</s:assert>
               <s:assert test="/result/*[2]/name()='doc'">Second child of 'result' is not 'doc'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-if-034.xml">
      <result>
         <doc/>
         <doc/>
      </result>
   </t:result>
</t:test>
