This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler 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 Make it so: Java DB Connections & Transactions this week in the JDBC 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.
I agree. Here's the link:
subject: parse xml
It's not a secret anymore!