[thelist] Multiple doctypes in one file

Hardacker, Andrew Andrew.Hardacker at Compuware.com
Fri Mar 22 14:16:01 CST 2002


<snip>
We are generating help documentation for a web application. Kinda like a
real app but over the web. Each page of the app has a corresponding help
page. We are also generating tool level help. Which is nothing more than a
combination of many of the individual pages.
..
If I use the same DTD and just make my root element for tool level optional
I could declare something like this.
<doctype PAGE "help.dtd"> for the page level
<doctype TOOL "help.dtd"> for the tool level

but I don't know that having the same DTD declared with different root
elements will work either.
</snip>

Brad,
You need to have a single root element in your DTD, but you could create a
generic root which specifies one of two children.

<!ELEMENT help (page | tool)>

or if tool is really a collection of pages, you might allow one or more
pages:
<!ELEMENT help (page+)>

On the other hand, you could drop the DTD altogether if you are both the
creator and the consumer of the file and trust that you're giving yourself
valid XML. Validation isn't necessary unless you are using something like
the ID attribute.

HTH

Andy Hardacker
http://hardacker.com/



The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.




More information about the thelist mailing list