<?xml version='1.0'?>
<?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 added xml:id support #002</t:title>

<t:pipeline>
<p:declare-step version='1.0' xmlns:p="http://www.w3.org/ns/xproc">
 <p:output port="result"/>
 
 <p:add-attribute attribute-name="xml:id" attribute-value="target" match="a[preceding-sibling::a]">
  <p:input port="source">
   <p:inline>
    <r>
     <a>one</a>
     <a>two</a>
    </r>
   </p:inline>
  </p:input>
 </p:add-attribute>
 <p:filter select="//*[count(. | id('target'))=1]"/>
</p:declare-step>
</t:pipeline>

<t:output port="result"><a xml:id="target">two</a></t:output>

</t:test>

