Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOM Parser in JAVA - Finde the path of the node

Status
Not open for further replies.

airjorden

Programmer
Feb 7, 2002
1
DE
Hello to you all,

i am working on projekt rightnow where I use XML and
a DOM Parser. I programmed a class which is waiting
for two strings. First one ist the path and the
second is the node.
Now I have the problem that I create a nodelist like
this:

nodeList = document.getElementsByTagName(tagName);

...but now I just want to find just this nodes
where the path is exatly matching with for example:
Database.Table.Table_ID
when i use methode like getLocalName() on a node
from the list like:

string path = nodeList.item(i).getLocalName();

it just return a NULL.

Is there any methode to find the path of the node???
Or it just easier to work it out??

Can anybody help me on this problem. I driving crazy
I tried almost everything....

thx,
Michael Fischer
 
You can use getParentNode() in jaxp and for the root it will return null

Just refer jaxp docs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top