p:wrap-sequence 017
Tests that setting an xml:base attribute changes the base URI.
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:wrap-sequence wrapper="sequence"
attributes="map{'seq': true(), 'xml:base': 'http://example.com/'}">
<p:with-input>
<doc/>
<doc/>
<doc/>
</p:with-input>
</p:wrap-sequence>
<p:identity>
<p:with-input select="p:document-properties(.)"/>
</p:identity>
<p:cast-content-type content-type="application/xml"/>
</p:declare-step>
Result
<map xmlns="http://www.w3.org/2005/xpath-functions"
xmlns:t="http://xproc.org/ns/testsuite/3.0">
<string key="content-type">application/xml</string>
<string key="base-uri">http://example.com/</string>
</map>
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="fn"
uri="http://www.w3.org/2005/xpath-functions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="fn:map">Root element is not 'fn:map'.</s:assert>
<s:assert test="fn:map/fn:string[@key='base-uri'] = 'http://example.com/'">The base URI is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 01 Feb 2025, Norm Tovey-Walsh
- Tests for p:wrap-sequence (Partly ported from 1.0)