OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Handling of significant whitespace in .NET XmlReade r

[ Lists Home | Date Index | Thread Index ]
  • To: "Simon St.Laurent" <simonstl@simonstl.com>,<xml-dev@lists.xml.org>
  • Subject: RE: [xml-dev] Handling of significant whitespace in .NET XmlReade r
  • From: "Derek Denny-Brown" <derekdb@microsoft.com>
  • Date: Tue, 8 Jul 2003 10:01:41 -0700
  • Thread-index: AcNCMSPjpF9RnL2EToyIwBdBrGjO0wDQAYxQ
  • Thread-topic: [xml-dev] Handling of significant whitespace in .NET XmlReade r

That actually surprises me greatly.  Msxml's default (chosen for
performance, many moons ago) was to discard explicit text nodes for
whitespace, but to internally preserve that some whitespace did exist.
This can be turned off via xml:space or doc.preserveWhitespace = true.
The net effect was that node.text, node.xml, and xslt should insert a
space (or newline) there, but would loose the precise original
whitespace markup.  There have been bugs regarding this, but there has
always been the xml:space-"preserve" work-around.

Oddly enough, Despite the fact that this behaviour deviates from what
XML/DOM recommends, I have had many users actually _thank_ us for
behaving this way.  For document's which don't have mixed content,
Msxml's default generated DOM trees which are easier to navigate because
they don't have lots of text nodes.  From the perspective of many
xml-novices, these text nodes are 'clutter'...  Not exactly a design
goal when we decided to do things this way (primary reasoning was memory
footprint and perf, both of which it aids significantly), but an amusing
fall-out.

Whitespace handling rules is one of the top issues on my list of
problems with Xml.  There is no solution which answers all customers'
needs.  If Xml had just provided a way to unambiguously identify mixed
content without a DTD, this would not be a problem.  I remember the
(many & long) discussions on the topic and I don't fault those who made
the decision.  Hindsight is always 20/20.

-derek

> -----Original Message-----
> From: Simon St.Laurent [mailto:simonstl@simonstl.com]
> Sent: Friday, July 04, 2003 6:32 AM
> To: xml-dev@lists.xml.org
> Subject: Re: [xml-dev] Handling of significant whitespace in .NET
XmlReade
> r
> 
> davidc@nag.co.uk (David Carlisle) writes:
> >It's virtually impossible to style an input document
> ><p>
> ><b>this<b> <i>is</b> <span class="zzz">bad</span>
> ></p>
> >using (say) XSLT in IE6 without losing the interword spaces, which is
a
> >shame as otherwise it would be quite possible to use XSLT to give
XHTML
> >(1 and 2) rendering in IE.
> 
> Wow.  Now that's a serious bug.
> 
> Maybe it's worth adding to the list at:
> http://webstandards.org/opinion/archive/2003/06/27/
> 
> 
> --
> Simon St.Laurent
> Ring around the content, a pocket full of brackets
> Errors, errors, all fall down!
> http://simonstl.com -- http://monasticxml.org
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
> 






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS