If I change anyone of these element as CDATA, IE5 gives error : "Content model is invalid. " What is the practical use of CDATA ? Has anyone ever used CDATA for element ?? Can we use it for element at all ?? Any help will be a appreciated. Thanks in advance.
"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
In DTD, there is no CDATA, only PCDATA. It's in the XML document instance where you can markup certain parts of text content with either PCDATA or CDATA blocks. (PS. I didn't have time to check that so please correct me if I'm wrong)
I think you are right. Elements can be only PCDATA. [ or in other words CDATA cant be used in dtd file.] CDATA, I think, is suppose to be used in the xml file only for the data which you want not to be parsed. [exa: http://www.w3schools.com/xml/xml_cdata.asp] I tried this and its working fine.
May I conclude it as following points: 1) Only "PCDATA" is used in dtd for element. 2) CDATA is used in xml file for the data which is not suppose to be parsed. Thanks Lasse
Hi, CDATA is used very rarely in XML documents. Its generally used when you have a lot of textual content like ">","<", "'", "&", """. The use of CDATA is very rare as it rarely supports teh purpose for which xml was created!!!. (user defined tags). Data inside teh CDATA section is not parsed by teh parser. So CDATA is generally used when you need to include non-xml data or a lot of pre-defined entities mentioned above. Elemnts cannot have CDATA as their model. BUT Elemnts can have CDATA sections to store data as shown in the above example by lasse!!!
I guess thats y we also include our code segments in the segment in javaranch so that the entire character set we type (along with white space) is preserved :-). It is not parsed by teh processor used to represent our documents. I guess CDATA is something similar to that !!! hope this helps hari