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

Martijn Pieters mj@antraciet.nl
Tue, 07 Sep 1999 15:57:02 +0200


At 15:32 07/09/99 , Martijn Faassen wrote:
>Amos Latteier wrote:
> >
> > At 04:51 PM 9/5/99 -0500, Stephan Richter wrote:
> > >since you are the creator of XML documents, I wanted to ask you 
> whether the
> > >node IDs in the XML document tree are not necessarily unique. I have a XML
> > >document  and I try to create an index. I planned of using the node 
> IDs from
> > >the tree as my identifiers. But I noticed that I have an ID twice. 
> Yes, it is
> > >at a different level of the tree.
> > >
> > >Is this a bug? Is there another way to accomplish my task?
> >
> > This is not a bug. It is possible to have a URL like this
> >
> >   e5/e5/e17
>
>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?
>
>Regards,
>
>Martijn

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

_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.

e5/e5/e17 addresses one element only, e5/e5/e18 another. So does e6/e5/e17.

--
Martijn Pieters, Web Developer
| Antraciet http://www.antraciet.nl
| Tel: +31-35-7502100 Fax: +31-35-7502111
| mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
| PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
------------------------------------------