<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-static-option-var-007.xml"
        name="ab-static-option-var-007.xml"
        expected="pass">
   <t:info>
      <t:title>Static variables/option 007</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2021-06-10</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added attribute 'queryBinding' to schematron's schema.</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2019-11-23</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Changed test to remove p:document-properties-document().</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2018-10-22</t:date>
            <t:author initials="ndw">
               <t:name>Norman Walsh</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Fixed result document
               (
                  <code>c:document-properties</code>, not 
                  <code>p:document-properties</code>)</p>
            </t:description>
         </t:revision>
         <t:revision>
            <t:date>2018-10-11T18:16:00+02:00</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Initial 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 option can be used in avt of static inline.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step"
                      xmlns:map="http://www.w3.org/2005/xpath-functions/map"
                      xmlns:p="http://www.w3.org/ns/xproc"
                      xmlns:xs="http://www.w3.org/2001/XMLSchema"
                      name="main"
                      version="3.0">
         <p:output port="result"/>
         <p:option static="true" name="static-option" select="18"/>
         <p:input port="source">
            <p:inline document-properties="map{'a': $static-option}">
               <doc/>
            </p:inline>
         </p:input>
         <p:identity>
            <p:with-input>
               <p:inline>
                  <a>{map:get(p:document-properties(.),xs:QName('a'))}</a>
               </p:inline>
            </p:with-input>
         </p:identity>
      </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 prefix="c" uri="http://www.w3.org/ns/xproc-step"/>
         <s:pattern>
            <s:rule context="/">
               <s:assert test="a">The pipeline root is not “a”.</s:assert>
               <s:assert test="a/text()='18'">Text node of a is not '18'.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-static-option-var-007.xml">
      <a xmlns:c="http://www.w3.org/ns/xproc-step"
         xmlns:map="http://www.w3.org/2005/xpath-functions/map"
         xmlns:xs="http://www.w3.org/2001/XMLSchema">18</a>
   </t:result>
</t:test>
