summaryrefslogtreecommitdiff
path: root/python/libxml.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-09-24 21:23:56 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-09-24 21:23:56 +0000
commite96a2a4bf040ec93f83d9c33f8ae4ac3f1e512e9 (patch)
tree154793ec639eb1e9d6031c01410d94bcb97dc55b /python/libxml.c
parent16fa96c5d013ef465b4db98170c435eeded0c4d4 (diff)
downloadlibxml2-e96a2a4bf040ec93f83d9c33f8ae4ac3f1e512e9.tar.gz
adding repeated parsing and validating tests make the new DOM tree
* Makefile.am: adding repeated parsing and validating tests * SAX2.c parser.c tree.c include/libxml/parser.h: make the new DOM tree building interfaces use the dictionary from the parsing context to build the element and attributes names as well as formatting spaces and short text nodes * include/libxml/dict.h dict.c: added some reference counting for xmlDictPtr because they can be shared by documents and a parser context. * xmlreader.c: a bit of cleanup, remove the specific tree freeing functions and use the standard ones now. * xmllint.c: add --nodict * python/libxml.c: fix a stupid bug so that ns() works on attribute nodes. Daniel
Diffstat (limited to 'python/libxml.c')
-rw-r--r--python/libxml.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/libxml.c b/python/libxml.c
index f323d81d..cd71ff17 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -2288,7 +2288,9 @@ libxml_xmlNodeGetNs(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
return (NULL);
node = (xmlNodePtr) PyxmlNode_Get(pyobj_node);
- if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) {
+ if ((node == NULL) ||
+ ((node->type != XML_ELEMENT_NODE) &&
+ (node->type != XML_ATTRIBUTE_NODE))) {
Py_INCREF(Py_None);
return (Py_None);
}