p:archive 045 (AB)

Tests p:archive: Tests entries are ordered as in manifest.

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

It requires the following features: archive-order.

The pipeline


      <p:declare-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 xmlns=""/>
                  </p:inline>
                  <p:inline document-properties="map{'base-uri' : 'http://test/three.xml'}">
                     <doc-c xmlns=""/>
                  </p:inline>
                  <p:inline document-properties="map{'base-uri' : 'http://test/two.xml'}">
                     <doc-b xmlns=""/>
                  </p:inline>
               </p:with-input>
               <p:with-input port="manifest">
                  <c:archive xmlns:c="http://www.w3.org/ns/xproc-step">
                     <c:entry xmlns:c="http://www.w3.org/ns/xproc-step" name="one.xml" href="http://test/one.xml"/>
                     <c:entry xmlns:c="http://www.w3.org/ns/xproc-step" name="two.xml" href="http://test/two.xml"/>
                     <c:entry xmlns:c="http://www.w3.org/ns/xproc-step" name="three.xml" href="http://test/three.xml"/>
                  </c:archive>
               </p:with-input>
               <p:with-input port="archive"><p:empty/></p:with-input>
            </p:archive>
         <p:unarchive/>
         <p:wrap-sequence wrapper="wrapper"/>
      </p:declare-step>
   
MorganaXProc passing

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="wrapper">Root element is not wrapper.</s:assert>
               <s:assert test="wrapper/*[1]/name()='doc-a'">First element is not 'doc-a'.</s:assert>
               <s:assert test="wrapper/*[2]/name()='doc-b'">Second element is not 'doc-b'.</s:assert>
               <s:assert test="wrapper/*[3]/name()='doc-c'">Third element is not 'doc-c'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

01 Sep 2019, Achim Berndzen

Tests for p:archive