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

Re: Plain Text Handling in XSLT Output

Subject: Re: Plain Text Handling in XSLT Output
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 7 Jun 2006 11:07:19 +0100
xsl plain text email
white space nodes in a stylesheet are stripped by default) (so you can
indent your xsl code without affecting the result. various ways to
change the default the easiest is to use <xsl:text>...</xsl:text>
so
<xsl:value-of select="Firstname"/> <xsl:value-of select="Lastname"/>

could be
<xsl:value-of select="Firstname"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Lastname"/>
or
<xsl:value-of select="concat(Firstname,' ',Lastname)"/>
or (in XSLT2)

<xsl:value-of select="Firstname,Lastname"/>


            ">
            (<

That node is not white space it;s a newline a bunch of spaces and a ( so
is not stripped and appears as is in the result. Golden rule is always
put all text in an xsl:text element if you are indenting code

           ">
    <xsl:text>(</xsl:text>
   <xsl:value-of ...

now the indentation spaces are in white space text nodes and so are
ignored.


David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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-2011 All Rights Reserved.