The basic syntax of XML

XML which can be user-defined

Version 1.0 or

Document declaration must be <xml? Beginning , to ?> End ;   Notes can not

    Automatic generation: 1. versioin: Specifies the XML document versions. Must attribute 

            2. encoding: specify the encoding of the current document. Optional attribute, the default value yes. utf-8:

Named elements: case sensitive

    Can not use spaces, you can not use   :( colon)

    It is best not to use any form of xml named

<? XML Version = "1.0" encoding = "UTF-. 8"?>
<persons>
    <Person Color = "Black" height = "192">
        <name> Yuan Yiming </ name>
        <Age> 40 </ Age>
    < / Person>
    <Person>
        <name> Xiong </ name>
        <Age> 18 is & lt; </ Age> special characters are used predefined entities

////////////////////////////////////////////////// /// in CDATA appears segment " < ", " > " ,, "," "," ' "," & ", all without the use of escape characters. This can increase the xml readability of the document.

<! [CDATA []]> special character translation

<![CDATA[if(10>9&&9>8){
        aaa;                                                  
        }]]>

 

///////////////////////////////////////////////////////////////////////////////////
    </person>
</persons>

 

Guess you like

Origin www.cnblogs.com/haoxun/p/11089068.html