I. XML syntax
1.xml document declaration, declaring basic properties, having and only one document life, must be on the front end: <?xml version= "1.0" encoding= "Utf-8" standalone= "yes"?>;
2.xml element, an XML tag is an XML element, a label is divided into the start tag and the end tag, between the start tag and the end tag can contain text, the file content becomes the label body,
If an XML tag does not include the tag body and does not contain other elements, then the start tag can be merged with the end tag, called the:<a></a> ===> <a/>
Tags can contain any number of sub-labels, note that labels must be reasonably nested. A good XML document has only one root tag:
Label case-sensitive,<p> and <p> are different two tags; cannot start with a number or punctuation mark or "_";
Cannot contain a space, not a colon (:);
3. Properties, a label can have multiple properties, each of which has its own name and value: <person name= "Chen"/> the value of the attribute needs to be enclosed in single or double quotation marks;
4. Note,<!--Note Memory---note content can appear anywhere in the document, except that it cannot appear at the top of the declaration document, and annotations cannot be nested;
5.CDATA zone/Escape character <! [cdata[escaped content]]> When a piece of XML does not want to be parsed by the parser, it can be wrapped using CDATA, for example: <! [Cdata[Zhang <name>]]>;
Escape characters: &-&
< <
> >
"-"
'-'
6. Processing instructions, referred to as pi (processing instruction), are used to direct the parsing engine to parse XML document content.
16-1-8 Java Learning Note (1) XML syntax