Beispiel #1
0
def Node_childNodes(node):

    # NOTE: Consider a generator instead.

    child_nodes = []
    node = libxml2mod.children(node)
    while node is not None:
        # Remove doctypes.
        if Node_nodeType(node) != xml.dom.Node.DOCUMENT_TYPE_NODE:
            child_nodes.append(node)
        node = libxml2mod.next(node)
    return child_nodes
Beispiel #2
0
def Node_childNodes(node):

    # NOTE: Consider a generator instead.

    child_nodes = []
    node = libxml2mod.children(node)
    while node is not None:
        # Remove doctypes.
        if Node_nodeType(node) != xml.dom.Node.DOCUMENT_TYPE_NODE:
            child_nodes.append(node)
        node = libxml2mod.next(node)
    return child_nodes
 def __getattr__(self, attr):
     if attr == "parent":
         ret = libxml2mod.parent(self._o)
         if ret == None:
             return None
         return nodeWrap(ret)
     elif attr == "properties":
         ret = libxml2mod.properties(self._o)
         if ret == None:
             return None
         return xmlAttr(_obj=ret)
     elif attr == "children":
         ret = libxml2mod.children(self._o)
         if ret == None:
             return None
         return nodeWrap(ret)
     elif attr == "last":
         ret = libxml2mod.last(self._o)
         if ret == None:
             return None
         return nodeWrap(ret)
     elif attr == "next":
         ret = libxml2mod.next(self._o)
         if ret == None:
             return None
         return nodeWrap(ret)
     elif attr == "prev":
         ret = libxml2mod.prev(self._o)
         if ret == None:
             return None
         return nodeWrap(ret)
     elif attr == "content":
         return libxml2mod.xmlNodeGetContent(self._o)
     elif attr == "name":
         return libxml2mod.name(self._o)
     elif attr == "type":
         return libxml2mod.type(self._o)
     elif attr == "doc":
         ret = libxml2mod.doc(self._o)
         if ret == None:
             if self.type == "document_xml" or self.type == "document_html":
                 return xmlDoc(_obj=self._o)
             else:
                 return None
         return xmlDoc(_obj=ret)
     raise AttributeError(attr)
 def __getattr__(self, attr):
     if attr == "parent":
         ret = libxml2mod.parent(self._o)
         if ret == None:
             return None
         return xmlNode(_obj=ret)
     elif attr == "properties":
         ret = libxml2mod.properties(self._o)
         if ret == None:
             return None
         return xmlAttr(_obj=ret)
     elif attr == "children":
         ret = libxml2mod.children(self._o)
         if ret == None:
             return None
         return xmlNode(_obj=ret)
     elif attr == "last":
         ret = libxml2mod.last(self._o)
         if ret == None:
             return None
         return xmlNode(_obj=ret)
     elif attr == "next":
         ret = libxml2mod.next(self._o)
         if ret == None:
             return None
         return xmlNode(_obj=ret)
     elif attr == "prev":
         ret = libxml2mod.prev(self._o)
         if ret == None:
             return None
         return xmlNode(_obj=ret)
     elif attr == "content":
         return libxml2mod.xmlNodeGetContent(self._o)
     elif attr == "name":
         return libxml2mod.name(self._o)
     elif attr == "type":
         return libxml2mod.type(self._o)
     elif attr == "doc":
         ret = libxml2mod.doc(self._o)
         if ret == None:
             if self.type == "document_xml" or self.type == "document_html":
                 return xmlDoc(_obj=self._o)
             else:
                 return None
         return xmlDoc(_obj=ret)
     raise AttributeError,attr
 def get_children(self):
     ret = libxml2mod.children(self._o)
     if ret == None:
         return None
     return nodeWrap(ret)
Beispiel #6
0
 def get_children(self):
     ret = libxml2mod.children(self._o)
     if ret == None:
         return None
     return xmlNode(_obj=ret)
 def get_children(self):
     ret = libxml2mod.children(self._o)
     if ret == None:
         return None
     return xmlNode(_obj=ret)
Beispiel #8
0
 def get_children(self):
     ret = libxml2mod.children(self._o)
     if ret == None:
         return None
     return nodeWrap(ret)