<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="doc-prop-001.xml"
        name="doc-prop-001.xml"
        expected="pass">
   <t:info>
      <t:title>Document properties 001</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2019-11-20</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Changed test from p:document-properties-document() to p:document-properties()</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2017-09-24T17:47:42+01:00</t:date>
            <t:author>
               <t:name>Norman Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Port my test suite; add documentation and schemas</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:pipeline>
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      name="main"
                      version="3.0">
         <p:output port="result"/>
         <p:identity name="id">
            <p:with-input port="source">
               <p:inline document-properties="map { 'a': 1 }">
                  <doc/>
               </p:inline>
            </p:with-input>
         </p:identity>
         <p:cast-content-type content-type="application/xml">
            <p:with-input port="source" select="p:document-properties(.)"/>
         </p:cast-content-type>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:ns prefix="j" uri="http://www.w3.org/2005/xpath-functions"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="j:map">The pipeline root is not “map”.</s:assert>
               <s:assert test="j:map/j:number[@key='a']">Element does not has an attribute 'key' with value 'a'.</s:assert>
               <s:assert test="j:map/j:number/text() = '1'">The property value is not 1</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="doc-prop-001.xml">
      <map xmlns="http://www.w3.org/2005/xpath-functions">
         <string key="base-uri">file:/woodpecker/src/codeberg.org/xmlcalabash/xmlcalabash3/tests/3.0-test-suite/test-suite/pipelines/doc-prop-001.xpl</string>
         <number key="a">1</number>
         <string key="content-type">application/xml</string>
      </map>
   </t:result>
</t:test>
