DTD Examples

DTD – Examples from the Net


TV Scedule DTD

By David Moisan. Copied from his Web: http://www.davidmoisan.org/

<!DOCTYPE TVSCHEDULE [ <!ELEMENT TVSCHEDULE (CHANNEL+)>
<!ELEMENT CHANNEL (BANNER, DAY+)>
<!ELEMENT BANNER (#PCDATA)>
<!ELEMENT DAY ((DATE, HOLIDAY) | (DATE, PROGRAMSLOT+))+>
<!ELEMENT HOLIDAY (#PCDATA)>
<!ELEMENT DATE (#PCDATA)>
<!ELEMENT PROGRAMSLOT (TIME, TITLE, DESCRIPTION?)>
<!ELEMENT TIME (#PCDATA)>
<!ELEMENT TITLE (#PCDATA)>
<!ELEMENT DESCRIPTION (#PCDATA)>

<!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED>
<!ATTLIST CHANNEL CHAN CDATA #REQUIRED>
<!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED>
<!ATTLIST TITLE RATING CDATA #IMPLIED>
<!ATTLIST TITLE LANGUAGE CDATA #IMPLIED>

]>

 


A Report DTD

By Richard Erlander. Copied from his Web: http://pdbeam.uwaterloo.ca/~rlander/

<!DOCTYPE REPORT [

<!ELEMENT REPORT (TITLE,(SECTION|SHORTSECT)+)>
<!ELEMENT SECTION (TITLE,%BODY;,SUBSECTION*)>
<!ELEMENT SUBSECTION (TITLE,%BODY;,SUBSECTION*)>
<!ELEMENT SHORTSECT (TITLE,%BODY;)>
<!ELEMENT TITLE %TEXT;>
<!ELEMENT PARA %TEXT;>
<!ELEMENT LIST (ITEM)+>
<!ELEMENT ITEM (%BLOCK;)>
<!ELEMENT CODE (#PCDATA)>
<!ELEMENT KEYWORD (#PCDATA)>
<!ELEMENT EXAMPLE (TITLE?,%BLOCK;)>
<!ELEMENT GRAPHIC EMPTY>

<!ATTLIST REPORT security (high | medium | low ) “low”>
<!ATTLIST CODE type CDATA #IMPLIED>
<!ATTLIST GRAPHIC file ENTITY #REQUIRED>

<!ENTITY xml “Extensible Markup Language”>
<!ENTITY sgml “Standard Generalized Markup Language”>
<!ENTITY pxa “Professional XML Authoring”>
<!ENTITY % TEXT “(#PCDATA|CODE|KEYWORD|QUOTATION)*”>
<!ENTITY % BLOCK “(PARA|LIST)+”>
<!ENTITY % BODY “(%BLOCK;|EXAMPLE|NOTE)+”>

<!NOTATION GIF SYSTEM “”>
<!NOTATION JPG SYSTEM “”>
<!NOTATION BMP SYSTEM “”>

]>

 


Newspaper Article DTD

Copied from http://www.vervet.com/

<!DOCTYPE NEWSPAPER [

<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE, BYLINE, LEAD, BODY, NOTES)>
<!ELEMENT HEADLINE (#PCDATA)>
<!ELEMENT BYLINE (#PCDATA)>
<!ELEMENT LEAD (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)>

<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
<!ATTLIST ARTICLE DATE CDATA #IMPLIED>
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>

<!ENTITY NEWSPAPER “Vervet Logic Times”>
<!ENTITY PUBLISHER “Vervet Logic Press”>
<!ENTITY COPYRIGHT “Copyright 1998 Vervet Logic Press”>

]>

 


Product Catalog DTD

Copied from http://www.vervet.com/


<!DOCTYPE CATALOG [

<!ELEMENT CATALOG (PRODUCT+)>
<!ELEMENT PRODUCT (SPECIFICATIONS+, OPTIONS?, PRICE+, NOTES?)>
<!ELEMENT SPECIFICATIONS (#PCDATA)>
<!ELEMENT OPTIONS (#PCDATA)>
<!ELEMENT PRICE (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)>

<!ATTLIST PRODUCT NAME CDATA #IMPLIED>
<!ATTLIST
CATEGORY (HandTool | Table | Shop-Professional) "HandTool">
<!ATTLIST
PARTNUM CDATA #IMPLIED>
<!ATTLIST
PLANT (Pittsburgh | Milwaukee | Chicago) "Chicago">
<!ATTLIST
INVENTORY (InStock | Backordered | Discontinued) "InStock">
<!ATTLIST SPECIFICATIONS WEIGHT CDATA #IMPLIED>
<!ATTLIST
POWER CDATA #IMPLIED>
<!ATTLIST OPTIONS FINISH (Metal | Polished | Matte) "Matte">
<!ATTLIST OPTIONS
ADAPTER (Included | Optional | NotApplicable) "Included">
<!ATTLIST OPTIONS
CASE (HardShell | Soft | NotApplicable) "HardShell">
<!ATTLIST PRICE MSRP CDATA #IMPLIED>
<!ATTLIST PRICE
WHOLESALE CDATA #IMPLIED>
<!ATTLIST PRICE
STREET CDATA #IMPLIED>
<!ATTLIST PRICE
SHIPPING CDATA #IMPLIED>



<!ENTITY AUTHOR "John Doe">
<!ENTITY COMPANY "JD Power Tools, Inc.">
<!ENTITY EMAIL "[email protected]ls.com">

]>