[jdom-interest] CDATA Extraction Question

Jason Hunter jhunter at collab.net
Tue Feb 6 19:05:31 PST 2001


> I have a question concerning CDATA.  If I have a tag like the following:
> 
> <foo>
> <![CDATA[<BR>Hello]]>
> </foo>
> 
> how would I extract the CDATA material?  

getRootElement().getText() returns "<BR>Hello"
getRootElement().getMixedContent().get(1) returns the actual CDATA
instance

Note get(0) returns the \n whitespace.

-jh-



More information about the jdom-interest mailing list