[jdom-interest] Getting mixed content as string?

Alex Chaffee guru at edamame.stinky.com
Tue Jul 4 03:34:12 PDT 2000


Remind me again, what method should I call to get the string

"<a href='http://www.jguru.com/'>jGuru</a>, the rockingest Java
portal, is ready for action."

from the source element

<item>
<title>jGuru Launches</title>
<url>http://www.jguru.com</url>
<date>December, 1999</date>
<description>
<a href='http://www.jguru.com/'>jGuru</a>,
the rockingest Java portal, is ready for action.
</description>
</item>

?

I tried item.getChild("description").getSerializedForm() and it didn't
work (some unimplemented exception i think); tried getContent() and it
skipped the <a> element.  getMixedContent(), of course, returns a
List, not a String, and I'd have to write a recursive loop to convert
it.

If it doesn't work, then I'd like to propose something like
getTextContent() or getStringContent() or getMixedStringContent() that
would work as desired.


-- 
Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



More information about the jdom-interest mailing list