I have a bunch of auto-generated HTML doing such stupid things:
<p>Hey it <em>italic</em><em>italic</em>!</p>
And I would like to sing this:
<p>Hey it <em>italicitalic</em>!</p>
My first attempt was in this direction ...
<xsl:template match="em/preceding::em">
<xsl:value-of select="$OPEN_EM"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="em/following::em">
<xsl:apply-templates/>
<xsl:value-of select="$CLOSE_EM"/>
</xsl:template>
But, apparently, the XSLT specification, in its grandest kindness, prohibits the use of standard XPath axes precedingor followingtemplates. (And that will require some tweaking to handle three ems per line anyway.)
, XSLT replace('</em><em>', '') $LANGUAGE_OF_CHOICE ? : <em>, - (, , ), , , XML, <em> . , ems ( ems), .
(, , xslt?, , . XSLT 2, , .)