Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] makeWhiteSpaceInElementContent

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] makeWhiteSpaceInElementContent
  • Date: Wed, 14 Jan 2004 11:41:56 -0500

Does anyone actually need the makeWhiteSpaceInElementContent method in NodeFactory? Or, another way of asking the question, does anyone actually need to distinguish between ignorabole and non-ignorable space? More technically, does anyone actually need to distinguish between white space that appears where the DTD says #PCDATA is permitted (or where no declaration applies) and white space where the DTD says #PCDATA is not permitted?

Currently the XOM model does not distinguish between white space in element content and regular white space, only the NodeFactory does. It occurred to me yesterday that probably the only reason I did that was for symmetry with SAX, which distinguishes them. However, SAX can just as easily use the makeText() call for ignoreableWhiteSpace() as it can makeWhiteSpaceInElementContent(). Indeed, the default implementation of makeWhiteSpaceInElementContent just calls makeText() anyway.

In my experience, most programmers who want to distinguish white space in element content form other white space don't really want to do that. What they really want to eliminate is boundary white space, regardless of what the DTD says or whether there's a DTD. This could still be done with an appropriate NodeFactory subclass, just as it is done now.

One other thing: if I remove makeWhiteSpaceInElementContent now it would be easy to put it back in later if a need arises. If I keep it in for 1.0, then it's basically not possible to remove it later. Leaving it out now while I'm uncertain about it feels like the more conservative approach.

--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page