relative-anyuri-002

Tests that relative URI resolution is dependent on the XProc version attribute. (These tests should also be in the official test suite, but this is a temporary place holder. Also, I stole it from Achim. 🙂)

Test relative-anyuri-002.xml is expected to pass.

The pipeline

<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:test="http://example.com/test" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="main" version="3.2">
   <p:output port="result"/>
   <p:option name="uri" select="'somewhere.txt'"/>
   <p:declare-step type="test:step">
      <p:output port="result"/>
      <p:option name="uri1" required="true" as="xs:anyURI"/>
      <p:option name="uri2" required="true" as="xs:anyURI"/>
      <p:option name="uri3" required="true" as="xs:anyURI"/>
      <p:identity>
         <p:with-input>
            <doc>
               <uri1>{$uri1}</uri1>
               <uri2>{$uri2}</uri2>
               <uri3>{$uri3}</uri3>
            </doc>
         </p:with-input>
      </p:identity>
   </p:declare-step>
   <test:step uri2="{$uri}" xml:base="http://step" uri3="somewhere-else.xpl">
      <p:with-option name="uri1" select="$uri" xml:base="http://with-option"/>
   </test:step>
</p:declare-step>

Schematron validation

<s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
   <s:pattern>
      <s:rule context="/">
         <s:assert test="doc">The root is wrong.</s:assert>
      </s:rule>
   </s:pattern>
   <s:pattern>
      <s:rule context="/doc">
         <s:assert test="uri1 = 'http://with-option/somewhere.txt'">Wrong uri1</s:assert>
         <s:assert test="uri2 = 'http://step/somewhere.txt'">Wrong uri2</s:assert>
         <s:assert test="uri3 = 'http://step/somewhere-else.xpl'">Wrong uri3</s:assert>
      </s:rule>
   </s:pattern>
</s:schema>

Revision history

15 Jun 2026, Norm Tovey-Walsh

Created test.