<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t:test xmlns:t="http://xproc.org/ns/testsuite">

<t:title>Test <t:code>exclude-inline-prefixes</t:code>-005</t:title>

<t:pipeline>
<p:declare-step version='1.0' name="main"
		xmlns="http://example.com/ns/test"
		xmlns:t="http://xproc.org/ns/testsuite"
		xmlns:p="http://www.w3.org/ns/xproc"
		xmlns:c="http://www.w3.org/ns/xproc-step"
		xmlns:err="http://www.w3.org/ns/xproc-error">
  <p:output port="result"/>

  <p:identity name="identity">
    <p:input port="source">
      <p:inline exclude-inline-prefixes="#default t p err"><c:doc/></p:inline>
    </p:input>
  </p:identity>

  <p:group>
    <p:variable name="c" select="c:foo">
      <p:namespaces element="/*"/>
    </p:variable>

    <p:try name="try-t">
      <p:group>
        <p:output port="result"/>
        <p:variable name="t" select="t:foo">
          <p:pipe step="identity" port="result"/>
          <p:namespaces element="/*"/>
        </p:variable>
        <p:identity>
          <p:input port="source">
            <p:inline><failure/></p:inline>
          </p:input>
        </p:identity>
      </p:group>
      <p:catch>
        <p:output port="result"/>
        <p:identity>
          <p:input port="source">
            <p:inline><success xmlns=""/></p:inline>
          </p:input>
        </p:identity>
      </p:catch>
    </p:try>

    <p:try name="try-p">
      <p:group>
        <p:output port="result"/>
        <p:variable name="p" select="p:foo">
          <p:pipe step="identity" port="result"/>
          <p:namespaces element="/*"/>
        </p:variable>
        <p:identity>
          <p:input port="source">
            <p:inline><failure/></p:inline>
          </p:input>
        </p:identity>
      </p:group>
      <p:catch>
        <p:output port="result"/>
        <p:identity>
          <p:input port="source">
            <p:inline><success xmlns=""/></p:inline>
          </p:input>
        </p:identity>
      </p:catch>
    </p:try>

    <p:try name="try-err">
      <p:group>
        <p:output port="result"/>
        <p:variable name="err" select="err:foo">
          <p:pipe step="identity" port="result"/>
          <p:namespaces element="/*"/>
        </p:variable>
        <p:identity>
          <p:input port="source">
            <p:inline><failure/></p:inline>
          </p:input>
        </p:identity>
      </p:group>
      <p:catch>
        <p:output port="result"/>
        <p:identity>
          <p:input port="source">
            <p:inline><success xmlns=""/></p:inline>
          </p:input>
        </p:identity>
      </p:catch>
    </p:try>

    <p:wrap-sequence wrapper="wrapper">
      <p:input port="source">
        <p:pipe step="try-t" port="result"/>
        <p:pipe step="try-p" port="result"/>
        <p:pipe step="try-err" port="result"/>
      </p:input>
    </p:wrap-sequence>

  </p:group>

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

<t:output port="result">
  <wrapper>
    <success/>
    <success/>
    <success/>
  </wrapper>
</t:output>
</t:test>
