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 atom and 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 "atom and xml" Watch "atom and xml" New topic

atom and xml

bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
is atom the same as xml? can i use xpath on it and traverse the node the same way as xml?

may i know what is the xpath of the below atom? am i right to say it is:

/feed/id/link/link/title/link/link/updated/openSearch:itemsPerPage/link/entry if i want to get to <entry>?

Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Yes, Atom is written in XML. As for your XPath expression, I haven't followed the whole thing but you're going to run into the problem where XPath 1.0 can't find elements with names in the default namespace. You would have to define a namespace context for the URI of the default namespace and assign it a prefix, then use that prefix in your XPath expression.
bryan lim
Ranch Hand

Joined: Dec 26, 2008
Posts: 140
thank you . i figured out that i should be using "//default:entry"
I agree. Here's the link:
subject: atom and xml
It's not a secret anymore!