W3C home > Mailing lists > Public > www-xsl-fo@w3.org > December 2007

XSL help - converting newlines into HTML </br>

From: Patryn999 <Patryn999@gmail.com>
Date: Sun, 16 Dec 2007 13:10:11 -0800 (PST)
Message-ID: <14366327.post@talk.nabble.com>
To: www-xsl-fo@w3.org

   I'm not very experienced in XML/XSL at all (only started looking at it a
couple of days ago) anyway I'm calling this stylesheet to output an XML file
with <BuildLog> stuff here with newlines in it </BuildLog> to HTML and
conserve the newlines so the formatting remains.

I've hacked together some code from other files I've read but I get an
error, and I've spent a while on it and I'm completely stumped. Cheers for
any help:

Here's the code:
<?xml version="1.0"?>
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    <xsl:output method="html"/>

    <xsl:template match="BuildLog" mode="buildlog">
                    <xsl:call-template name="newlineToHTML">
                        <xsl:with-param name="line" select="text()"/>

    <xsl:template name="newlineToHTML">
        <xsl:param name="line"/>
            <xsl:when test="contains($line, '&#10;')">
                <xsl:value-of select="sul:stylesheetstring-before($line,
                <xsl:call-template name="newlineToHTML">
                    <xsl:with-param name="line">
                        <xsl:value-of select="substring-after($line,
                <xsl:value-of select="$line"/>


Thanks in advance
View this message in context: http://www.nabble.com/XSL-help---converting-newlines-into-HTML-%3C-br%3E-tp14366327p14366327.html
Sent from the w3.org - www-xsl-fo mailing list archive at Nabble.com.
Received on Monday, 17 December 2007 13:19:20 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:31 UTC