diff options
author | Aron Xu <aron@debian.org> | 2014-10-26 07:02:36 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2014-10-26 07:02:36 +0800 |
commit | d5776bbf9d8842d931ab1112466d19685035281e (patch) | |
tree | 01338d35684154e4f1c17acb1d92d3fa85c26508 /python/libxml2.py | |
parent | 3a8c2d58eab0410fe5e79a112614aa9be061dc46 (diff) | |
parent | 3871a83a5f0aebd8c00879eab14fe901c93dbfcf (diff) | |
download | libxml2-d5776bbf9d8842d931ab1112466d19685035281e.tar.gz |
Merge tag 'upstream/2.9.2+dfsg1'
Upstream version 2.9.2+dfsg1
Diffstat (limited to 'python/libxml2.py')
-rw-r--r-- | python/libxml2.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/python/libxml2.py b/python/libxml2.py index 9712d16..76b8dcd 100644 --- a/python/libxml2.py +++ b/python/libxml2.py @@ -530,7 +530,7 @@ class xmlCoreDepthFirstItertor: self.parents = [] def __iter__(self): return self - def next(self): + def __next__(self): while 1: if self.node: ret = self.node @@ -542,6 +542,7 @@ class xmlCoreDepthFirstItertor: except IndexError: raise StopIteration self.node = parent.next + next = __next__ # # implements the breadth-first iterator for libxml2 DOM tree @@ -552,7 +553,7 @@ class xmlCoreBreadthFirstItertor: self.parents = [] def __iter__(self): return self - def next(self): + def __next__(self): while 1: if self.node: ret = self.node @@ -564,6 +565,7 @@ class xmlCoreBreadthFirstItertor: except IndexError: raise StopIteration self.node = parent.children + next = __next__ # # converters to present a nicer view of the XPath returns @@ -3363,8 +3365,10 @@ class xmlNode(xmlCore): def newNs(self, href, prefix): """Creation of a new Namespace. This function will refuse to create a namespace with a similar prefix than an existing - one present on this node. We use href==None in the case of - an element creation where the namespace was not defined. """ + one present on this node. Note that for a default + namespace, @prefix should be None. We use href==None in + the case of an element creation where the namespace was not + defined. """ ret = libxml2mod.xmlNewNs(self._o, href, prefix) if ret is None:raise treeError('xmlNewNs() failed') __tmp = xmlNs(_obj=ret) |