<?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:insert #008</t:title>

<t:input port='source'>
<doc>
  <div>
    <p>First paragraph.</p>
    <p>Middle paragraph.</p>
    <p>Last paragraph.</p>
  </div>
</doc>
</t:input>

<t:pipeline>
<p:pipeline version='1.0' name="pipeline">

<p:insert match="div/p[1]" position="after">
  <p:input port="source">
    <p:pipe step="pipeline" port="source"/>
  </p:input>
  <p:input port="insertion">
    <p:inline><p>New first paragraph</p></p:inline>
  </p:input>
</p:insert>

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

<t:output port='result'>
<doc>
  <div>
    <p>First paragraph.</p><p>New first paragraph</p>
    <p>Middle paragraph.</p>
    <p>Last paragraph.</p>
  </div>
</doc>
</t:output>

</t:test>

