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

Line endings fix ( &#0A to =0D=0A= conversion)

Subject: Line endings fix ( &#0A to =0D=0A= conversion)
From: Neil Smith <neil@xxxxxxxxxxxxxxx>
Date: Tue, 08 Apr 2003 21:34:38 +0100
fix line endings
Hi all - fixed my 2nd problem thansk to a url here :
http://www.biglist.com/lists/xsl-list/archives/200009/msg00840.html

Which was to convert newline characters to content-transfer encoded output for email & calendar files. The fix was to use those darn substring-before calls as below :-)

<xsl:template match="description">
	<xsl:call-template name="break">
		<xsl:with-param name="text" select="." />
	</xsl:call-template>
	<xsl:text>&#x0A;</xsl:text>
</xsl:template>


<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;')"/> <xsl:text>=0D=0A=&#xA;</xsl:text> <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"/> </xsl:otherwise> </xsl:choose> </xsl:template>

Nice trick :-)


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.