Re: [xml] Fwd: Patch: Null prefix namespaces not cloned

On Tue, Feb 21, 2006 at 12:53:32PM +1300, Andrew Miller wrote:
Quoting Daniel Veillard <veillard redhat com>:
I don't understand the patch especially the node->doc != doc test, please
elaborate, thanks !

The first check tests for cases where it doesn't make sense to search for the
namespace, and sets the ns to NULL in those cases. If the prefix is NULL, it is
clearly not sensible to search for a match by prefix(remember namespace is
defined if we get to that code). The document equality check is there because
prefixes from one document don't make sense in another document.

   Hum, that copy operation try to preserve the prefix as far as I remember,
you are not changing that, aren't you ?

I added the root->parent->type == XML_ELEMENT_NODE check into the while loop
because xmlNewNs seems to want an element, and otherwise we traverse past the
document element and get the document.

   Okay that makes sense.


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]