<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite">
  
  <t:title>Test pack #006</t:title>
  
  <t:description xmlns="http://www.w3.org/1999/xhtml">
    <p>Tests wrapper-namespace and wrapper-prefix</p>
  </t:description>

  <t:input port='source'>
    <doc1/>
  </t:input>
  
  <t:input port="alt">
    <doc2/>
  </t:input>
  
  <t:pipeline>
    <p:declare-step version='1.0' name="pipeline"
                    xmlns:p="http://www.w3.org/ns/xproc">
      <p:input port="source" sequence="true"/>
      <p:input port="alt" sequence="true"/>
      <p:output port="result" sequence="true"/>
      
      <p:pack wrapper="wrapper" wrapper-namespace="http://baz.com" wrapper-prefix="baz">
        <p:input port="source">
          <p:pipe step="pipeline" port="source"/>
        </p:input>
        <p:input port="alternate">
          <p:pipe step="pipeline" port="alt"/>
        </p:input>
      </p:pack>

      <p:wrap-sequence wrapper="foo"/>

      <p:escape-markup/>

      <p:choose>
        <p:when test="contains(/foo, '&lt;baz:wrapper') and contains(/foo, 'xmlns:baz=&quot;http://baz.com&quot;')">
          <p:identity>
            <p:input port="source">
              <p:inline>
                <success/>
              </p:inline>
            </p:input>
          </p:identity>
        </p:when>
        <p:otherwise>
          <p:identity>
            <p:input port="source">
              <p:inline>
                <failure/>
              </p:inline>
            </p:input>
          </p:identity>
        </p:otherwise>
      </p:choose>

    </p:declare-step>
  </t:pipeline>

  <t:output port='result'>
    <success/>
  </t:output>

</t:test>


