hi all I'm trying to parse a DOM tree using Neko/Xerces in Java.
NodeList divs = this.doc.getElementsByTagName("DIV");
for(int i=0; i < divs.getLength(); i++) {
NodeList images = divs.item(i).parentNode().getElementsByTagName("IMG");
// operate on these
}
is what I'd ideally like to do. It seems I can only call getElementsByTagName on the document itself? Am I doing something wrong? Should I be able to call that on a Node element?
I can see from the docs it's not there: http://xerces.apache.org/xerces-j/apiDocs/org/w3c/dom/Node.html so maybe I need to do it another way?
thanks!