[XML-SIG] 4DOM compliance potential problem

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu, 22 Mar 2001 14:32:24 +0100


> It seems to me that 4DOM does not comply on tht spec regarding this
> point.  OTOH, the intended behaviour seems a real pain to implement
> (requires an access to the DTD when using validation, since the
> required info is not available from a SAX interface)

A primary problem is that SAX does not suppot reporting whether the
information came from the DTD or from the document, see

http://lists.xml.org/archives/xml-dev/200102/msg00761.html

David Megginson has no intent to add it to SAX (or to continue
development of SAX, for that matter).

Even *if* that information was available through SAX, you still need a
validating parser to properly build the DOM tree - a non-validating
parser would not guess that an absent attribute might need to appear
in the tree.

So it appears that the DOM requires a parser to read the DTD. However,
they also write

# XML does not mandate that a non-validating XML processor read and
# process entity declarations made in the external subset or declared
# in external parameter entities.

In turn, I'd say that it is actually a bug in the DOM spec to mandate
that the specified attribute "works" - it should be a three-state
value: yes, no, maybe, and Attr nodes for unspecified but defaulted
attributes should not be mandated.

Regards,
Martin