XML document type definition

xiaoxiao2021-03-06  66

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

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. . 2, Any: Contains the contents of the elements defined in any DTD. 3, #pcdata: Pure text, no self-elements. . 4, combined type: . Symbol meanings: Less occur at least once; * can appear once, including 0 times;? 0 or once; (a, b, c) a, b, and c must appear, and appear in the specified position.

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: >>>

转载请注明原文地址:https://www.9cbs.com/read-111279.html

New Post(0)