XML declaration
XML Version = "1.0" encoding = "GB2312" Standalone = "YES"?>
Standalone: Does the document are in this file or need to import files from the outside.
Processing instructions PI (Processing Instruction)
?>
Processing instructions are used for XML parsers to pass information to the application. The XML parser is a module that reads and saves XML document content; the application is a resolver obtains document content and handles independent software modules for these content; IE provides an XML parser and application.
Style Table Handling Directive, this processing instruction must appear before the preamble portion, the root element.
xml-stylesheet type = "text / css" href = "uri"?>
DOCTYPE
After the XML declaration, it includes all entity statements.
]>
Note
Do not appear in the comment -; Note cannot be placed in the middle of the mark; the comment cannot be nested; you can add anywhere anywhere other than the marker.
Root element
Each XML document must have only one root element; the root element is an element that completely includes all other elements in the document; the start mark of the root element before the start tag of all other elements; the end of the root element is marked in other After the end of the element.
Text content PCDATA
Although any elements can occur in the document, the elements that appear must be declared.
This statement describes that Year can only contain the descriptive character data, ie non-tag text, but it does not contain its own child elements.
CDATA
In most cases, it is marked in a pair of <>, which is not in this. But there is an exception. All texts in the CDATA segment are pure character data. It looks similar to the mark or entity is just their respective stories, and the XML processor does not parse them anyway.
The CDATA segment is used to interpret the entire text as a pure character data and is not a mark. This is very useful when there is a huge text that contains many <> & et al. Is a huge text that is not marked.
It ends with "]]>" in "]]>", it is important to note that the only unique resultfree "]]>" "]>" is unique to the CDATA segment.
Entity (enttive)
The entity is a storage unit in XML, and an entity can include a string, file, database record, and some other data. The application entity is mainly to avoid repeating input in the document, we can arrange an entity name for a document, and then use this name in the XML file instead to introduce documents, and when the XML file is parsed, the entity name is replaced with a document.
There are five entities instead of special symbols: & lt = <; & gt =>; & amp = &; & quout = "; & apos = '.
XML document node type
Document (Document)
Element
Attribute
Text (PCDATA - PARSED Character Data)
Comment
Processing instruction (PI - Processing Instruction)
DOCTYPE
Entity (enttive)
CDATA (Character Data)