[xml] Navigation via IDs
- From: Gary Pennington <Gary Pennington uk sun com>
- To: "xml gnome org" <xml gnome org>
- Subject: [xml] Navigation via IDs
- Date: Fri, 20 Jul 2001 11:38:11 +0100
I'm trying to establish the limitations of navigating around a dynamic
document using IDs in libxml and so I would appreciate any
confirmation/rebuttal of the following:
1. An ID is only usable if the document containing the ID is manipulated
with xmlDoValidityCheckingDefaultValue set to 1.
2. Any nodes added to the document (xmlNewNode) after parsing WILL
NOT have their IDs added to the document's list of IDs.
3. Any nodes removed from the documents(xmlUnlinkNode) after
parsing/validating WILL NOT have their IDs removed from the document's
list of IDs.
The reason I need this information is that I need a way to be able to
reliably search for ids in documents, even if the document has been
modified and nodes inserted/removed and the document HASN'T been
I have been using xmlGetID to do navigation around the document, but I'm
experiencing problems which indicate that new nodes added to the
document are not getting their IDs' registered (hence the above
The approach I'm considering using is taken from the XPointer language
spec, where I do something like this:
where id is assumed to be an attribute of type ID and I abandon use of
Thanks for any help/comments.
Solaris Kernel Development,
Gary Pennington sun com
] [Thread Prev