nw-xslt-003
Tests that p:xslt static-parameters are handled correctly.
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" version="3.1">
<p:output port="result"/>
<p:xslt>
<p:with-input port="source">
<foo/>
</p:with-input>
<p:with-input port="stylesheet">
<p:inline>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<xsl:param name="myparam" static="yes"
select="'default'"/>
<xsl:template match="foo">
<result>
<xsl:value-of select="$myparam"/>
</result>
</xsl:template>
</xsl:stylesheet>
</p:inline>
</p:with-input>
<p:with-option name="static-parameters"
select="map{QName('','myparam'): 'override'}"/>
<p:with-option name="version" select="'3.0'"/>
</p:xslt>
</p:declare-step>
Result
<result xmlns:t="http://xproc.org/ns/testsuite/3.0">override</result>
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:pattern>
<s:rule context="/">
<s:assert test="result">The output root is not “result”.</s:assert>
</s:rule>
<s:rule context="result">
<s:assert test=". = 'override'">The override was not used.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 14 Aug 2025, Norm Tovey-Walsh
- Initial commit.