Re: XML Validity and DTD dependance

> No.  I want a term for "the instance document meets every single
> validity constraint from the XML spec, except that no DTD is present."

I agree with John here.  The validity constraints in the XML spec are
about the relationship of the document to the DTD, and make no sense in
the absence of a DTD.

For example, the constraint "element valid" defines what must be in
the document in each of the cases that can occur in the DTD's element
declaration ("EMPTY", Mixed, etc).  Likewise the XML Schema spec
defines how the sequence of elements must correspond to the relevant
complexType declaration in the schema.

If the XML spec's definition of "valid" *didn't* refer to DTDs, we'd
need another spec to specify what DTDs meant.  That would have been
one way to do things, but it isn't the one that was used (not least
because there weren't any other schema mechanisms yet when XML was
invented).

> What would you call it?  I would like to say "it's a valid XML
> document."  You say it would be confusing if I didn't put an XXX/something
> in front of the word valid.  Assuming I buy your confusion argument (which
> I don't; the number of XML users today greatly exceeds the half-dozen
> SGML users :), what would you suggest for XXX/something?

To address your parenthetical comment first: in my experience, XML
users generally use "valid" to mean "DTD valid" unless some other
context is explicitly present.  And other specifications and program
documentation do the same.  The XML spec is the base on which a whole
edifice is built, you can't change the meaning of the terms it
defines.

As to what to call the thing you want, I'm not sure what the right
term would be.  But in any case, it need to be more than just "valid",
because it has to say what it's valid with respect to.  The DTD is
part of the document, but other mechanisms are external, and a
document may be valid according to one XML schema and invalid with
respect to another.  In fact, *every* well-formed XML document is
valid if you choose the right DTD or schema.  So you going to need to
say something like "valid with respect to the XXX schema", in which
case there is no ambiguity and no need for a new term.  (You could
require that it contain an schemaLocation attribute, but even that
is just a hint to the schema processor.)

> Then the XML spec needs to be revised to make DTD's namespace
> aware, don'tcha think?

That would have been one solution, but instead the W3C decided to
design a namespace-aware replacement for DTDs, namely XML Schemas.

> Or do you really think that the only way
> realistic way to have valid XML documents -- or hack, let me show
> my true colors and say "XML messages -- is to not use namespaces?
> (My use of the world /realistic/ rules out the "entity hacks.")

No, the solution (or at least the W3C solution) is to have
schema-valid documents instead of valid ones.

I don't have any objection to namespace-aware DTDs as such - in fact
I'd quite like them - but nor do I have the motivation to work on
them.  If the XML Core WG was asked to vote on doing it, I'm fairly
sure that they would decline.  If you (or others) feel it is useful
enough, then you could for example produce a W3C Note describing them.
But as I said before, you also need to consider whether the XML parser
implementors you care about would support them.

-- Richard

Received on Sunday, 24 April 2005 18:24:36 UTC