|
Subject: RE: replacing linefeeds with tag From: Kay Michael <Michael.Kay@xxxxxxx> Date: Thu, 11 May 2000 09:40:29 +0100 |
> Is it possible using xsl (msxml) to go through a document and replace
> linebreaks with a tag (like <br/>) kan you have a pattern match for a
> ascii-charcode, what's the charcode for linebreaks, 10?
For XSLT the answer is along the lines of:
<xsl:template match="text()">
<xsl:call-template name="break">
</xsl:template>
<xsl:template name="break">
<xsl:param name="text" select="."/>
<xsl:choose>
<xsl:when test="contains($text, '
')"/>
<xsl:value-of select="substring-before($text, '
')"/>
<br/>
<xsl:call-template name="break">
<xsl:with-param name="text" select="substring-after($text,
'
')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Not tested.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| replacing linefeeds with tag, Mattias Konradsson | Thread | How to ignore whitespaces during pa, Aleksandrs Jakovlevs |
| XSL and SELECT, gilles lescot | Date | RE: External Function Call From Sty, Kay Michael |
| Month |