relative-anyuri-001
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 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" xmlns:test="http://example.com/test"
xmlns:xs="http://www.w3.org/2001/XMLSchema" name="main" version="3.1">
<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>
Result
<doc xmlns:t="http://xproc.org/ns/testsuite/3.0"
xmlns:test="http://example.com/test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<uri1>http://step/somewhere.txt</uri1>
<uri2>http://step/somewhere.txt</uri2>
<uri3>somewhere-else.xpl</uri3>
</doc>
Schematron checks
<s:schema 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="doc">The root is wrong.</s:assert>
</s:rule>
</s:pattern>
<s:pattern>
<s:rule context="/doc">
<s:assert test="uri1 = 'http://step/somewhere.txt'">Wrong uri1</s:assert>
<s:assert test="uri2 = 'http://step/somewhere.txt'">Wrong uri2</s:assert>
<s:assert test="uri3 = 'somewhere-else.xpl'">Wrong uri3</s:assert>
</s:rule>
</s:pattern>
</s:schema>
Revision history
- 15 Jun 2026, Norm Tovey-Walsh
- Created test.