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

  <t:description xmlns="http://www.w3.org/1999/xhtml">
    <p>Tests attribute-namespace. If you attempt to duplicate a prefix,
    make sure the namespace bindings don't get mangled!</p>
  </t:description>

  <t:input port='source'>
    <document>
      <element bar:baz="baz" xmlns:bar="http://bar.com/"/>
    </document>
  </t:input>

  <t:pipeline>
    <p:pipeline version='1.0' name="pipeline">
      <p:add-attribute match="element"
                       attribute-name="foo"
                       attribute-value="bar"
                       attribute-prefix="bar"
                       attribute-namespace="http://bar2.com/"/>
    </p:pipeline>
  </t:pipeline>

  <t:output port="result">
    <document>
      <element bar2:foo="bar" xmlns:bar2="http://bar2.com/"
               bar:baz="baz" xmlns:bar="http://bar.com/"/>
    </document>
  </t:output>

</t:test>


