p:wrap 001 (NW)
Tests that p:wrap always produces application/xml, even when the
input is some other content type.
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 match="element" wrapper="wrapper">
<p:with-input>
<p:inline content-type="image/svg+xml">
<svg xmlns="http://www.w3.org/2000/svg">
<rect x="10" y="10" width="20" height="20"
fill="red"/>
</svg>
</p:inline>
</p:with-input>
</p:wrap>
<p:cast-content-type content-type="application/xml"
name="properties">
<p:with-input select="p:document-properties(.)"/>
</p:cast-content-type>
</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">file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/tests/nw-wrap-001.xml</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="map"
uri="http://www.w3.org/2005/xpath-functions"/>
<s:pattern>
<s:rule context="/">
<s:assert test="map:map">Root element is not 'map'.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/map:map">
<s:assert test="map:string[@key='content-type'] = 'application/xml'">Incorrect content type.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jan 2026, Norm Tovey-Walsh
- Initial commit