DTD Document Type DEFINITION Document Type Definition. We can customize the tag in XML, how do the XML parser recognize these custom tags and process elements based on custom tags? This requires DTD, which is our meaning of our own defined tag, our own document defines the relevant properties of the element. DTD and XML are the relationship between classes and objects, database table structures and records. Compliance with XML rules (including the XML declaration statement must have; there must be only one root element; mark uppercase system; the attribute value is quoted; mark pair, empty mark is closed; the correct nested) XML document is called the structure. XML document; XML rules and XML documents that match DTD validation are called legitimate XML documents. IE only verifies structural integrity and does not verify legality, XMLSPY verifies legality. DTD Classification: Internal DTD; External DTD; Internal and External DTD. Advantages of External DTD: Shared by multiple XMLs, maintain a unified data exchange format, people of different organizations use the same universal DTD to exchange data; application can use a standard DTD test from external world acceptable XML data is effective . Here is a lsmx.dtd
XML Version = "1.0" encoding = "GB2312"?>
ATTLIST
Name CData #Required
Gender (Male | Female) #Required
Age cdata #Required
Hobby cdata #implied
>
Name CData #Required
Quantity cdata #Required
Description CData #implied
>
Element Definitions Keyword Element Name Element Type Element Type 1, EMPTY: Empty element, but can have attributes.
Attribute definition Property Type: 1, CDATA: Only character data is included. 2, ID: Similar primary key, must be unique. 3, NmToken does not contain Chinese CDATA. 4. Enumerate the prior definition, and the value of this property must match the listed values. Gender (Male | Female) #Required. Attribute Features: 1, # Required NotnUll is non-empty. 2, # implied can be written. 3, #fixed value fixed value, not changeable. Attribute name cdata #fixed "fixed value" 5, default value default value implementation: XML Version = "1.0" encoding = "GB2312">>>>
Family>