RE: Ignorable whitespace and XSLT
> 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 out. 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 http://www.saxonica.com/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format