1

how to parse this type of data using DOM? here some text is in CDATA and some text in normal.

<error><![CDATA[This Mobile number already registered]]> with a different ICNO ( Hotline Number: +993498347334 )</error>

Can anyone help me on this. Thanks.

Noundla Sandeep
  • 3,334
  • 5
  • 29
  • 56

1 Answers1

0

If you are parsing as a DOM Parser try this factory.setCoalescing(true); This way the CDATA is removed.

If you need first what is inside CDATA i suggest to get the string from xml then make a substring starting with Hope it helps.

Luis Pereira
  • 1,481
  • 3
  • 19
  • 46
  • i am not getting your second line.. and i am getting the data which is in CDATA normally(not for the above said tag , for another one), but when it comes to the above said one I am not getting data.. only i am getting "with a different ICNO ( Hotline Number: +993498347334 )" – Noundla Sandeep Apr 19 '12 at 10:45
  • Sorry for delay... I think your answer is in this link http://stackoverflow.com/questions/568315/how-do-i-retrieve-element-text-inside-cdata-markup-via-xpath – Luis Pereira Apr 19 '12 at 11:31