nw p-run-001
Test passing map to step with p:run
Test is expected to pass.
The pipeline
<p:declare-step xmlns:err="http://www.w3.org/ns/xproc-error"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:output port="result"/>
<p:variable name="params" as="map(*)"
select="map{'foo': 'bar'}"/>
<p:run name="run-fix">
<p:with-input href="../pipelines/invoked-map.xpl"/>
<p:run-input port="source" primary="true">
<p:empty/>
</p:run-input>
<p:run-option name="parameters" select="$params"/>
<p:output port="result" primary="true"/>
</p:run>
</p:declare-step>
Result
<map xmlns="http://www.w3.org/2005/xpath-functions"
xmlns:t="http://xproc.org/ns/testsuite/3.0">
<string key="foo">bar</string>
</map>
Schematron checks
<s:schema xmlns:err="http://www.w3.org/ns/xproc-error"
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">The root element is not fn:map.</s:assert>
<s:assert test="fn:map/fn:string[@key='foo'] = 'bar'">Map is incorrect.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 18 Jul 2026, Norm Tovey-Walsh
- Added tests for p:run