p:namespace-rename-013 (AB)

Tests p:namespace-rename

Test is expected to pass.

Input: source

<d:doc xmlns:d="http://foo.com"
       xmlns:t="http://xproc.org/ns/testsuite/3.0" d:attr="val"/>

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://foo.com"
                       to="http://bar.com" apply-to="elements"/>
</p:declare-step>

Result

<_1:doc xmlns:_1="http://bar.com" xmlns:d="http://foo.com"
        xmlns:t="http://xproc.org/ns/testsuite/3.0" d:attr="val"/>

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://foo.com" prefix="foo"/>
   <s:ns uri="http://bar.com" prefix="bar"/>
   <s:pattern>
      <s:rule context="/">
         <s:assert test="bar:doc">The root element is not 'Q{http://bar.com}doc'.</s:assert>
         <s:assert test="*/@foo:attr">Root does not have an attribute Q{http://foo.com}attr.</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