Howto find the first common XPath ancestor in Javascript?
I have two XPaths, for example:
/html/body/div[3]/div[4]/table/tbody/tr[2]/td[4] and /html/body/div[3]/开发者_如何学运维div[4]/table/tbody/tr[2]/td[3]/a[2]
How can I find the first common ancestor now?
In this case it would be /html/body/div[3]/div[4]/table/tbody/tr[2]/
.
I found this question but the solution is in ruby and doesn't really give me a clue how to do it in Javascript. Can anybody help me? Thank you.
This seems to be for JS and not XSLT, although the common factor being XPATHs of the elements.
精彩评论