• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Find a particular Node in DOM

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any function to which i can find a particular element
in XML Tree.
When i use getElementsByTagName under class Document.
The return value is NodeList which when i typecast to Node generates an error at run time.
Is there any other way
Reagrds,
Pradeep
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi make sure u r doing this.
Nodelist nodes = root.getElementsByTagName("name");
for(int i=0;i<nodes.getLength();i++)
{
Element elt = (Element)nodes.item(i);
}
if this doesnt work then you can iterate the entire tree....make use of root.getNodeName.equals("name");u can use recursive call also.
HTH,
Roopa
 
It's just like a fortune cookie, but instead of a cookie, it's pie. And we'll call it ... tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic