[xml] obtaining an XPath expression given a node ptr



given an xmlNodePtr in a document, is it possible to retrieve a xpath
expression that uniquely identifies that node?

i.e. a given document

<?xml version="1.0"?>
<root>
  <a/>
  <a><b/><b><c/></b></a>
</root>

And you had the xmlNodePtr to node 'C', you would receive back an xpath
expression of "/root/a[2]/b[2]/c"

?

Thanks.
   



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]