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

RE: Effects of white space between xml elements

Subject: RE: Effects of white space between xml elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 23 Feb 2009 23:15:38 -0000
RE:  Effects of white space between xml elements
> Does white space between elements of an xml document effect 
> the output of a transformation of that document?

In general yes.

> If tags are nested properly, shouldn't white 
> space and new lines in between elements be irrelevant?

No. Consider:

<p>He was <i>nearly<i> <i>twelve</i>.</p>

Note however that many products give you the option to get rid of
inter-element whitespace when processing the kind of XML where you don't
want it. You can control this from the stylesheet using xsl:strip-space.
MSXML, notoriously, gets rid of it by default, causing data such as the
example above to be rendered incorrectly.

(On page 1005 of my XSLT 2.0 book is a screen shot showing how the XML 1.0
Recommendation displays incorrectly in Internet Explorer as a direct result
of this).

Michael Kay
http://www.saxonica.com/

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-2007 All Rights Reserved.