File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!