This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Disable Output Escaping - really useful
Which I naturally want to turn into something like this:
<p>
Some <font color="green">green</font> text.
</p>
<para>
Some <?Pub _font FontColor="green"?>green<?Pub /_font?> text.
</para>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
>
<xsl:template match="para">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template
match="para/text()
[count(following-sibling::processing-instruction()) mod 2 = 1]"/>
<xsl:template match="text()" mode="yes">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="processing-instruction('Pub')">
<xsl:variable name="x" select="count(following-sibling::processing-instruction())"/>
<xsl:if test="$x mod 2 = 1">
<font color="{substring-before(substring-after(.,'FontColor="'),'"')}">
<xsl:apply-templates select="following-sibling::node()[
count(following-sibling::processing-instruction())=$x]" mode="yes"/>
</font>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
xt norm1.xml norm1.xsl
<?xml version="1.0" encoding="utf-8"?>
<p>
Some <font color="green">green</font> text.
</p>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list