XML <![CDATA[]]>

  • Is <![CDATA[]]>this marker will be expressed containing plain text,   <![CDATA[<]]>representing the text“<” ,在xml中,”<””>””&”等字符是不能直接存入的,否则xml语法检查时会报错,如果想在xml中使用这些符号,必须将其转义为实体,如”&lt;””&gt;””&amp;”,这样才能保存. 程序读取的时候,解析器会自动将这些实体转换回”<””>””&”
    < Age > Age < 30 </ Age >   // The wording being given
     < Age > Age & lt; 30 </ Age > // should be written

     

  • In XML, you need to escape characters are:
    &   &amp; 
    <   &lt; 
    >   &gt; 
    "   &quot; 
    '   &apos; 

     

  • It is <! [CDATA []]> content does not contain XML parser, but be careful: 
    1. This section can not contain "]]>" 
    2. allowed to nest 
    3. "]]>" part can not contain spaces or newline 
    benefits: 
    <[CDATA []]>! Represents xml parser parses ignored, so faster

     

Guess you like

Origin www.cnblogs.com/bneglect/p/11390379.html