<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/nw-ns-005.xml"
        name="nw-ns-005.xml"
        expected="pass">
   <t:info>
      <t:title>nw-ns-005</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2025-12-23</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Made relative URI in namespace declaration absolute.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2025-12-22</t:date>
            <t:author>
               <t:name>Norm Tovey-Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial commit</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Test that local namespace bindings work correctly.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:my="http://example.com/"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      version="3.0">
         <p:output port="result"/>
         <p:declare-step type="my:step">
            <p:output port="result"/>
            <p:option xmlns:my="http://my-ns" name="my:opt1" select="'fail'"/>
            <p:identity xmlns:m="http://my-ns">
               <p:with-input>
                  <result>{$m:opt1}</result>
               </p:with-input>
            </p:identity>
         </p:declare-step>
         <my:step>
            <p:with-option xmlns:m="http://my-ns" name="m:opt1" select="'success'"/>
         </my:step>
      </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="result='success'">Document content is incorrect</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="nw-ns-005.xml">
      <result xmlns:m="http://my-ns" xmlns:my="http://example.com/">success</result>
   </t:result>
</t:test>
