1. Documentation Rules 1. Case sensitive. 2. The attribute value must be enclosed in quotes (either single quotes or double quotes). In general, double quotes are recommended. 3. All tags must have an end symbol. 4. All empty tags must be closed. 5. There must be one and only one element. 6. When parsing blank characters, the actual content will be output without abbreviation. 7. Special character processing: Character replacement character < < > > & & " &quto; ' ' 8. Tag name conventions: a.Can contain letters, numbers, and other characters. b. It cannot start with a number or an underscore. c. It cannot start with characters such as xml or Xml. d. Cannot contain spaces 2. XML declaration XML declaration standard statement: <?xml version="1.0" encoding="GB2312" standalone="yes"?> emphasize: 1. There should be no space between "<?" and "xml" in "<?xml". 2. There can be a space before "?>" or not. 3. encoding and standalone are optional attributes. The default value of encoding is "UTF-8" and the default value of standalone is "no". 4. Common encoding methods are: Simplified Chinese: GB2312 Traditional Chinese: BIG5 Western European characters: UTF-8,UTF-16 5.standalone indicates whether the document is accompanied by a DTD file. 3. XML attributes Because data can be stored in both sub-elements and attributes, there is no fixed rule as to when to use attributes and when to use sub-elements, but it is recommended that metadata should be stored as attributes, while the data itself should be stored as elements. Using attributes raises the following questions: 1. Attributes cannot contain multiple values (sub-elements can). 2. Attributes are not easy to expand. 3. Attributes cannot describe structure (sub-elements can). 4. Attributes are difficult to test via DTD. 4. Namespace There are two ways to declare a namespace: 1. By default, all elements do not need to specify a prefix, such as: <schema xmlns="http://www.w3.org/2001/XMLschema"> <element name="diguonianzhu" type="string"/> … </schema> 2. Clearly declare that the xmlns keyword is associated with a namespace URI prefix, and all elements need to specify a prefix, such as: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLschema"> <xsd:element name="diguonianzhu" type="string"/> … <xsd:/schema> Emphasize: The URI used to represent the namespace is not called by the XML parser, and the URI is not actually accessed. It just represents an identification name. 5. XML-specific tags: CDATA The full name of CDATA is Character DATA, which is character data. It is mainly used to display special characters, such as "<". The syntax of CDATA is: <![CDATA[characters to be displayed]]> For example: <?xml version="1.0"?> <data> <![CDATA[ <ok alma!> by a&b! ]]> </data> Emphasis: CDATA cannot be nested; the characters to be displayed cannot contain "]]>". |
<<: Web Design Tutorial (4): About Materials and Expressions
>>: CSS solution for centering elements with variable width and height
MySQL 8.0 for Windows v8.0.11 official free versi...
I have never been able to figure out whether the ...
Official Website https://cli.vuejs.org/en/guide/ ...
MySQL is a relational database management system ...
Table of contents 1. Location / Matching 2. Locat...
Map tags must appear in pairs, i.e. <map> .....
Install MySQL for the first time on your machine....
This article shares the specific code of MySQL 8....
I searched on Baidu. . Some people say to use the...
Abstract: MySQL provides a variety of storage eng...
KDE Abbreviation for Kool Desktop Environment. A ...
Table of contents 1. Test experiment 2. Performan...
Table of contents View network configuration View...
Table of contents Examples from real life Slow qu...
I won't go into details about how important b...