xsl-list
[Top] [All Lists]

RE: Line end conversion.

2003-12-02 08:22:46

        Thanks to everybody who answered! The problem's been solved, like so:

<xsl:template name="break">
   <xsl:param name="text" select="."/>
   <xsl:choose>
<xsl:when test="contains($text, '&#xa;')"><xsl:value-of select="substring-before($text, '&#xa;')" disable-output-escaping="yes" />\n<xsl:call-template name="break"><xsl:with-param name="text" select="substring-after($text,'&#xa;')"/></xsl:call-template></xsl:when>
   <xsl:otherwise>
        <xsl:value-of select="$text" disable-output-escaping="yes" />
   </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<xsl:template select="example">
        <example><xsl:call-template name="break" /></example>
</xsl:template>


At 04:24 PM 12/2/2003 +0200, Jarno(_dot_)Elovirta(_at_)nokia(_dot_)com wrote:
Write a recursive template. The FAQ has an entry for this <http://www.dpawson.co.uk/xsl/sect2/replace.html#d6768e55>, but I recommend writing the stylesheet yourself for educational purposes.

        The better link for this purpose is:

        http://www.dpawson.co.uk/xsl/sect2/replace.html#d6768e13

        In case anybody asks in the future. Much simpler.

--->Ben

XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>