CDATA Segments #PCDATA CDATA Types in XML
because CDATA paragraphs and #pcdata,cdata are similar in character, for the sake of understanding, a little summary. A
CDATA segment in 1.XML that resembles the Heredoc in PHP.
all text in an XML document is parsed by the parser, and the entity reference is ignored by the parser in all tags in the tag cdata. And the XML handler treats
its syntax as <![as character data . CDATA [ ]]> sample of content that needs to be ignored by the parser
<?xml version= "1.0" encoding= "Utf-8"?>
<people>
<![ cdata[<!--。 And [Don't have blank-->
<teacher>
<name>Androidyue</name>
<sex>Boy</sex>
<age>22</age>
<add>&address;</add>
</techer>
]]>
</people>
When using CDATA segments, be aware of a few CDATA letters that are larger and cannot be nested, and that the text content of a CDATA segment cannot appear with the "]]>" string, "<! [cdata[""! " and "[" can not have white space, the end "]]>" can not have blank or newline
2. #PCDATA在元素类型声明中, declaring the type of the element as #pcdata means that the content of the element is resolvable character data and cannot contain subclasses under that element, such as <! ELEMENT name (#PCDATA) > Note that there must be a space between the name and the "(") <br/>
3. #CDATA类型CDATA是最普通的属性类型, indicating that the property can be any text string, but does not include less than "<" and double quotes ">", and if you want to use both symbols you can use the entity reference "<" and """, whose syntax is as follows <! Attlist element Name Property name CDATA attribute type > such as <! ATTLIST student name CDATA #REQUIRED > Summary: A CDATA Segment can be understood as a character area whose inner content XML parser is a string, #PCDATA is the type used to declare an element, and CDATA is a type that represents an attribute <br />