Namespaces and DTDs

There's one more topic that I want to cover now that we're discussing the basics of creating DTDs—how to use namespaces when you're using DTDs. In fact, this will give us an introduction to the next chapter, where we'll work with declaring attributes as well as elements.

The important thing to recall is that as far as standard XML processors are concerned, namespace prefixes are just text prepended to tag and attribute names with a colon, so they change those tag and attribute names. This means that those names must be declared, with their prefixes, in the DTD.

Here's an example; I'll start with the easy case where I'm using a default namespace like this:

 <?xml version = "1.0" standalone="yes"?> <!DOCTYPE DOCUMENT [ <!ELEMENT ...

Get Inside XML now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.