I have, for example, the next XPath query:
//div[span=\"something\"]/parent::div/child::div[@class=\\\"someClass\\\"]
I want to use this XP
I'm not sure about the parent::div
clause, but without it it should look like this:
$('div[span="something"] div.someClass');
if you want to select an element inside an iframe, from parent window, you should change second parameter of evaulate() function to iframe's document element, like :
var iFrameDocument = $('iframe#myPage').get(0).contentWindow.document;
xpathResult = this[0].evaluate(xpathExpression, iFrameDocument, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);