5 Jul
2005
5 Jul
'05
12:28 p.m.
afaik there is no one-api-function-call way to do it. but I need that strongly and I would try to implement it anyway.
may be you can give some tips on it?
Something like this (pseudo code, attrs not handled):
xpath = "" pos = 1 while node != NULL and node != document: if node.prev == NULL: if xpath != "": xpath = "/" + xpath xpath = "node()[pos]" + xpath node = node.parent pos = 1 else: pos = pos + 1 node = node.prev if xpath != "": xpath = "/" + xpath
Thanks, I understand it on this level. The question was about tricks that could be done using existing codebase. May be (but unlikely) there is property for position of element or something similar.