<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/basex-database-list-001.xml"
        name="basex-database-list-001.xml"
        expected="pass"
        features="basex-collector p:directory-list">
   <t:info>
      <t:title>basex-database-list-001</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-10-20</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>Tests p:directory-list with a BaseX URI</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      version="3.0">
         <p:output port="result"/>
         <p:directory-list path="basex://#databases"/>
      </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:ns uri="http://www.w3.org/ns/xproc-step" prefix="c"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="c:directory">Root element is not c:directory.</s:assert>
               <s:assert test="exists(c:directory/c:*)">No databases few databases</s:assert>
            </s:rule>
         </s:pattern>
         <s:pattern>
            <s:rule context="/c:directory">
               <s:assert test="c:directory/@xml:base='basex://XProcUnitTestDB/'">No test database</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="basex-database-list-001.xml">
      <c:directory xmlns:c="http://www.w3.org/ns/xproc-step"
                   xml:base="basex://#databases"
                   name="#databases">
         <c:directory name="XProcUnitTestDB" xml:base="basex://XProcUnitTestDB/"/>
      </c:directory>
   </t:result>
</t:test>
