[Zope] ID's in one XML Document nt unique?

Martijn Faassen m.faassen@vet.uu.nl
Tue, 07 Sep 1999 17:01:57 +0200


Martijn Pieters wrote:
[snip]
> >
> >Hm, I'm confused. Doesn't the _make_id() function in Node.py make sure
> >each node in an XML Document has an unique ID? How do duplicate ids
> >arise this way? Also, why allow duplicate ids at all?

> Not the individual parts strings deimited by slashes are unique, but the
> URL as a whole is.

I understood that part, but..
 
> _make_id() makes sure there are no two elements with the same URL, it does
> so by making sure there are no two elements with the same id on one level
> of the URL.

I must be seriously misreading the code then! As I understand it, it
goes up the XML tree from the current node until the parent node isn't
an XML Node anymore. It would find the top node of the trees this way.
Then it checks the next_id attribute there and uses this for the new id.
It also increases the _next_id attribute by 1. Wouldn't this guarantee
an unique id each time it's called? Perhaps there's something in the way
it's called that makes me misread it.. Or I misread the loop that I
think goes up the tree?

Regards,

Martijn