Re: [xsl] XSL and White Space help PLEASE

Subject: Re: [xsl] XSL and White Space help PLEASE
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 1 Jun 2001 21:55:41 -0700 (PDT)
Gutti, Sridhara wrote:

> I'm trying to insert a white space using XSL, but I don't seem to get it
> working, I'm using msxml3.0 and 
> I Tried the following..
> <xsl:text> </xsl:text> and also
> <xsl:text>&#32</xsl:text>
> Niether of those is working, can you guys help me please.. I just want to
> insert a space in the following example...

The following is a demo how to successfully handle white-space only text nodes.
When run on any xml source, it will produce three spaces enclosed by the `

xsl:text is used, but you may in the same way copy to the output any white-space
only child of any element (use xml:space="preserve" on this element).

Alternatively, set the "preserveWhiteSpace" of the DOMDocument to true.

<xsl:stylesheet xmlns:xsl=''
	<xsl:output method='text'/> 
	<xsl:template match="/">
   <!-- Three spaces enclosed by xsl:text -->
		`<xsl:text xml:space="preserve">   </xsl:text>`

If you'd be producing white-space in a html text, in many contexts it is
ignored by the browser.

If this is the case use &#xA; or enclose your white-space containing text in
the <pre>, <q> or <blockquote> tags.

Is it by coincidence that people, who are cross-posting to 4 newsgroups usually have
such nasty problems? :))

Dimitre Novatchev.

Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!

 XSL-List info and archive:

Current Thread