T
Tassilo J. Klein
Hi there,
I have an XML which is displayed using a XLS file. In order to convert
the line feets (LF) into HTML specific line breaks I use a template I
found on the internet:
<xsl:template name="lf2br">
<xslaram name="text"/>
<xsl:choose>
<xsl:when test="contains($text,'
')">
<xsl:value-of select="substring-before($text,'
')"/>
<br/>
<xsl:call-template name="lf2br">
<xsl:with-param name="text">
<xsl:value-of select="substring-after($text,'
')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$text"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
I call this template using XLS like this:
<xsl:call-template name="lf2br">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
Now the text inside the tag is formatted nicely and ready for output.
But the problem is, the text contains some tags like <Omega/> which
translate into special characters but which will not be processed due to
the hack with the lf2br routine.
This one will be omitted since not using <xsl:apply-templates/>:
xsl:template match="Omega">
<font style="font-family: Times">
<xsl:text>
Ω
</xsl:text>
</font>
</xsl:template>
I am quite new to this but I want to combine those two features - using
the lf2br routine and have those tags inside the text processed. Does
anybody know how to do that?
Thanks in advance,
Tassilo
I have an XML which is displayed using a XLS file. In order to convert
the line feets (LF) into HTML specific line breaks I use a template I
found on the internet:
<xsl:template name="lf2br">
<xslaram name="text"/>
<xsl:choose>
<xsl:when test="contains($text,'
')">
<xsl:value-of select="substring-before($text,'
')"/>
<br/>
<xsl:call-template name="lf2br">
<xsl:with-param name="text">
<xsl:value-of select="substring-after($text,'
')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsltherwise>
<xsl:value-of select="$text"/>
</xsltherwise>
</xsl:choose>
</xsl:template>
I call this template using XLS like this:
<xsl:call-template name="lf2br">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
Now the text inside the tag is formatted nicely and ready for output.
But the problem is, the text contains some tags like <Omega/> which
translate into special characters but which will not be processed due to
the hack with the lf2br routine.
This one will be omitted since not using <xsl:apply-templates/>:
xsl:template match="Omega">
<font style="font-family: Times">
<xsl:text>
Ω
</xsl:text>
</font>
</xsl:template>
I am quite new to this but I want to combine those two features - using
the lf2br routine and have those tags inside the text processed. Does
anybody know how to do that?
Thanks in advance,
Tassilo