This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes parse xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "parse xml" Watch "parse xml" New topic

parse xml

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303

I have an xml file like:

However, when i do huginChildren.item(0), i get the o/p as

<press_release id="979846" language="en">
<published date="2005-02-10T07:29:02 CET"/>
<headline><![CDATA[Ericsson reports full year profit of SEK 28 billion]]></headline>
<location href=""/>

How do i extract location href from this?? plz help.

SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
I can do this very easily using XPath, but I cannot seem to parse CDATA with JDOM, having used your XML.
subject: parse xml
Similar Threads
Connection Factory not found
Can you read this?
How to parse xml inpustream?
update href field dynamically
Xml with XSLT