A.5. XML DTDsInherited from SGML, the XML DTD is the most widely deployed means of defining an XML schema. Defined in the XML 1.0 Recommendation, DTDs do not support namespaces, which were specified later. This, together with the fact that its datatype system is weak and applies only to attributes, is one of the main motivations for the W3C to develop a new schema language. Table A-1 provides the fact sheet for XML DTDs. Table A-1. XML DTD fact sheet
A.5.1. Example<!ELEMENT author (name, nickName, born, dead)> <!ATTLIST author id ID #REQUIRED > <!ELEMENT author-ref EMPTY> <!ATTLIST author-ref id IDREF #REQUIRED > <!ELEMENT book (isbn, title, author-ref*, character-ref*)> <!ATTLIST book id ID #REQUIRED > <!ELEMENT born (#PCDATA)> <!ELEMENT character (name, since, qualification)> <!ATTLIST character id ID #REQUIRED > <!ELEMENT character-ref EMPTY> <!ATTLIST character-ref id IDREF #REQUIRED > <!ELEMENT dead (#PCDATA)> <!ELEMENT isbn (#PCDATA)> <!ELEMENT library (book+, author*, character*)> <!ELEMENT name (#PCDATA)> <!ELEMENT nickName (#PCDATA)> <!ELEMENT qualification (#PCDATA)> <!ELEMENT since (#PCDATA)> <!ELEMENT title (#PCDATA)> Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|