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

RE: Whitespace between nodes

Subject: RE: Whitespace between nodes
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 13 May 2004 09:11:28 +0100
remove whitespace from xml file
> I suspect that your input document has the carriage returns 
> and so they are being carried to your output document 
> correctly. Since you didn't supply the source I can't be 
> sure. I think one of your processors is "helpfully" removing 
> the carriage returns improperly. If you show us the input and 
> name the processors it will be easy to help.

MSXML by default strips whitespace text nodes while building a DOM from
source input files. Other processors don't. There have been many debates
about whether the MSXML behavior is conformant or not, and the consensus
seems to be that it is against the spirit of the rules but not against the
letter: this is a detail of the design of Microsoft's API for constructing a
DOM from a source XML file, which is a proprietary API outside the control
of any W3C specs, so they can do what they like (so long as the customers
keep paying their money). The XSLT specification explicitly says that
implementations can build a source tree as input to the transformation any
way they like.

If whitespace text nodes in your source document are not significant, you
should remove them by writing <xsl:strip-space elements="*"/> in your
stylesheet. If they are significant, you should take care when using MSXML
to set the preserveWhitespace option so they are retained.

Michael Kay

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.