var links = document.evaluate("//BODY/CENTER[1]/P[1]/TABLE[1]/TBODY[1]/TR[1]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).evaluate("//A");
Basically, I need to find the element through xpath. then search for this item through xpath. The above does not work explicitly, but does not use the contextNode argument.
var headings = document.evaluate("//BODY/CENTER[1]/P[1]/TABLE[1]/TBODY[1]/TR[1]", document, null, XPathResult.ANY_TYPE, null); var thisHeading = headings.iterateNext(); var headings2 = document.evaluate("//A", thisHeading, null, XPathResult.ANY_TYPE, null); headings2.iterateNext().style.backgroundColor = "red";
I need to be able to search for child elements of an element through xpath.
source share