Altova Mailing List Archives


Re: Does DTD validation work with namespaces?

From: Norman Walsh <ndw@------.--->
To: xml-dev@-----.---.---
Date: 8/9/2000 5:27:00 AM
/ Amy Lewis <amyzing@t...> was heard to say:
[...]
| A treatise combining elements of mathematics, chemistry, with
| illustrations and bibliographic information can't be written?

Sure it can. But if I was doing it, I'd want a combination of schemas
(XML Schemas, DTDs, whatever) that defined what the legitimate
combination of vocabularies was. I don't see how to validate
documents, in any meaningful sense, otherwise.

Is this valid?

  <docbook:para>This is some text
  <html:i>with emphasis</html:i>
  </docbook:para>

Well, I suppose if your processing model is that all things not in
your namespace are ignored, then it is. But if I was writing
stylesheets, or software to do semantic indexing, or any other
application I can think of, it wouldn't be meaningful validity.

Consider this:

  <docbook:para>This is some text
  <html:i>with emphasis <docbook:inlinemediaobject>
  <docbook:imageobject><docbook:imagedata fileref="foo.png"/>
  </docbook:imageobject></docbook:inlinemediaobject></html:i>
  </docbook:para>

If you don't constrain how vocabularies are mixed, it just becomes
hopelessly messy.

If you want ANY, you have the DTD "ANY" content model and XML Schemas
gives you finer control. I could write an XML schema, for example,
that said that the content model of "equation" was a couple of DocBook
elements or anything from the MathML or SVG namespaces. (But not from
arbitrary other namespaces).

| SVG, at least, is intended for inclusions, rather than for the creation
| of standalone documents; is this inclusion only via XInclude/XLink?

No, but in DocBook it'll only be allowed inside <mediaobject> and
<inlinemediaobject>. Just because it's intended for inclusion, doesn't
mean that it makes sense to include it *anywhere*.

| Or could I create a grand-unifying DTD for work in the field of
| statistical chemistry (say) that, by importing the domain-specific DTDs
| for mathematics, chemistry, graphics, bibliographies, and general
| document-oriented text, permitted all of these elements, in some
| specified (to whatever degree of specificity) order?

That's what I'd do. Although I think exactly how is by no means a
question that we have a complete and satisfactory answer for at this
time.

| Or must I say, "Nope, can't do that," and "just" do XHTML?

No! :-)

                                        Be seeing you,
                                          norm

-- 
Norman.Walsh@E... | One's never alone with a rubber duck.
XML Technology Center     | 
Sun Microsystems, Inc.    |

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.