W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1997

Re: Validity of DOM documents

From: Gavin Nicol <gtn@eps.inso.com>
Date: Wed, 3 Dec 1997 17:30:17 GMT
Message-Id: <199712031730.RAA08048@nathaniel.eps.inso.com>
To: jlapp@acm.org
CC: www-dom@w3.org
>It seems to me that objects comprising DOM map isomorphically
>into the elements comprising an XML document.  Given that
>validity is defined for an XML document, it should be possible
>to define validity for a DOM document through this mapping.
>Such a definition would likely be intuitive and directly
>derivable from the XML definition.

Yes. It should be possible (once all the smoke has settled down) to
write a fairly simple peice of software that will validate a DOM
representation of a document using the instance and DTD
representations. Note that the latter is only available in XML, so
only XML document can be validated in this manner (not good, I
think...). 

>(1) Does the term "validation" in the Level 1 draft refer to
>    ensuring document validity, where validity is defined by
>    derivation as I have suggested above?  If not I'm curious
>    to know what it refers to or whether the whole notion is
>    still being left open (and what it might entail).
>
>(2) If for purposes of this question we do define validity as
>    I suggest above, what does DOM have to say about the
>    validity of DOM documents?  In particular, I'd like to
>    know the degree to which DOM allows for the creation of
>    invalid documents and what DOM interface operations
>    require that validity be preserved.

The problem for the DOM is that some of the reference applications
(editors and scripts) will *often* create documents that are invalid
according to the content model defined in the DTD. Which is why we
have the comment in the documents.

However, there are actually *two* levels of validity that are
important for the DOM:

   1) Validity of the DOM representation in terms of the model
      espoused by the DOM standards. For example, it should not be
      possible to have an Element appear in the content of an
      Attribute.
   2) Validity according to the DTD.

I do not think we can call our work on level one complete until we
have defined validity for (1), but we *can* move forward without
defining validity for (2) (and indeed, (2) is very application
specific, so the DOM might be better off *not* saying anything about
it). 
Received on Wednesday, 3 December 1997 12:30:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:44 GMT