p:make-absolute-uris 001 (NW)

Replace the content of an element.

Test is expected to pass.

The pipeline

<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                xmlns:err="http://www.w3.org/ns/xproc-error" xmlns:p="http://www.w3.org/ns/xproc"
                xmlns:t="http://xproc.org/ns/testsuite/3.0"
                xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-inline-prefixes="c xs"
                version="3.0">
   <p:output port="result"/>
   <p:make-absolute-uris match="uri">
      <p:with-input>
         <doc>
            <uri>filename</uri>
         </doc>
      </p:with-input>
   </p:make-absolute-uris>
</p:declare-step>

Result

<doc xmlns:err="http://www.w3.org/ns/xproc-error"
     xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <uri>file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/tests/filename</uri>
</doc>

Schematron checks

<s:schema xmlns="http://www.w3.org/1999/xhtml"
          xmlns:err="http://www.w3.org/ns/xproc-error"
          xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:t="http://xproc.org/ns/testsuite/3.0"
          queryBinding="xslt2">
   <s:ns prefix="p" uri="http://www.w3.org/ns/xproc"/>
   <s:ns prefix="c"
         uri="http://www.w3.org/ns/xproc-step"/>
   <s:pattern>
      <s:rule context="/*">
         <s:assert test="self::doc">The root is not doc.</s:assert>
         <s:assert test="ends-with(uri, '/tests/filename')">The uri is incorrect.</s:assert>
         <s:assert test="starts-with(uri, 'file:')">The uri appears not to be absolute.</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

23 May 2025, Norman Walsh
Removed spurious feature.
15 May 2024, Norman Walsh
Add test for p:make-absolute-uris.