This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "atom and xml" Watch "atom and xml" New topic
Author

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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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"
 
Consider Paul's rocket mass heater.
 
subject: atom and xml
 
Similar Threads
stratup Exception
How to parse xml inpustream?
using treewalker to traverse
Another XML Conversion Problem
include js codes into a js variable