Re: [xml] Removing a namespace declaration

On Wed, Aug 06, 2003 at 04:53:13PM -0400, Chris Ryland wrote:
On Wednesday, August 6, 2003, at 03:32  PM, Vaclav Barta wrote:

I couldn't find any such function, so I wrote the (reasonably obvious) 
updating the linked list starting at xmlNodePtr->nsDef to remove the 
xmlNsPtr. But I don't know when to free it - calling xmlFreeNs on it 
makes my
program crash. How are the namespaces organized - for example, why are 
2 lists (ns and nsDef) of namespaces in a node?

I'm just a newbie, but I'm pretty sure there are two lists to track the 
two kinds of usage: the namespace used by the current node and any 
defined by the node.

  cur->ns is a pointer to the namespace declaration used by the node if any
  cur->nsDef are the namespaces declaration on that node.

there is no function to access nsDef, you need to walk the list.


Daniel Veillard      | Red Hat Network
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]