<?xml-stylesheet type="text/xsl" href="/style/testcase.xsl"?>
<t: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">

  <t:title>Test p:label-elements #003</t:title>

  <t:input port="source">
    <doc xml:base="http://example.com/base/">
      <chap xml:base="http://example.com/base/chaps/">
        <para>...</para>
      </chap>
      <chap>
        <para>...</para>
      </chap>
    </doc>
  </t:input>

  <t:pipeline>
    <p:pipeline version='1.0' name="pipeline">
      
      <p:label-elements label="concat(&quot;http://foo.com/&quot;, $p:index)"
                        attribute="xml:base"
                        match="chap"/>

    </p:pipeline>
  </t:pipeline>

  <t:output port="result">
    <doc xml:base="http://example.com/base/">
      <chap xml:base="http://foo.com/1">
        <para>...</para>
      </chap>
      <chap xml:base="http://foo.com/2">
        <para>...</para>
      </chap>
    </doc>
  </t:output>

</t:test>

