<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="ab-option-053.xml"
        name="ab-option-053.xml"
        expected="pass">
   <t:info>
      <t:title>ab-option-053</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>2021-04-24</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added new tests.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Testing reference to options as default value for other options.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:test="http://test" version="3.0">
         <p:output port="result"/>
         <p:declare-step type="test:step">
            <p:option name="opt1" select="'text'"/>
            <p:option name="opt2" select="concat($opt1,'_1')"/>
            <p:option name="opt3" select="concat($opt2,'_2')"/>
            <p:output port="result"/>
            <p:identity>
               <p:with-input>
                  <result>{$opt1} {$opt2} {$opt3}</result>
               </p:with-input>
            </p:identity>
         </p:declare-step>
         <test:step opt1="option1">
            <p:with-option name="opt2" select="'option2'"/>
         </test: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">The document root is not 'result'.</s:assert>
               <s:assert test="result/text()='option1 option2 option2_2'"/>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-option-053.xml">
      <result xmlns:test="http://test">option1 option2 option2_2</result>
   </t:result>
</t:test>
