<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-option-uri-001.xml"
        name="ab-option-uri-001.xml"
        expected="pass">
   <t:info>
      <t:title>Options with xs:anyURI in XProc 3.2 001 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-06-17</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>New test for options with xs:anyURI.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests rules for options with xs:anyURI in XProc 3.2</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:test="http://test"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      version="3.2">
         <p:output port="result"/>
         <p:declare-step type="test:test">
            <p:output port="result"/>
            <p:option name="uri" as="xs:anyURI" required="true"/>
            <p:identity>
               <p:with-input>
                  <doc>{$uri}</doc>
               </p:with-input>
            </p:identity>
         </p:declare-step>
         <test:test uri="somewhere.txt" xml:base="http://test"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="doc">The root element is not 'doc'.</s:assert>
               <s:assert test="doc/text()='http://test/somewhere.txt'">URI in option is not correctly resolved.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-option-uri-001.xml">
      <doc xmlns:test="http://test" xmlns:xs="http://www.w3.org/2001/XMLSchema">http://test/somewhere.txt</doc>
   </t:result>
</t:test>
