<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/issue-809-002.xml"
        name="issue-809-002.xml"
        expected="pass">
   <t:info>
      <t:title>issue-809-002</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-08-31</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 a static xs:anyURI can be constructed from a string.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:cx="http://xmlcalabash.com/ns/extensions"
                      xmlns:ex="https://xmlcalabash.com/ns/examples"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      exclude-inline-prefixes="ex xs cx"
                      name="main"
                      version="3.0">
         <p:output port="result"/>
         <p:input port="source">
            <p:inline content-type="application/xml">
               <xsltTransformation name="Named Template" template="named-template"/>
            </p:inline>
         </p:input>
         <p:variable name="template-name"
                     as="xs:QName?"
                     select="xsltTransformation/@template"/>
         <p:identity>
            <p:with-input>
               <doc>{$template-name}</doc>
            </p:with-input>
         </p:identity>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="doc">The document root is not correct.</s:assert>
            </s:rule>
         </s:pattern>
         <s:pattern>
            <s:rule context="/doc">
               <s:assert test=". = 'named-template'">The content is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="issue-809-002.xml">
      <doc>named-template</doc>
   </t:result>
</t:test>
