XML and DOM

I have something like this:

<settings>

<namespace name="foo">

<type name="test">

<point name="position" x="0" y="0" />

</type>

<namespace>

</settings>

And I use DOM like this to parse it:

NodeList elements = getElementList(rootElement,"type");

for (int i = 0; i < namespaces.getLength(); i++)

{

Element element = (Element) elements.item(i);

}

My question is is there a way for me to know which elements surrond the one I'm curently looking at? That is when I'm now parsing tag "type" can I get the information that its at: settings.namespace?

/WildChild

Message was edited by:

-WildChild-

[1014 byte] By [-WildChild-a] at [2007-11-26 16:34:19]
# 1
Yes, there is. You should be able to find that way quite easily if you read the API documentation for the Node interface.Hint: the technical terms for what you call the elements that "surround" an element are "parent" and "ancestor".
DrClapa at 2007-7-8 22:59:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
http://forum.java.sun.com/thread.jspa?threadID=713780&messageID=4127482
prgguya at 2007-7-8 22:59:02 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...