I'm trying to detect and insert a processing instruction in to only <para>s
that are followed by <note>s.
IE:
<Main>
<para></para>
<para></para>
<para><?blah blah?></para>
<note></note>
<Main>
I've been working with following-sibling, but haven't been able to get it to
work:
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="//para[following-sibling::note]">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:processing-instruction
name="blah">blah</xsl:processing-instruction>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
Using the following-sibling format above, it seems to put the processing
instruction in to every paragraph. If you have any ideas or suggestions, I'd
really appreciate it.
-Mark
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list