p:namespace-rename-002 (AB)

Tests p:namespace-rename

Test ab-namespace-rename-002.xml is expected to pass.

The pipeline


      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
            <p:input port="source"/>
            <p:output port="result"/>
            
            <p:namespace-rename to="http://foo.com"/>
         
      </p:declare-step>
   
MorganaXProc passing XML Calabash passing

Inputs

port = source


      <doc xmlns:x="http://test.com" attr1="val1" x:attr2="val2">
         <p/>
      </doc>
   

Schematron validation


      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron">
         <s:ns uri="http://foo.com" prefix="new"/>
         <s:ns uri="http://test.com" prefix="x"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="*/name()='doc'">The root element is not 'doc'.</s:assert>
               <s:assert test="*/namespace-uri()='http://foo.com'">Root is not in namespace 'http://foo.com'.</s:assert>
               <s:assert test="*/@x:attr2">Root does not have an attribute Q{http://test.com}attr2.</s:assert>
               <s:assert test="*/@new:attr1">Root does not have an attribute Q{http://foo.com}attr1.</s:assert>
               <s:assert test="*/*[1]/name()='p'">Root does not have a child 'p'.</s:assert>
               <s:assert test="*/*[1]/namespace-uri()='http://foo.com'">Namespace uri of child 'p' is not 'http://foo.com'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   

Revision history

17 May 2019, Achim Berndzen

Ported tests for p:namespace-rename