Defining document encoding is absolutely necessary, otherwise Chinese characters cannot be displayed:
<? XML version = "1.0" encoding = "gb2312" ?>
Generally, labels in XML are in uppercase and attributes are in lowercase.
<! -- Use DTD (Document Type Definition) in three forms: -->
<! -- 1. When a local file is used, it will automatically search -->
<! Doctype document system "My. DTD" >
<! -- 2. Use remote files -->
<! Doctype document system "http: // mysite/My. DTD" >
<! -- 3. Declare a public DTD
Usage:
<! Doctype document public [FPI] [DTD]>
Here, FPI is a formal public identifier:
-(Custom) | + (non-standard group approval) // organization name // type & version/Language
DTD is the link to the DTD file.
-->
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en"
Http://www.w3.org/TR/html4/loose.dtd" >
<! --Internal DTD call method:-->
<!Doctype document root element [
Document Type Definition (same as external files)
]>
Several methods of element declaration:
<! -- 1. String Element -->
<! Element (# pcdata) >
<! -- 2. element of the tape Element -->
<! Element element name (child element 1, child element 2) >
<! -- 3. The above two mixed Elements
It will be valid if it is a string, a sub-element, or both. -->
<! Element element name (# pcdata | child element name) >
<! -- 4. Empty or any element
Empty indicates that this element cannot contain any content; Any indicates that this element is always valid. -->
<! Element element name: empty >
<! Element element name: empty >