<?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 variable #007</t:title>

  <t:description xmlns="http://www.w3.org/1999/xhtml">
    <p>Tests shadowing of variables.</p>
  </t:description>

  <t:input port="source">
    <doc/>
  </t:input>

  <t:pipeline>
    <p:pipeline version="1.0">
      <p:variable name="varName" select="0"/>
      <p:add-attribute match="doc" attribute-name="first">
        <p:with-option name="attribute-value" select="$varName"/>
      </p:add-attribute>
      <p:group>
        <p:variable name="varName" select="1"/>
        <p:add-attribute match="doc" attribute-name="second">
          <p:with-option name="attribute-value" select="$varName"/>
        </p:add-attribute>
      </p:group>
    </p:pipeline>
  </t:pipeline>

  <t:output port="result">
    <doc first="0" second="1"/>
  </t:output>

</t:test>

