<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-p-archive-006.xml"
        name="ab-p-archive-006.xml"
        expected="pass">
   <t:info>
      <t:title>p:archive 006 (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>2019-11-22</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added relative-to option to p:unarchive, because archive does not
                  have a valid base uri.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2019-09-01</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Tests for p:archive</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests p:archive: Adding entries to a newly created archive. No source, but just manifest.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      version="3.0">
         <p:output port="result"/>
         <p:archive>
            <p:with-input port="source">
               <p:empty/>
            </p:with-input>
            <p:with-input port="manifest">
               <c:archive>
                  <c:entry name="one.xml" href="../documents/ab-doc.xml"/>
                  <c:entry name="two.xml" href="../documents/ab-doc2.xml"/>
               </c:archive>
            </p:with-input>
            <p:with-input port="archive">
               <p:empty/>
            </p:with-input>
         </p:archive>
         <p:unarchive relative-to="folder"/>
         <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/doc)=2">Root element does not have two child 'doc'.</s:assert>
               <s:assert test="count(result/doc/@att)=1">There is no doc with @att.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-p-archive-006.xml">
      <result>
         <doc/>
         <doc att="1"/>
      </result>
   </t:result>
</t:test>
