<?xml version="1.0" encoding="utf-8"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite/3.0"
        xml:base="/ab-import-018.xml"
        name="ab-import-018.xml"
        expected="pass">
   <t:info>
      <t:title>Import-018 (AB)</t:title>
      <t:revision-history>
         <t:revision>
            <t:date>2022-01-30</t:date>
            <t:author>
               <t:name>Achim Berndzen</t:name>
            </t:author>
            <t:description xmlns="http://www.w3.org/1999/xhtml">
               <p>Added test.</p>
            </t:description>
         </t:revision>
      </t:revision-history>
   </t:info>
   <t:description xmlns="http://www.w3.org/1999/xhtml">
      <p>Tests repeated import of library with static option.</p>
   </t:description>
   <t:pipeline>
      <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:test="http://test" version="3.0">
         <p:import href="../pipelines/ab-library-027.xpl"/>
         <p:output port="result"/>
         <p:declare-step type="test:step">
            <p:import href="../pipelines/ab-library-027.xpl"/>
            <p:output port="result"/>
            <p:identity>
               <p:with-input>
                  <doc>{$imported-option}</doc>
               </p:with-input>
            </p:identity>
         </p:declare-step>
         <test:step/>
         <p:add-attribute match="/*"
                          attribute-name="att"
                          attribute-value="{$imported-option}"/>
      </p:declare-step>
   </t:pipeline>
   <t:schematron>
      <s:schema xmlns:s="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
         <s:pattern>
            <s:rule context="/">
               <s:assert test="doc">The root element is not 'doc'.</s:assert>
               <s:assert test="doc/text()='42'">The text child of doc is not the correct answer.</s:assert>
               <s:assert test="doc/@att='42'">There is no attribute 'att' or @att does not give the right answer.</s:assert>
            </s:rule>
         </s:pattern>
      </s:schema>
   </t:schematron>
   <t:result name="ab-import-018.xml">
      <doc xmlns:test="http://test" att="42">42</doc>
   </t:result>
</t:test>
