p:archive 023 (AB)

Tests p:archive: Adding entries to a newly created archive. All entries in manifest, default method='deflated'.

Test ab-p-archive-023.xml is expected to pass.

The 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 parameters="map{'method': 'deflated'}">
      <p:with-input port="source">
         <p:inline document-properties="map{'base-uri' : 'http://test/one.xml'}">
            <one/>
         </p:inline>
         <p:inline document-properties="map{'base-uri' : 'http://test/two.xml'}">
            <two/>
         </p:inline>
      </p:with-input>
      <p:with-input port="manifest">
         <c:archive>
            <c:entry name="one.xml" href="http://test/one.xml" comment="This is doc one."/>
            <c:entry name="two.xml" href="http://test/two.xml" comment="This is doc two."/>
         </c:archive>
      </p:with-input>
      <p:with-input port="archive">
         <p:empty/>
      </p:with-input>
   </p:archive>
   <p:archive-manifest relative-to="http://xproc.org/ns/testsuite"/>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<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)=2">Root element does not have two child 'c:entry'.</s:assert>
         <s:assert test="c:archive/c:entry/@name='one.xml'">There is no c:entry for 'one.xml'.</s:assert>
         <s:assert test="c:archive/c:entry/@name='two.xml'">There is no c:entry for 'two.xml'.</s:assert>
         <s:assert test="c:archive/c:entry[@name='one.xml']/@comment='This is doc one.'">Comment for c:entry[one.xml] is not correct.</s:assert>
         <s:assert test="c:archive/c:entry[@name='two.xml']/@comment='This is doc two.'">Comment for c:entry[two.xml] is not correct.</s:assert>
         <s:assert test="c:archive/c:entry[@name='one.xml']/@method='deflated'">Method for c:entry[one.xml] is not 'deflated'.</s:assert>
         <s:assert test="c:archive/c:entry[@name='two.xml']/@method='deflated'">Method for c:entry[two.xml] is not 'deflated'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

21 Dec 2019, Achim Berndzen

Added option "relative-to" to p:archive-manifest

01 Sep 2019, Achim Berndzen

Tests for p:archive