XML English full name Extensiblemarkup Language, translated to Extensible Markup Language. XML technology is published by the organization, and it is recommended to follow the XML1.0 specification published by the organization in 2000.
In the XML language, it allows the user to customize the label. A label is used to describe a piece of data, a label can be divided into start and end tags, between the opening and closing tags, and other tags can be used to describe other data to achieve the description of the data relationship.
V an XML file is divided into the following sections:
n Document Declaration
N Element
N Property
N Comments
N CDATA Zones, special characters
n processing instructions (processinginstruction)
XML Syntax Document declaration
V when writing an XML document, you need to use the document declaration to declare the type of the XML document.
the simplest declarative syntax for V:
<?xmlversion= "1.0"?>
V uses the Encoding property to describe the character encoding of the document:
<?xmlversion= "1.0" encoding= "GB2312"?>
V uses the standalone property to indicate whether the document is independent:
<?xmlversion= "1.0" encoding= "GB2312" standalone= "yes"?>
Element Naming conventions
the V XML element refers to the label that appears in the XML file, a label that is divided into the start and end tags, and a label that has the following forms of writing, such as:
N contains the label body:<a>www.itcast.cn</a>
N:<a/> with no label body
V You can also nest several sub-labels in a label. However, all tags must be properly nested and never allow cross nesting, for example:
<a>welcome to <b>www.it315.org</a></b>
A well-formed XML document must have only one root tag, and the other tag is the descendant tag of the root tag.
V an XML element can contain letters, numbers, and other visible characters, but must adhere to some of the following specifications:
L case-sensitive, such as,<p> and <p> are two different tags.
L cannot start with a number or "_" (underscore).
L cannot start with XML (or XML, or XML, etc.).
L cannot include spaces.
The middle of the name cannot contain a colon (:).
Processing Instructions
V processing instruction, referred to as PI (processinginstruction). The processing instruction is used to direct the parsing engine to parse the XML document content.
V For example, you can use the Xml-stylesheet directive in an XML document to notify the XML parsing engine and apply a CSS file to display the contents of an XML document. <?xml-stylesheettype= "Text/css" href= "1.css"?>
V processing instructions must be "<?" At the beginning, with "?>" as the end, the XML declaration statement is the most common kind of processing instruction.