DTD - 来自网络的实例

电视节目表 DTD

由 David Moisan 创造。拷贝自:http://www.davidmoisan.org/

  1. <!DOCTYPE TVSCHEDULE [
  2.  
  3. <!ELEMENT TVSCHEDULE (CHANNEL+)>
  4. <!ELEMENT CHANNEL (BANNER,DAY+)>
  5. <!ELEMENT BANNER (#PCDATA)>
  6. <!ELEMENT DAY (DATE,(HOLIDAY|PROGRAMSLOT+)+)>
  7. <!ELEMENT HOLIDAY (#PCDATA)>
  8. <!ELEMENT DATE (#PCDATA)>
  9. <!ELEMENT PROGRAMSLOT (TIME,TITLE,DESCRIPTION?)>
  10. <!ELEMENT TIME (#PCDATA)>
  11. <!ELEMENT TITLE (#PCDATA)>
  12. <!ELEMENT DESCRIPTION (#PCDATA)>
  13.  
  14. <!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED>
  15. <!ATTLIST CHANNEL CHAN CDATA #REQUIRED>
  16. <!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED>
  17. <!ATTLIST TITLE RATING CDATA #IMPLIED>
  18. <!ATTLIST TITLE LANGUAGE CDATA #IMPLIED>
  19.  
  20. ]>

报纸文章 DTD

拷贝自:http://www.vervet.com/

  1. <!DOCTYPE NEWSPAPER [
  2.  
  3. <!ELEMENT NEWSPAPER (ARTICLE+)>
  4. <!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)>
  5. <!ELEMENT HEADLINE (#PCDATA)>
  6. <!ELEMENT BYLINE (#PCDATA)>
  7. <!ELEMENT LEAD (#PCDATA)>
  8. <!ELEMENT BODY (#PCDATA)>
  9. <!ELEMENT NOTES (#PCDATA)>
  10.  
  11. <!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>
  12. <!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
  13. <!ATTLIST ARTICLE DATE CDATA #IMPLIED>
  14. <!ATTLIST ARTICLE EDITION CDATA #IMPLIED>
  15.  
  16. <!ENTITY NEWSPAPER "Vervet Logic Times">
  17. <!ENTITY PUBLISHER "Vervet Logic Press">
  18. <!ENTITY COPYRIGHT "Copyright 1998 Vervet Logic Press">
  19.  
  20. ]>

产品目录 DTD

拷贝自:http://www.vervet.com/

  1. <!DOCTYPE CATALOG [
  2.  
  3. <!ENTITY AUTHOR "John Doe">
  4. <!ENTITY COMPANY "JD Power Tools, Inc.">
  5. <!ENTITY EMAIL "jd@jd-tools.com">
  6.  
  7. <!ELEMENT CATALOG (PRODUCT+)>
  8.  
  9. <!ELEMENT PRODUCT
  10. (SPECIFICATIONS+,OPTIONS?,PRICE+,NOTES?)>
  11. <!ATTLIST PRODUCT
  12. NAME CDATA #IMPLIED
  13. CATEGORY (HandTool|Table|Shop-Professional) "HandTool"
  14. PARTNUM CDATA #IMPLIED
  15. PLANT (Pittsburgh|Milwaukee|Chicago) "Chicago"
  16. INVENTORY (InStock|Backordered|Discontinued) "InStock">
  17.  
  18. <!ELEMENT SPECIFICATIONS (#PCDATA)>
  19. <!ATTLIST SPECIFICATIONS
  20. WEIGHT CDATA #IMPLIED
  21. POWER CDATA #IMPLIED>
  22.  
  23. <!ELEMENT OPTIONS (#PCDATA)>
  24. <!ATTLIST OPTIONS
  25. FINISH (Metal|Polished|Matte) "Matte"
  26. ADAPTER (Included|Optional|NotApplicable) "Included"
  27. CASE (HardShell|Soft|NotApplicable) "HardShell">
  28.  
  29. <!ELEMENT PRICE (#PCDATA)>
  30. <!ATTLIST PRICE
  31. MSRP CDATA #IMPLIED
  32. WHOLESALE CDATA #IMPLIED
  33. STREET CDATA #IMPLIED
  34. SHIPPING CDATA #IMPLIED>
  35.  
  36. <!ELEMENT NOTES (#PCDATA)>
  37.  
  38. ]>