[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
xerces linefeed
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:when test="string-length($rest)=0"><xsl:value-of 
select="$indent"/><xsl:value-of select="$block"/></xsl:when>
<xsl:value-of select="$indent"/><xsl:value-of select="substring-
<xsl:call-template name="indenter">
    <xsl:with-param name="block" select="$rest"/>
    <xsl:with-param name="indent" select="$indent"/>

Called by:

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

Any ideas?

Steve Carton

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

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.