XML Basics

1.XML document affirms

<?xml version="1.0" encoding="utf-8" standalone="no" ?>

To <? Beginning xml, to?> End

Three attributes: version = "1.0" version of the Required property is always 1.0

reads the encoding format encoding = "urf-8" text, optional attributes

standalone = "no" independent of whether the text, the default is yes, optional attributes

 

2.XML element

Element Structure

Common elements from the body element start tag + + end tag: <a> a.jpg </a>

Empty elements: <br/>

label

Name tags: letters, numbers, minus composition, can not start with a number

Attributes

An element with attributes 0 ~ n th

Structural properties as follows: attribute name = "attribute value"

Element body

Body elements can be text, it can also be a sub-elements

Note: Do not process elements nested disorders such as:

<b><a></b></a>

 

3. The need to escape special characters

&   &amp; 
<   &lt; 
>   &gt; 
"    &quot; 
'    &apos; 

 

4.CDATA grammar

Is <![CDATA[]]>this marker will be expressed containing plain text, such as <![CDATA[<]]>showing the text“<”

 

The processing instruction

How to tell the parser parse xml file

<?xml-stylesheettype="text/css" href="css"?>

 

Guess you like

Origin www.cnblogs.com/thorne5691/p/11184644.html