From 112cb5bb5475afec1c1cbf1d6728ce4880d0fee8 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 12 Jul 2005 19:58:48 +0000 Subject: Load /tmp/tmp.zfIyNk/libxml2-2.6.20 into packages/libxml2/branches/upstream/current. --- python/libxml.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'python/libxml.py') diff --git a/python/libxml.py b/python/libxml.py index 2eca71e..86bdd92 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -429,6 +429,27 @@ class xmlCore: def xpathEval2(self, expr): return self.xpathEval(expr) + # Remove namespaces + def removeNsDef(self, href): + """ + Remove a namespace definition from a node. If href is None, + remove all of the ns definitions on that node. The removed + namespaces are returned as a linked list. + + Note: If any child nodes referred to the removed namespaces, + they will be left with dangling links. You should call + renciliateNs() to fix those pointers. + + Note: This method does not free memory taken by the ns + definitions. You will need to free it manually with the + freeNsList() method on the returns xmlNs object. + """ + + ret = libxml2mod.xmlNodeRemoveNsDef(self._o, href) + if ret is None:return None + __tmp = xmlNs(_obj=ret) + return __tmp + # support for python2 iterators def walk_depth_first(self): return xmlCoreDepthFirstItertor(self) -- cgit v1.2.3