views:

53

answers:

3
var vTableExp = "//a[contains(@href,'newdid')]/ancestor::td/ancestor::tr/ancestor::tbody";
var vTable = dom.find(vTableExp, XPFirst);

thanks

A: 

vTableExp is probably a regexp pattern and then it's being searched for.

Mikulas Dite
It looks more like an XPath than a regular expression …
Konrad Rudolph
+3  A: 

It is an XPATH searching against the DOM, looking for wrapping <TBODY> elements which have a descendant <a> whose href contains "newdid".

Rex M
It could be that the structure of the original HTML of the Travian app you are trying to do this for has changed.
Pekka
@Pekka is that directed at the OP?
Rex M
@Rex yes, as additional info (added it here because yours is the correct answer). His complete issue is here: http://www.webdeveloper.com/forum/showthread.php?p=1087501
Pekka
A: 

It finds the first tbody which is an ancestor of a a tr element which is an ancestor of a td element which is an ancestor of an a element whose href contains the string newdid. (IOW, assuming that the parsed document is (X)HTML, select the body of the first table that has a cell containing a link whose address contains the string newdid.)

Oblomov