Re: Validity of DOM documents

At 02:25 PM 12/3/97 -0500, Joe Lapp wrote:

>(1) Will the DOM XML spec layer on top of the core (hiding the core),
>    or will it live beside the core, leaving both core interfaces and
>    DOM XML interfaces exposed?  Or is some other role intended?

The XML interfaces supplement, but do not hide the core.

>(2) Will the DOM XML interfaces be expected to function with an
>    underlying DOM document that is invalid with respect to its DTD?
>    It seems that such a model would need to expose ways for the
>    client to correct the document, which might require the client
>    to force the document through a series of invalid states before
>    ultimately arriving at a valid one.

Yes.  The DOM insists that the underlying document be well-formed, but
makes no assertions about its validity vis a vis the DTD.  One could (as a
previous reply indicated) add validation functions built with the DOM
methods, and we could imagine these being added to the DOM itself someday,
but I can't imagine ever forcing the document to be DTD-valid in order for
it to work with the DOM.

>(3) Will the DOM XML interfaces be able to enforce XML-specific
>    document rules so that a client generating (or modifying) an
>    XML document through the interfaces cannot create an invalid
>    document?  (This might require layering DOM XML on top of the
>    core XML so that the client cannot tweak the document directly.)

I personally have no interest in enforcing such restrictions in the DOM
itself; perhaps some vendor could write a DOM client (e.g., a JavaBean)
that extends the DOM to provide these features.  One could imagine a
"VALIDXML" interface that supplements the XML interface in the DOM itself,
but I'm pretty sure the WG won't get around to it for quite some time even
if demand exists.  

>(4) Will other "levels" of DOM interact directly with the core DOM
>    and hence bypass constraints that might be specific to XML or
>    HTML or some other type of document?
>

I don't understand; is this still relevant in light of the other answers
you've received?  Again, anyone can write their own extensions to the DOM
on top of the core API; the constraints of the XML or HTML interfaces are
only relevant if you go thru those interfaces.

Mike Champion

Received on Wednesday, 3 December 1997 14:54:22 UTC