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

RE: When is xsl:text relevant?

Subject: RE: When is xsl:text relevant?
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Wed, 8 Jun 2005 15:40:11 +0300
RE:  When is xsl:text relevant?
Hi,

> As I'm not a guru of XSLT, I am surely missing a point but
> why would I should
> use xsl:text?
>
> Look at the following example :
> http://www.w3.org/TR/xslt#result-element-stylesheet
>
> Would it make more sense to use :
> <p><xsl:text>Total Amount: </xsl:text></p>
>
> Instead of :
> <p>Total Amount: </p>
>
> I've red the doc but I'm still not confident on when to use xsl:text.

The spec's pretty clear, I think. <http://www.w3.org/TR/xslt#element-text>
says:

  "This wrapping may change what whitespace characters are stripped (see [3.4
Whitespace Stripping]) but does not affect how the characters are handled by
the XSLT processor thereafter."

and <http://www.w3.org/TR/xslt#strip>:

  "For stylesheets, the set of whitespace-preserving element names consists of
just xsl:text."

I.e. if you have

  <p>
<p>

The whitespace text node child of the p element will be stripped. However, if
you have

  <p><xsl:text>
</xsl:text></p>

the whitespace will be preserved.


Cheers,

Jarno

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.