<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="pass"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
  <t:info>
    <t:title>relative-anyuri-001</t:title>
    <t:revision-history>
      <t:revision>
        <t:date>2026-06-15</t:date>
        <t:author>
          <t:name>Norm Tovey-Walsh</t:name>
        </t:author>
        <t:description xmlns="http://www.w3.org/1999/xhtml">
          <p>Created test.</p>
        </t:description>
      </t:revision>
    </t:revision-history>
  </t:info>
  <t:description xmlns="http://www.w3.org/1999/xhtml">
    <p>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. 🙂)</p>
  </t:description>
  <t: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.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>
  </t:pipeline>
  <t:schematron>
    <s:schema queryBinding="xslt2"
              xmlns:s="http://purl.oclc.org/dsdl/schematron">
      <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>
  </t:schematron>
</t:test>
