File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

parse xml

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi,

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="http://cws.huginonline.com/E/1061/PR/200502/979846.xml"/>
</press_release>

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: http://aspose.com/file-tools
 
subject: parse xml