<?xml version="1.0" encoding="UTF-8"?>
<t:test expected="pass"
        xmlns:t="http://xproc.org/ns/testsuite/3.0">
   <t:info>
      <t:title>nw-document-properties-001</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2026-10-01</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 the document properties of documents in a collection are available.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step version="3.0"
                      xmlns:p="http://www.w3.org/ns/xproc">
         <p:output port="result"/>

         <p:variable name="var"
                     select="p:document-property(collection()[1], 'content-type')" collection="true">
           <doc/>
         </p:variable>

         <p:identity>
           <p:with-input>
             <doc>{$var}</doc>
           </p:with-input>
         </p:identity>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema queryBinding="xslt2"
                xmlns:s="http://purl.oclc.org/dsdl/schematron"
                xmlns="http://www.w3.org/1999/xhtml">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="doc">The root is not doc.</s:assert>
               <s:assert test="doc = 'application/xml'">The property is incorrect.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
</t:test>
