Lists Home |
Date Index |
I'm trying to wrap my head around validness, as per the XML specification, in
relation to DTDs and other schema languages.
First of all, the XML specification,
http://www.w3.org/TR/2000/REC-xml-20001006, not only dictates the XML syntax,
but also includes the DTD language. Put it in another way; the spec is XML
syntax plus a schema language. Is that a correct interpretation/perspective?
The spec talks about two different levels of document compliance:
well-formedness and validness. The former is the basic syntax, while the
latter refers to logical structure, as dictated by the DTD doctype at the
top, internally, or via references. For example, a validating XML parser has
nothing nothing to do with W3C XML Schema or any other schema language, but
if it checks against the DTD.
My conclusions from this reasoning, which surely can be wrong, is that for
example a XHTML document which looks like this:
<?xml version="1.0" encoding="UTF-8" ?>
is _not_ valid XML, because it doesn't have a DOCTYPE thingy. Even the spec
says it: http://www.w3.org/TR/xhtml1/#docconf.
In other words, the XML specification ties the term "validness" to a
particular syntax, the DTD schema language. It's not an abstract term which
means "conforms to a model of the XML format", such that any schema language
can be used to "define" validness.
But does it matter if a document is Not valid? What if one walks out in this
world writing/generating documents which are not valid?
The DTD specifies the logical structure, but also identifies /what/ type of
document it is, e.g. the public identifier. But isn't XML namespaces for
this? When the XHTML namespace is declared in the xhtml element, wouldn't
that be enough?