RE: [xsl] When is xsl:text relevant?

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

> 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 :
> 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. <>

  "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 <>:

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

I.e. if you have


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


the whitespace will be preserved.



Current Thread