Code review comment for lp:~zorba-coders/zorba/structuralrelationships2

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

> Second, when you say that you rely on it, does it mean that you may need to
> compare 2 node positions that were obtained in different snapshots? And if so,
> do you expect that the result of such a comparison says anything about the
> positional relationship of the two corresponding nodes at any point in time?
> (in other words, is what I wrote for the is-ancestor function really correct?)

What you write for the ancestor function (which i copied also in the other functions)
is correct although, given the current implementation, extra information would be present.

For the sake of curiosity i tried to write the most precise definition possible,
but I don't think that putting this into the methods comment would be an improvement:

The result of the function applies to the corresponding nodes as well,
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.

Follow/preceed in document order would be:
If the two positions correspond to sibling text nodes and both
positions were obtained in the same snapshot, then the function also applies
in each snapshot S in which they belong to the same tree in which they
belonged when the node position was computed.

If the two positions correspond to sibling text nodes and the two
positions were obtained in different snapshots, then it is impossible to determine
if the node corresponding to the first position is a predecessor of the node
corresponding to the second position.

In all other cases, the result of the function applies to the corresponding
nodes as well, in each snapshot S in which they belong to the same tree and
collection in which they belonged when the node position was computed.

Cheers,
Federico

« Back to merge proposal