p:namespace-rename-015 (AB)
Tests p:namespace-rename
Test is expected to pass.
Input: source
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:input port="source"/>
<p:output port="result"/>
<p:namespace-rename from="http://www.w3.org/ns/xproc"
to="http://example.com/to"/>
</p:declare-step>
The pipeline
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:input port="source"/>
<p:output port="result"/>
<p:namespace-rename from="http://www.w3.org/ns/xproc"
to="http://example.com/to" apply-to="all"/>
</p:declare-step>
Result
<p:declare-step xmlns:p="http://example.com/to"
xmlns:t="http://xproc.org/ns/testsuite/3.0" version="3.0">
<p:input port="source"/>
<p:output port="result"/>
<p:namespace-rename from="http://www.w3.org/ns/xproc"
to="http://example.com/to"/>
</p:declare-step>
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 uri="http://example.com/to" prefix="p"/>
<s:pattern>
<s:rule context="/">
<s:assert test="p:declare-step">The root element is not Q{http://example.com/to}declare-step.</s:assert>
<s:assert test="p:declare-step/@version">Root element does not have an attribute "version" in no namespace.</s:assert>
<s:assert test="p:declare-step/p:input">Root element does not have a child Q{http://example.com/to}input.</s:assert>
<s:assert test="p:declare-step/p:output">Root element does not have a child Q{http://example.com/to}output.</s:assert>
<s:assert test="p:declare-step/p:namespace-rename">Root element does not have a child Q{http://example.com/to}namespace-rename.</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 10 Jun 2021, Achim Berndzen
- Added attribute 'queryBinding' to schematron's schema.
- 17 May 2019, Achim Berndzen
- Ported tests for p:namespace-rename