* Write a document to restrict the current XML document
Classification
* DTD
* Document Association
* Internal Association
* Format: <! DOCTYPE root element [syntax]>
* External Association
* Format: <! DOCTYPE root element SYSTEM "URI" >
* Public Association
* Format: <! DOCTYPE root element Public "document name" "Document URL" >
* Element
* Format: <! ELEMENT name constraint >(Example <! ELEMENT Shiporder (orderperson,shipto,item+) >)
Symbol
? : 0 1
+: >=1
*: >=0
(): Group
| : Select
,: Order
Type
#PCDATA, can only write characters, cannot contain child elements,Note: (#PCDATA) (Example <! ELEMENT name (#PCDATA) >)
Empty, element content is null
and, element content arbitrary
Properties
* Format: <! attlist element name [property name attribute type constraint ...] >(Example <! Attlist Book
ID ID #REQUIRED
pId IDREF #IMPLIED
City CDATA #FIXED "Beijing"
Lang (en| cn| jp| TW) "CN" >)
* Type
* CDATA, character
* (), select
* ID, set Unique identifier, note that must start with letter
* IDREF, referencing the ID value that exists again
* Constraint
* #REQUIRED, must fill in
* #IMPLIED, Optional
* #FIXED value, fixed value
* DefaultValue, default value
* Entity
* Internal Entity
* Referencing Entities
* Format: <! Entity entities name "Content" >
* Usage Location: used in XML document
* Use format:& entity name;
* Parametric entity
* Format: <! Entity% entities Name "content" >
* Usage location: used in DTD documents
* Use format:% entity name;
* External Entities
* Format: <! Entity entities name SYSTEM "URI" >
* Usage Location: used in XML document
* Use format:& entity name;
* Schema
* Extension: *.xsd
* Schema document is based on XML
* Schema document, root element is schema, defined in Http://www.w3.org/2001/XMLSchema
DTD and Shema Learning