Add-attribute-018 (AB)

Tests that adding xml:base also changes element's base-uri.

Test ab-add-attribute-018.xml is expected to pass.

The pipeline


<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.0">
   <p:output port="result"/>
   <p:identity>
      <p:with-input>
         <doc xml:base-uri="http://some-uri"/>
      </p:with-input>
   </p:identity>
   <p:add-attribute attribute-value="http://changed-uri" attribute-name="xml:base"/>
   <p:identity>
      <p:with-input>
         <result>{base-uri(/doc)}</result>
      </p:with-input>
   </p:identity>
</p:declare-step>
MorganaXProc passing XML Calabash passing

Schematron validation


<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="result">The document root is not 'result'.</s:assert>
         <s:assert test="result/text()='http://changed-uri'">Base-uri of element 'doc' is not 'http://changed-uri'.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

10 Jun 2021, Achim Berndzen

Added attribute 'queryBinding' to schematron's schema.

16 Feb 2019, Achim Berndzen

Added new tests for p:add-attribute.