Re: [xml] Any easy way to check if a node is in doc already?

On Tue, Mar 28, 2006 at 07:22:37PM -0800, Yong Chen (yongche) wrote:

What I want is to check if an exact node is already in doc, if not, then
add it to the doc.

An "exact node" means a node having the same name, attributes, type,

  No, you must walk the tree. The semantic of what you are describing
is however extremely confuse, does it include equality of namespace
prefixes too, is the model recursive (if no then comparing element nodes
would make no sense), etc ...
  XML is not a reduced database, it has none of the features, and vice-versa.
The only kind of index you can find natively in the tree are ID associated
to elements. But all this is really common knowledge


Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]