- From: Paul Grosso <paul@arbortext.com>
- Date: Thu, 19 Jun 1997 14:47:42 -0500
- To: w3c-sgml-wg@w3.org
At 12:36 1997 06 19 -0600, Dave Hollander wrote: > >Regarding validation > >I would like to understand better just what type(s) of correctness >testing may be possible with the <dc:name> approach. As I see it, we can: > 1. perform well-formed testing > 2. validate...which portions would be able to be validated if only the > "base" DTD is available? > 3. apply application specific tests to fragment content I'd like to make a comment about #2 above. Suppose I shoot you the following well-formed XML document: <?XML version='1.0'?> <mydoc> <title>A Title</title> <p>Some text that contains a mathematical formula here: <formula XML-content-namespace="aapmath"> <f><a><ac>H</ac><ac>&d1;</ac></a>=3x<sup>2</sup>-4</f> </formula> written using the <a href="www.aap.org/dtds/math.dtd">AAP math DTD</a>.</p> </mydoc> [I made up the aap.org URL, but the formula markup is valid AAP.] Now the point is that mydoc is well-formed, but can't be valid because there is no DTD. But there is a DTD for the subtree defined by the <f> element, and it might very well be important that that subtree does validate against its DTD (because my equation processor requires only valid AAP-marked up input). What you can have are what I call "islands of validity" in a well-formed document. <Tangent>This leads to another interesting (to me) concept, though I'm not sure of its usefulness: suppose you have a document instance that "looks like" a 12083 article consisting of two chapters, but the second chapter--while well-formed--has sect3's containing sect2's and title's containing paragraphs. Also, the document is missing the required front matter, so the overall document is not valid. But chapter one *is* valid when compared to the DTD. Now suppose you define two namespaces: one of which is the ISO 12083 article DTD and the other of which is a special DTD that consists of declarations for all the elements in 12083 but where each element's content model is ANY. Now, if you attach the ANYDTD namespace to the overall document instance and attach the 12083 namespace to chapter one, you have a completely validatable document. (If you were a smart editing tool trying to fix a well-formed but invalid document, you could start by giving the document an overall "ANY" namespace and then switch the namespace of subtrees to the real DTD as each subtree becomes valid. When there are no more elements in the ANY namespace, you're done fixing the document.)</Tangent> paul
Received on Thursday, 19 June 1997 15:48:47 UTC