<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-try-018.xml"
        name="ab-try-018.xml"
        expected="pass">
   <t:info>
      <t:title>AB try 018</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-05-25</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 connections to p:try's parent scope.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" name="pipeline" version="3.0">
         <p:output port="result"/>
         <p:variable name="var" select="42"/>
         <p:identity name="producer">
            <p:with-input>
               <doc/>
            </p:with-input>
         </p:identity>
         <p:identity>
            <p:with-input>
               <error/>
            </p:with-input>
         </p:identity>
         <p:try>
            <p:add-attribute attribute-name="att" attribute-value="{$var}">
               <p:with-input pipe="@producer"/>
            </p:add-attribute>
            <p:catch>
               <p:identity>
                  <p:with-input>
                     <error/>
                  </p:with-input>
               </p:identity>
            </p:catch>
         </p:try>
      </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="doc">The pipeline root is not doc.</s:assert>
               <s:assert test="doc/@att=42">Attribute @att is not 42.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-try-018.xml">
      <doc att="42"/>
   </t:result>
</t:test>
