em4
06-05-2009, 08:38 AM
Hello,
What is the different between this two codes ?
First:
<!DOCTYPE books [
<!ELEMENT books (book_name)>
<!ELEMENT book_name (CDATA)>
]>
and than the in the XML file:
<books>
<book_name>&&&&</book_name>
</books>
This code cause an error.
Second:
<!DOCTYPE books [
<!ELEMENT books (book_name)>
<!ELEMENT book_name (#PCDATA)>
]>
and than the in the XML file:
<books>
<book_name><![CDATA[&&&&]]></book_name>
</books>
This code is perfectly fine
My question is way ?
In both cases it declare that the content of the element "book_name"
will not parsed, so why the first code cause an error ?
What is the different between this two codes ?
First:
<!DOCTYPE books [
<!ELEMENT books (book_name)>
<!ELEMENT book_name (CDATA)>
]>
and than the in the XML file:
<books>
<book_name>&&&&</book_name>
</books>
This code cause an error.
Second:
<!DOCTYPE books [
<!ELEMENT books (book_name)>
<!ELEMENT book_name (#PCDATA)>
]>
and than the in the XML file:
<books>
<book_name><![CDATA[&&&&]]></book_name>
</books>
This code is perfectly fine
My question is way ?
In both cases it declare that the content of the element "book_name"
will not parsed, so why the first code cause an error ?