[XML-SIG] XPath's reliance on id()

Martin v. Loewis martin@v.loewis.de
15 Mar 2002 00:05:34 +0100


Martijn Faassen <faassen@vet.uu.nl> writes:

> And I'll have to think about reasonable implementation of
> compareTreePosition(). Any ideas? How do we move ahead with support
> for this in XPath and PyXML's DOM implementations? 

You could use the Util approach of indexing the document. Just attach
the indexing dictionary to the document (since you can always navigate
from any node to the document).

The tricky part will be to outdate the dictionary once the tree
structure changes.

In minidom, I think I might attach a rational number to each node,
with the scheme that Uche suggested (but representing the rational
number as a tuple of integers).

In general, I think Util should first check for compareTreePosition;
if that is not supported, use docIndex; if that also fails,
__IndexDocument.

HTH,
Martin