<!DOCTYPE Name1 Dtd>
<!DOCTYPE name1 SYSTEM 'file path'> or <!DOCTYPE name1 [ <!ELEMENT name2 def> .... ] > DTD can contain the following types of markup declarations:
|
<!ELEMENT Name ContentSpec> element type declaration
ContentSpec can be:
content model can be:
In this sample, element person must have all three children elements, in a given order (one name, than one height and than one address).
<!ELEMENT PERSON (NAME, HEIGHT, ADDRESS)>
In this sample, element hobby must have only one of given elements
<!ELEMENT HOBBY (SKIING | SKATING |
FISHING)>
repeatability in content model can be:
The following sample allows for one or more NAMEs. <!ELEMENT PERSON (NAME+, HEIGHT, ADDRESS)> And next sample allows for repeating hobbies and also for none of them. <!ELEMENT HOBBY (SKIING | SKATING | FISHING)*>
mixed content can be:
The following sample allows for just textual description of a hobby. <!ELEMENT HOBBY (#PCDATA)>
The following sample allows for multiple textual descriptions intermixed with skiing, skating and/or fishing child elements.
<!ELEMENT HOBBY (#PCDATA, (SKIING |
SKATING | FISHING))*> |
<!ATTLIST ElementName AttributeName AttributeType DefaultDeclaration> attribute list declaration
attribute type can be:
The following sample allows for a textual attribute named Class for the element BOOK_TYPE with default value of 'fiction'. <!ATTLIST BOOK_TYPE Class CDATA 'fiction'>
<!ELEMENT ITEM (#PCDATA)> <!ATTLIST StockCode ID #REQUIRED GoesWith IDREF #IMPLIED> <ITEM StockCode=�C1243�>A Car</ITEM> <ITEM StockCode=�C1244� GoesWith=�C1243�>A Car Motor</ITEM> IDREFS allows for multiple IDREFs.
Refers to external files.
Name token(s).
<!ELEMENT BOOK (#PCDATA)>
|
SECTIONS
<![CDATA[ section Allows for CDATA text, including characters '<', '>', & etc. until ]]> is encountered. Used for inclusion of XML like tags into XML document as a text.
Sample:
<![IGNORE[ section
<![INCLUDE[ section
|