PHP Operational XML Primer CDATA Section _php Tips

Source: Internet
Author: User
Tags cdata xml parser

This example describes the CDATA section of the Introduction to PHP operations XML. Share to everyone for your reference. The specific analysis is as follows:

Copy Code code as follows:
<?xml version= "1.0" encoding= "Utf-8" standalone= "yes"?>
<class>
<student id= "no<001" haha= "Beauty" >
<name> Little Joe </name>
<sex> Women </sex>
<age>23</age>
<info>
<! [cdata[
Content section &*&$#^@* (#)) $#*%#
]]></info>
</student>
<student>
<name> Zhou Yu </name>
<sex> male </sex>
<age>26</age>
</student>
</class>

Knowledge Points:

(1) The text in the XML document is parsed by the XML parser, but the content in the CDATA section is not parsed. Therefore, CDATA can contain special characters, such as &, <, and so on.
(2) CDATA section with <! [cdata[begins, ends with]]>.

The corresponding CDATA is the Pcdata:pcdata that represents the text to be parsed, and the constraint is defined in the DTD.

I hope this article will help you with your PHP operating XML program.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.