• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic