p:namespace-rename-017 (AB)
Test to make sure that a deleted namespace is handled correctly in a nested
structure.
Test is expected to pass.
Input: source
<doc xmlns="http://www.example.com/"
xmlns:ns="http://www.example.com/ns" xmlns:t="http://xproc.org/ns/testsuite/3.0">
<parent>
<ns:child/>
</parent>
</doc>
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.example.com/ns"/>
</p:declare-step>
Result
<doc xmlns:t="http://xproc.org/ns/testsuite/3.0">
<parent>
<child/>
</parent>
</doc>
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="*/local-name()='doc'">Root element is not 'doc'.</s:assert>
<s:assert test="*/namespace-uri()='http://www.example.com/'">Root element's namespace is not 'http://www.example.com/'.</s:assert>
<s:assert test="*/*/local-name()='parent'">Name of root's child is not 'parent'.</s:assert>
<s:assert test="*/*/namespace-uri()='http://www.example.com/'">Element 'parent' is not 'http://www.example.com/'.</s:assert>
<s:assert test="*/*/child">Element 'parent' does not have a child 'child'.</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