Example #1
0
 def getElementsByTagName(self, tagName):
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if tagName == '*' or root.tagName == tagName:
             nodeList.append(root)
         nodeList.extend(list(root.getElementsByTagName(tagName)))
     return nodeList
Example #2
0
 def getElementsByTagName(self, tagName):
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if tagName == '*' or root.tagName == tagName:
             nodeList.append(root)
         nodeList.extend(list(root.getElementsByTagName(tagName)))
     return nodeList
Example #3
0
 def getElementsByTagName(self, tagName):
     nodeList = implementation._4dom_createNodeList()
     elements = filter(lambda node, type=Node.ELEMENT_NODE:
                       node.nodeType == type,
                       self.childNodes)
     for element in elements:
         if tagName == '*' or element.tagName == tagName:
             nodeList.append(element)
         nodeList.extend(list(element.getElementsByTagName(tagName)))
     return nodeList
Example #4
0
 def getElementsByTagNameNS(self,namespaceURI,localName):
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if ((namespaceURI == '*' or namespaceURI == root.namespaceURI) and
             (localName == '*' or localName == root.localName)):
             nodeList.append(root)
         nodeList.extend(list(root.getElementsByTagNameNS(namespaceURI,
                                                          localName)))
     return nodeList
Example #5
0
 def getElementsByTagNameNS(self,namespaceURI,localName):
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if ((namespaceURI == '*' or namespaceURI == root.namespaceURI) and
             (localName == '*' or localName == root.localName)):
             nodeList.append(root)
         nodeList.extend(list(root.getElementsByTagNameNS(namespaceURI,
                                                          localName)))
     return nodeList
Example #6
0
 def getElementsByTagName(self, tagName):
     nodeList = implementation._4dom_createNodeList()
     elements = filter(lambda node, type=Node.ELEMENT_NODE:
                       node.nodeType == type,
                       self.childNodes)
     for element in elements:
         if tagName == '*' or element.tagName == tagName:
             nodeList.append(element)
         nodeList.extend(list(element.getElementsByTagName(tagName)))
     return nodeList
Example #7
0
 def getElementsByTagNameNS(self, namespaceURI, localName):
     if namespaceURI == '':
         raise NamespaceErr("Use None instead of '' for empty namespace")
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if ((namespaceURI == '*' or namespaceURI == root.namespaceURI)
                 and (localName == '*' or localName == root.localName)):
             nodeList.append(root)
         nodeList.extend(
             list(root.getElementsByTagNameNS(namespaceURI, localName)))
     return nodeList
Example #8
0
 def getElementsByTagNameNS(self,namespaceURI,localName):
     if namespaceURI == '':
         raise NamespaceErr("Use None instead of '' for empty namespace")
     nodeList = implementation._4dom_createNodeList([])
     root = self.documentElement
     if root:
         if ((namespaceURI == '*' or namespaceURI == root.namespaceURI) and
             (localName == '*' or localName == root.localName)):
             nodeList.append(root)
         nodeList.extend(list(root.getElementsByTagNameNS(namespaceURI,
                                                          localName)))
     return nodeList
Example #9
0
 def getElementsByTagNameNS(self, namespaceURI, localName):
     nodeList = implementation._4dom_createNodeList()
     elements = filter(lambda node, type=Node.ELEMENT_NODE:
                       node.nodeType == type,
                       self.childNodes)
     for element in elements:
         if ((namespaceURI == '*' or element.namespaceURI == namespaceURI)
             and (localName == '*' or element.localName == localName)):
             nodeList.append(element)
         nodeList.extend(list(element.getElementsByTagNameNS(namespaceURI,
                                                             localName)))
     return nodeList
Example #10
0
 def __init__(self, ownerDocument, namespaceURI=EMPTY_NAMESPACE, prefix=None, localName=None):
     Event.EventTarget.__init__(self)
     self.__dict__["__nodeName"] = None
     self.__dict__["__nodeValue"] = None
     self.__dict__["__parentNode"] = None
     self.__dict__["__childNodes"] = None
     self.__dict__["__previousSibling"] = None
     self.__dict__["__nextSibling"] = None
     self.__dict__["__attributes"] = None
     self.__dict__["__ownerDocument"] = ownerDocument
     self.__dict__["__namespaceURI"] = namespaceURI
     self.__dict__["__prefix"] = prefix
     self.__dict__["__localName"] = localName
     self.__dict__["__childNodes"] = implementation._4dom_createNodeList([])
     self.__dict__["__readOnly"] = 0
Example #11
0
 def __init__(self,
              ownerDocument,
              namespaceURI=EMPTY_NAMESPACE,
              prefix=None,
              localName=None):
     Event.EventTarget.__init__(self)
     self.__dict__['__nodeName'] = None
     self.__dict__['__nodeValue'] = None
     self.__dict__['__parentNode'] = None
     self.__dict__['__childNodes'] = None
     self.__dict__['__previousSibling'] = None
     self.__dict__['__nextSibling'] = None
     self.__dict__['__attributes'] = None
     self.__dict__['__ownerDocument'] = ownerDocument
     self.__dict__['__namespaceURI'] = namespaceURI
     self.__dict__['__prefix'] = prefix
     self.__dict__['__localName'] = localName
     self.__dict__['__childNodes'] = implementation._4dom_createNodeList([])
     self.__dict__['__readOnly'] = 0
Example #12
0
 def __init__(self,
              ownerDocument,
              namespaceURI=None,
              prefix=None,
              localName=None):
     Event.EventTarget.__init__(self)
     self.__dict__['__nodeName'] = None
     self.__dict__['__nodeValue'] = None
     self.__dict__['__parentNode'] = None
     self.__dict__['__childNodes'] = None
     self.__dict__['__previousSibling'] = None
     self.__dict__['__nextSibling'] = None
     self.__dict__['__attributes'] = None
     self.__dict__['__ownerDocument'] = ownerDocument
     self.__dict__['__namespaceURI'] = namespaceURI
     self.__dict__['__prefix'] = prefix
     self.__dict__['__localName'] = localName
     self.__dict__['__childNodes'] = implementation._4dom_createNodeList([])
     self.__dict__['__readOnly'] = 0