To validate or not to validate, that is the question

Martin Bryan mtbryan at sgml.u-net.com
Mon Aug 17 10:32:51 BST 1998


Let me see if I can suffer the slings and arrows of outrageous fortune and
pose you all a question: "Why do compound documents need to be validated as
a whole?"

The point of namespace proposal is to allow users to say "This part of my
document conforms to the rules specified in this DTD: that part of my
document conforms to the rules in that DTD. Here are some URIs that you can
use to find the rules used for checking each part of the document
structure."

If I create my document fragments using the relevant DTDs, I validate them
against those DTDs, not against a compound DTD. Once they have been
validated against the DTD I can import them into a compound document as
already validated fragments.

In the compound DTD all I need to do is to recognize when the same element
name has been used within the DTDs of two fragments. I then have two
choices:

1) To decide to change the name of one of the elements to a qualified form
to disambiguate it from the other (changing both the DTD and the previously
validated instance, so that I need to revalidate the document for safety
afterwards)
2) Change the model to the element concerned to ANY in the DTD and rely on
the fact that I have already validated the fragments against their own DTDs
to avoid any errors. (I may also have to change any attributes used by both
DTDs to CDATA to make sure there are no clashes in permitted values, but
this is equally trivial.)

As 2) is much simpler to manage I would do that in any case where I could be
sure that my imported fragments had been prevalidated.

Why does this group seem to feel there is an overpowering need to develop a
DTD that can be used to validate the compound structure, rather than its
individual fragments?

Martin Bryan


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)




More information about the Xml-dev mailing list