Dear List,
I wonder if there's a method in BaseX for getting a unique identifier for a node. If I had a document in memory & was using, say, Saxon, I'd call a method on the node to return its location as an XPath string, but using XQuery in BaseX, is there a "somefn" such that
for $d in $doc//date return <result path="{somefn($d}">{$d}</result>
would return <result path="/root/date[5]"><date when="2010-03-25"/></result> or some such?
I understand that nodes are identified internally in BaseX by their pre-order traversal index – is there a way get the pre number? If not directly from an XQuery function, perhaps in some of the Java client code?
My use case is that I'd like to return elements – <date>'s, e.g. – with info about their location in the document so that later & on-demand I can get more info about certain dates – ancestor elements, &c; so, in short, I'd like to get a handle on the node for later retrieval.
Thanks, Perry Trolard