jQuery in Action, 2nd edition*
The moose likes XML and Related Technologies and the fly likes Is CDATA section allowed as a value for the element with type defined as PCDATA ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Is CDATA section allowed as a value for the element with type defined as PCDATA ?" Watch "Is CDATA section allowed as a value for the element with type defined as PCDATA ?" New topic
Author

Is CDATA section allowed as a value for the element with type defined as PCDATA ?

Janelle Goldsmith
Greenhorn

Joined: Mar 20, 2003
Posts: 12
I defined an element as type #PCDATA
and in the XML document, I defined a CDATA section for that element's value.
I did not get any parsing error.
Does it mean that CDATA section is allowed even if the element is defined to be of type PCDATA ?
Gayathri Prasad
Ranch Hand

Joined: Jun 25, 2003
Posts: 116
Hi,
Hi,
CDATA means the element contains character data that is not supposed to be parsed by a parser.PCDATA means that the element contains data that IS going to be parsed by a parser.So if the CDATA is being used for PCDATA that is unnecessatry overhead to the parser. By declaring some thing as CDATA we save time by making sure that Parser never parses it.else there is no hard-n-fast rule for the CDATA to fit in #PCDATA section.
Cheers,
Gaya3
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is CDATA section allowed as a value for the element with type defined as PCDATA ?
 
Similar Threads
CDATA and #PCDATA
difference between #PCDATA and CDATA?
#CDATA and #PCDATA
clarification for mock test Shashanks
Why b.c.d is correct?