Assaf Arkin wrote: > > +1 from me :-) > > arkin > > Andy Clark wrote: > > > > Assaf Arkin wrote: > > > > > > Ignorable whitespace, not just whitespace. > > > > Good point. > > > > > I think the feature should be "include ignorable whitespace as text > > > nodes" and off by default.
Well sorry to disagree but I think the other way is better. Ignorable whitespace should be included by defaults. The main reason for that is: By the XML 1.0 spec validating XML processors are required to provide this information [1], and this is confirmed by the XML Infoset spec [2]. [1] http://www.w3.org/TR/REC-xml#sec-white-space [2] http://www.w3.org/TR/1999/WD-xml-infoset-19991220#infoitem.character In addition, it seems desirable that the tree doesn't change too much whether the validation is on or off. While DOM Level 2 doesn't expose the fact that there are Text nodes containing such whitespace (commonly called "ignorable whitespace"), it is on the issues list for DOM Level 3. > > So how about the following ID? > > > > http://apache.org/xml/features/dom/include-ignorable-whitespace > > > > It's getting a little verbose but that's probably erring on > > the side of understandability. I don't care much what the name is. Besides, Assaf, I really think that a serializer ought to look into the Text nodes and deal with the fact that there may be some leading and trailing whitespace. I consider not doing so a bug, since it makes all of your efforts to smartly indent the nodes moot. -- Arnaud Le Hors - IBM Cupertino, XML Technology Group