p:rename-015 (AB)

Tests p:rename for an element does not affect an attribute with the same name.

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.0">
   <p:output port="result"/>
   <p:rename match="a" new-name="b">
      <p:with-input>
         <a b="42"/>
      </p:with-input>
   </p:rename>
</p:declare-step>

Result

<b xmlns:t="http://xproc.org/ns/testsuite/3.0" b="42"/>

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="b">The root element is not 'b'.</s:assert>
         <s:assert test="b/@b">Root element does not have an attribute "b".</s:assert>
         <s:assert test="b/@b='42'">Attribute's value is not '42'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

15 Jul 2025, Achim Berndzen
Initial commit.