Re: "Empty" Text Nodes

Arkin wrote:
> 
> Oliver Becker wrote:
> >
> > Ok, let's summarize:
> >
> > The XML spec states that "An XML processor must always pass all
> > characters in a document that are not markup through to the
> > application".
> >
> > My question: on which level the DOM is aligned?
> > Is it attached to a XML parser, or is it more
> > attached to a XML application?

I'd say it's clear that as written, DOM is attached to the application
rather than to the "XML Processor" (not parser!) level.

 
> I think this is one point where the XML/DOM specification totally blew
> it off. The above specification works well if your application is
> responsible for constructing the document tree from a parsed document.

Presumably you mean the "DOM Level 1 Core" API spec, not a combination
of the XML and DOM specifications.


> That's how the SAX parser API works, and you application can accept or
> reject whitespaces. The parser will let your application know when text
> is just whitespace.

The features the SAX 1.0 API exposes are almost identical to those
which an "XML Processor" must support, as defined in the XML 1.0
specification.  (It doesn't identify any external general entities which
were ignored, however -- assuming perhaps that they all were read.)


> In real life, most applications will just call some parser or other
> black box function and get a full DOM document tree in return. They will
> then iterate through the tree and either meet or won't meet whitespaces.
> I believe this specific use of the DOM is going to be very common, and
> is not clearly defined.

The problem has been noted.  It matters critically for almost all
languages except JavaScript, where one can't really implement a DOM
oneself, and your execution environment (e.g. web browser) will hand
one to you.

 
> I think the W3C has the obligation to strictly clarify this point in the
> specification, so that: a) all parsers behave consistently,

Make that "All DOM implementations behave consistently" and I'd be
far more inclined to agree!  It gets back to that testing/conformance
issue:  the DOM spec isn't testable without making certain assumptions
which are not supportable within scope of the spec.

- Dave

Received on Monday, 1 March 1999 11:37:24 UTC