Detecting a linefeed in input text, how?

Subject: Detecting a linefeed in input text, how?
From: "Steve Carton" <scarton@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 9 Aug 2000 12:59:14 -0400
I'm processing a node that has embedded line feed characters.  I'm 
trying to output the original lines, but with spaces added to the front.  
I wrote the following template, but it doesn't detect the line feeds:

<xsl:template name="indenter">
<xsl:param name="block"/>
<xsl:param name="indent"/>
<xsl:variable name="rest" select="substring-after($block,'#0A')"/>
<xsl:choose>
<xsl:when test="string-length($rest)=0"><xsl:value-of 
select="$indent"/><xsl:value-of select="$block"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="$indent"/><xsl:value-of select="substring-
before($block,'#0A')"/>
<xsl:call-template name="indenter">
    <xsl:with-param name="block" select="$rest"/>
    <xsl:with-param name="indent" select="$indent"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


Called by:

<xsl:call-template name="indenter">
    <xsl:with-param name="block" select="."/>
    <xsl:with-param name="indent" select="'     '"/>
</xsl:call-template>

Any ideas?

Steve Carton


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


Current Thread