<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="ab-p-archive-039.xml"
        name="ab-p-archive-039.xml"
        expected="pass">
   <t:info>
      <t:title>p:archive 039 (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-21</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added option "relative-to" to p:archive-manifest</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: Tests 'delete' remove one entry but leave the others.</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:inline document-properties="map{'base-uri' : 'http://test/one.xml'}">
                  <doc-a/>
               </p:inline>
               <p:inline document-properties="map{'base-uri' : 'http://test/two.xml'}">
                  <doc-b/>
               </p:inline>
            </p:with-input>
            <p:with-input port="manifest">
               <p:empty/>
            </p:with-input>
            <p:with-input port="archive">
               <p:empty/>
            </p:with-input>
         </p:archive>
         <p:archive parameters="map{'command' : 'delete'}">
            <p:with-input port="source">
               <p:inline document-properties="map{'base-uri' : 'http://test/one.xml'}">
                  <doc-new/>
               </p:inline>
            </p:with-input>
            <p:with-input port="manifest">
               <p:empty/>
            </p:with-input>
            <p:with-input port="archive" pipe="result"/>
         </p:archive>
         <p:archive-manifest relative-to="http://xproc.org/ns/testsuite"/>
      </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:ns uri="http://www.w3.org/ns/xproc-step" prefix="c"/>
         <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)=1">Root element does not have one child 'c:entry'.</s:assert>
               <s:assert test="c:archive/c:entry/@name='two.xml'">There is no c:entry for 'two.xml'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-p-archive-039.xml">
      <c:archive xmlns:c="http://www.w3.org/ns/xproc-step" format="zip">
         <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
                  name="two.xml"
                  content-type="application/xml"
                  cx:size="123"
                  cx:file-creation-time="1601-01-01T00:00:00Z"
                  cx:last-access-time="1601-01-01T00:00:00Z"
                  cx:last-modified="2026-05-10T09:18:00Z"
                  method="deflated"
                  href="http://xproc.org/ns/two.xml"/>
      </c:archive>
   </t:result>
</t:test>
