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

RE: Ignorable whitespace and XSLT

Subject: RE: Ignorable whitespace and XSLT
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 21 Feb 2005 15:29:09 -0000
definition ignorable
> Note that the ignorable whitespace node between the opening tag <root>
> and the opening tag <leaf> is considered a significant node in XSLT
> processing - it is still there.
> Is this intended behaviour, and if so, why?

The designers of XSLT 1.0 made a decision that the result of processing a
source document should not depend on whether or not it was read by a
validating parser. I think this was done partly to ensure predictable
results, and partly because of belief (in 1999) that DTDs were on the way

There is in fact one feature that does depend on the DTD, namely the id()
function, and that's error-prone enough to justify the decision.

We've debated a number of times whether the rules should be changed in 2.0
to make whitespace-stripping sensitive to the schema, and the WG has decided
against. There's one exception, which is that it's now an error to request
stripping of an element if the element has a simple type definition. This is
because stripping the whitespace content of such an element could destroy
its validity. (There's also the blanket exception, which is that you can
construct a source tree any way you like, including by use of a builder that
*does* take schema information into account.)

Michael Kay

Current Thread


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.
First Name
Last Name
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.