user1728578
user1728578

Reputation: 89

enclosing all special characters in xml in cdata

i am trying to parse the xml file but getting exceptions since the file contains the special character. To make file to parse successfully i have to enclose the value in since there are many special characters in my xml files at different places is there any way like declaration or something so that these fields will get replaced with CDATA whicch will reduce the mannual work exerytime?

Upvotes: 1

Views: 3322

Answers (1)

Christian Stieber
Christian Stieber

Reputation: 12496

Well, either your parser is broken, or your XML.

XML has 5 predefined entities, which your parser should support, and whatever generates your XML should use them when appropiate:

&lt;     <
&gt;     >
&amp;    &
&apos;   '
&quot;   "

Upvotes: 1

Related Questions