Getting all the nodes
I am trying to get all the nodes from under an W3C XML document in a nodelist etc.
the xml doc may have multiple childNodes with each of those nodes having multiple childnodes themselfs and so on. How would i get all these nodes in a node list or at least multiple nodelists.
Please help
this is the derection i am going but this gets messy as i dont know how many child nodes have children of there own.
NodeList nlChildNodes = dDocument.getDocumentElement().getChildNodes();
for(int i=0; i<nlChildNodes.getLength(); i++)
{
sNodeName = nlChildNodes.item(i).getFirstChild().getNodeName();
if (nlChildNodes.item(i).hasChildNodes())
{
NodeList nlMoreChildNodes = nlChildNodes.item(i).getChildNodes();
//this gets messy as i dont know how many child nodes have children of there own.
}
}
>

