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

Re: XSL and White Space help PLEASE

Subject: Re: XSL and White Space help PLEASE
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 1 Jun 2001 21:55:41 -0700 (PDT)
domdocument white space
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 `
character.

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='http://www.w3.org/1999/XSL/Transform'
 version="1.0">
	<xsl:output method='text'/> 
	<xsl:template match="/">
   <!-- Three spaces enclosed by xsl:text -->
		`<xsl:text xml:space="preserve">   </xsl:text>`
	</xsl:template> 
</xsl:stylesheet> 


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!  http://personal.mail.yahoo.com/

 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.