<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="pass"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <t:info>
      <t:title>p:archive-manifest 004 (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-12-12</t:date>
            <t:author>
               <t:name>Norman Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Fix missing namespace declaration.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2019-08-25</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial tests for p:archive-manifest</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests p:archive-manifest: Option 'format' set to as xs:Qname to 'zip'.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step name="pipeline"
                      version="3.0"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema">
         <p:output port="result"/>
         <p:archive-manifest>
            <p:with-option name="format"
                           select="xs:QName('zip')"/>
            <p:with-input href="../documents/archive.zip"/>
         </p:archive-manifest>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema queryBinding="xslt2"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                xmlns="http://www.w3.org/1999/xhtml">
         <s:ns prefix="c"
               uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="c:archive">Root element is not 'c:archive'.</s:assert>
               <s:assert test="count(c:archive/c:entry)=10">Element 'c:archive' does not have 10 children named 'c:entry'</s:assert>
               <s:assert test="c:archive/c:entry/@name='doc.xml'">There is no c:entry for 'doc.xml'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='fish.jpg'">There is no c:entry for 'fish.jpg'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='html.html'">There is no c:entry for 'html.html'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='json.json'">There is no c:entry for 'json.json'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='text.txt'">There is no c:entry for 'text.txt'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='folder/doc.xml'">There is no c:entry for 'folder/doc.xml'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='folder/fish.jpg'">There is no c:entry for 'folder/fish.jpg'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='folder/html.html'">There is no c:entry for 'folder/html.html'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='folder/json.json'">There is no c:entry for 'folder/json.json'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='folder/text.txt'">There is no c:entry for 'folder/text.txt'.</s:assert>
               <s:assert test="count(c:archive/c:entry/@href)=10">Every c:entry must have an attribute 'href'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>