• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CDATA and jdom

 
francis varkey
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
How to read CDATA from xml using jdom parser.

Thanks
 
Paul Clapham
Sheriff
Pie
Posts: 20978
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's just a text node, isn't it? What have you tried so far?
 
g tsuji
Ranch Hand
Posts: 656
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>How to read CDATA from xml using jdom parser.
One of the typical occurrence of getting to a content List through .getContent().iterator(), and then use .next() to arrive at an object (o) of type typically uncertain. You then have to test the type of the object (o) through a cascade of if... else if...

The CDATA object uses getValue() above, or for that matter it can use getText(), getTextTrim() etc... all inherited from Text class as CDATA subclass Text. The casting step of o to CDATA is important.

[note: edited a typo.]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic