p:archive 047 (AB)
Tests p:archive: Tests port 'report' reflects implicit manifest .
Test 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"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result" pipe="report"/>
<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/three.xml'}">
<doc-c/>
</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:declare-step>
Result
<c:archive xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:t="http://xproc.org/ns/testsuite/3.0">
<c:entry name="one.xml" href="http://test/one.xml"
content-type="application/xml"/>
<c:entry name="three.xml"
href="http://test/three.xml" content-type="application/xml"/>
<c:entry name="two.xml" href="http://test/two.xml"
content-type="application/xml"/>
</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="c:archive/c:entry[1]/@name='one.xml'">The first entry is not 'one.xml'.</s:assert>
<s:assert test="c:archive/c:entry[3]/@name='two.xml'">The second entry is not 'two.xml'.</s:assert>
<s:assert test="c:archive/c:entry[2]/@name='three.xml'">The third entry is not 'three.xml'.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 26 Jun 2020, Achim Berndzen
- Fixed test so that is actually checks orders of the entries.
- 01 Sep 2019, Achim Berndzen
- Tests for p:archive