KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an XML file as follows: <rootNode> <link>http://rootlink/</link> <image> <link>http://imagelink/</link> <title>This is the title</title> </image> </rootNode> The XML Java code using DOM is as follows: NodeList rootNodeList = element.getElementsByTagName("link"); This will give me all of the "link" elements including the top level and the one inside the "image" node. Is there a way to just get the "link" tags for rootNode within one level and not two such as is the case for the image link? That is, I just want the http://rootlink/ "link".
Tags (comma-separated)
Save Edits
Cancel