logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

r31764 - lxml/trunk/src/lxml: msg#00138

Subject: r31764 - lxml/trunk/src/lxml
Author: scoder
Date: Mon Aug 28 18:15:07 2006
New Revision: 31764

Modified:
   lxml/trunk/src/lxml/etreepublic.pxd
   lxml/trunk/src/lxml/objectify.pyx
   lxml/trunk/src/lxml/public-api.pxi
Log:
public C function appendChild(parent, child)

Modified: lxml/trunk/src/lxml/etreepublic.pxd
==============================================================================
--- lxml/trunk/src/lxml/etreepublic.pxd (original)
+++ lxml/trunk/src/lxml/etreepublic.pxd Mon Aug 28 18:15:07 2006
@@ -185,6 +185,9 @@
     # set the tail text value of an element
     cdef int setTailText(tree.xmlNode* c_node, text) except -1
 
+    # append an element to the children of a parent element
+    cdef void appendChild(_Element parent, _Element child)
+
     # recursively lookup a namespace in element or ancestors, or create it
     cdef tree.xmlNs* findOrBuildNodeNs(_Document doc, tree.xmlNode* c_node,
                                        char* href)

Modified: lxml/trunk/src/lxml/objectify.pyx
==============================================================================
--- lxml/trunk/src/lxml/objectify.pyx   (original)
+++ lxml/trunk/src/lxml/objectify.pyx   Mon Aug 28 18:15:07 2006
@@ -461,7 +461,7 @@
         new_element = cetree.deepcopyNodeToDocument(
             parent._doc, (<_Element>value)._c_node)
         new_element.tag = tag
-        parent.append(new_element)
+        cetree.appendChild(parent, new_element)
     elif python.PyList_Check(value) or python.PyTuple_Check(value):
         for item in value:
             _appendValue(parent, tag, item)

Modified: lxml/trunk/src/lxml/public-api.pxi
==============================================================================
--- lxml/trunk/src/lxml/public-api.pxi  (original)
+++ lxml/trunk/src/lxml/public-api.pxi  Mon Aug 28 18:15:07 2006
@@ -101,6 +101,9 @@
 cdef public xmlNode* previousElement(xmlNode* c_node):
     return _previousElement(c_node)
 
+cdef public void appendChild(_Element parent, _Element child):
+    _appendChild(parent, child)
+
 cdef public object pyunicode(char* s):
     if s is NULL:
         raise TypeError


<Prev in Thread] Current Thread [Next in Thread>