diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-02-04 00:17:01 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-02-04 00:17:01 +0000 |
commit | 36eea2d2ee84132e66552f84724e9b377d687681 (patch) | |
tree | ceac9c9beb80baacae6f7409c1dc7e559ee97945 /python/libxml.c | |
parent | 4e1b26cfeba7f5fad4f8bd12fb5ce7029f930b79 (diff) | |
download | libxml2-36eea2d2ee84132e66552f84724e9b377d687681.tar.gz |
hardened the addChild function added accessors needed for xmlNode, a bit
* tree.c: hardened the addChild function
* python/generator.py python/libxml.c python/libxml2-python-api.xml
python/libxml2class.txt python/libxml_wrap.h python/TODO:
added accessors needed for xmlNode, a bit more testing and
extension of interfaces
* python/tests/Makefile.am python/tests/build.py: added a test
build from scratch/save/load/check
Daniel
Diffstat (limited to 'python/libxml.c')
-rw-r--r-- | python/libxml.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/python/libxml.c b/python/libxml.c index e37038ad..e167fcf6 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -810,6 +810,51 @@ libxml_type(PyObject *self, PyObject *args) /************************************************************************ * * + * Specific accessor functions * + * * + ************************************************************************/ +PyObject * +libxml_xmlNodeGetNsDefs(PyObject *self, PyObject *args) { + PyObject *py_retval; + xmlNsPtr c_retval; + xmlNodePtr node; + PyObject *pyobj_node; + + if (!PyArg_ParseTuple(args, "O:xmlNodeGetNsDefs", &pyobj_node)) + return(NULL); + node = (xmlNodePtr) PyxmlNode_Get(pyobj_node); + + if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) { + Py_INCREF(Py_None); + return(Py_None); + } + c_retval = node->nsDef; + py_retval = libxml_xmlNsPtrWrap((xmlNsPtr) c_retval); + return(py_retval); +} + +PyObject * +libxml_xmlNodeGetNs(PyObject *self, PyObject *args) { + PyObject *py_retval; + xmlNsPtr c_retval; + xmlNodePtr node; + PyObject *pyobj_node; + + if (!PyArg_ParseTuple(args, "O:xmlNodeGetNs", &pyobj_node)) + return(NULL); + node = (xmlNodePtr) PyxmlNode_Get(pyobj_node); + + if ((node == NULL) || (node->type != XML_ELEMENT_NODE)) { + Py_INCREF(Py_None); + return(Py_None); + } + c_retval = node->ns; + py_retval = libxml_xmlNsPtrWrap((xmlNsPtr) c_retval); + return(py_retval); +} + +/************************************************************************ + * * * The registration stuff * * * ************************************************************************/ |