p:archive-manifest 005 (AB)

Tests p:archive-manifest: Option 'parameters' is allowed.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0" name="pipeline" version="3.0">
   <p:output port="result"/>
   <p:archive-manifest parameters="map{}">
      <p:with-input href="../documents/archive.zip"/>
   </p:archive-manifest>
</p:declare-step>

Result

<c:archive xmlns:c="http://www.w3.org/ns/xproc-step"
           xmlns:t="http://xproc.org/ns/testsuite/3.0" format="zip">
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="doc.xml" content-type="application/xml" cx:size="47"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:19:02Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/doc.xml"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="text.txt" content-type="text/plain" cx:size="20"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:46:36Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/text.txt"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="folder/doc.xml" content-type="application/xml" cx:size="47"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:19:02Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/folder/doc.xml"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="folder/text.txt" content-type="text/plain" cx:size="20"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:46:36Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/folder/text.txt"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="fish.jpg" content-type="image/jpeg" cx:size="93971"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:42:08Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/fish.jpg"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="folder/fish.jpg" content-type="image/jpeg" cx:size="93971"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:42:08Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/folder/fish.jpg"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="folder/json.json" content-type="application/json"
            cx:size="19" cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:48:38Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/folder/json.json"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="json.json" content-type="application/json"
            cx:size="19" cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T17:48:38Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/json.json"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="html.html" content-type="text/html" cx:size="178"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T18:02:10Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/html.html"/>
   <c:entry xmlns:cx="http://xmlcalabash.com/ns/extensions"
            name="folder/html.html" content-type="text/html" cx:size="178"
            cx:mode="33188" cx:mode-string="rw-r--r--"
            cx:last-modified="2019-08-23T18:02:10Z" cx:external-attributes="2175008768"
            method="deflated"
            href="file:///woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/documents/archive.zip/folder/html.html"/>
</c:archive>

Schematron checks

<s:schema xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
          queryBinding="xslt2">
   <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>

Revision history

10 Jun 2021, Achim Berndzen
Added attribute 'queryBinding' to schematron's schema.
25 Aug 2019, Achim Berndzen
Initial tests for p:archive-manifest