[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: What is the name of a document's "type"?
Out of curiosity, I just searched the XML Recommendation for the term "document type" and found that it's always followed by the words "declaration" or "definition," so a simple answer to your question, considering that a document type definition comes within a document type declaration, would be that if a document type wasn't declared, then you don't have a document type. Sort of like the way n has no value in a C "hello world" program if no variable n was declared. But I understand if you want a more helpful answer than that, and what Tim Bray said at http://lists.xml.org/archives/xml-dev/200201/msg01403.html will take you far. If you know the name of the root element, and you know the namespace that it's from, then you know a hell of a lot about the potential processing that you can do with that document. As you pointed out, knowing the name of the root element ("It's a chapter") doesn't always tell you all you need to know and knowing the namespace alone ("list the docbook documents") doesn't either, but the root element and its namespace together (a chapter from the docbook DTD) tells you a great deal about what you can do with it. Bob DuCharme www.snee.com/bob <bob@ snee.com> see http://www.snee.com/bob/xsltquickly for info on book "XSLT Quickly" from Manning Publications.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|