def xmlIfExtGetFirstChild(self, filterTag=None):
        # replace base method (performance optimized)
        if filterTag == None:
            children = self.getchildren()
            if children != []:
                element = children[0]
            else:
                element = None
        else:
            clarkFilterTag = toClarkQName(filterTag)
            element = self.find(clarkFilterTag)

        return element
Exemple #2
0
    def xmlIfExtGetFirstChild (self, filterTag=None):
        # replace base method (performance optimized)
        if filterTag == None:
            children = self.getchildren()
            if children != []:
                element = children[0]
            else:
                element = None
        else:
            clarkFilterTag = toClarkQName(filterTag)
            element = self.find(clarkFilterTag)

        return element
 def createXmlTree(self,
                   namespace,
                   xmlRootTagName,
                   attributeDict={},
                   publicId=None,
                   systemId=None):
     rootNode = ElementExtension(toClarkQName(xmlRootTagName),
                                 attributeDict)
     rootNode.xmlIfExtSetParentNode(None)
     treeWrapper = self.treeWrapperClass(self,
                                         ElementTreeExtension(rootNode),
                                         self.useCaching)
     rootNodeWrapper = self.elementWrapperClass(
         rootNode, treeWrapper, [])  # TODO: namespace handling
     return treeWrapper
 def xmlIfExtSetAttribute(self, tupleOrAttrName, attributeValue, curNs):
     self.attrib[toClarkQName(tupleOrAttrName)] = attributeValue
 def xmlIfExtGetAttribute(self, tupleOrAttrName):
     clarkQName = toClarkQName(tupleOrAttrName)
     if self.attrib.has_key(clarkQName):
         return self.attrib[clarkQName]
     else:
         return None
 def xmlIfExtGetIterator(self, filterTag=(None, None)):
     clarkFilterTag = toClarkQName(filterTag)
     return self.getiterator(clarkFilterTag)
 def xmlIfExtGetElementsByTagName(self, filterTag=(None, None)):
     clarkFilterTag = toClarkQName(filterTag)
     descendants = []
     for node in self.xmlIfExtGetChildren():
         descendants.extend(node.getiterator(clarkFilterTag))
     return descendants
 def xmlIfExtGetChildren(self, filterTag=None):
     if filterTag == None:
         return self.getchildren()
     else:
         clarkFilterTag = toClarkQName(filterTag)
         return self.findall(clarkFilterTag)
Exemple #9
0
 def xmlIfExtGetChildren (self, filterTag=None):
     if filterTag == None:
         return self.getchildren()
     else:
         clarkFilterTag = toClarkQName(filterTag)
         return self.findall(clarkFilterTag)
Exemple #10
0
 def createXmlTree (self, namespace, xmlRootTagName, attributeDict={}, publicId=None, systemId=None):
     rootNode = ElementExtension(toClarkQName(xmlRootTagName), attributeDict)
     rootNode.xmlIfExtSetParentNode(None)
     treeWrapper = self.treeWrapperClass(self, ElementTreeExtension(rootNode), self.useCaching)
     rootNodeWrapper = self.elementWrapperClass (rootNode, treeWrapper, []) # TODO: namespace handling
     return treeWrapper
Exemple #11
0
 def xmlIfExtRemoveAttribute (self, tupleOrAttrName):
     clarkQName = toClarkQName(tupleOrAttrName)
     if self.attrib.has_key(clarkQName):
         del self.attrib[clarkQName]
Exemple #12
0
 def xmlIfExtSetAttribute (self, tupleOrAttrName, attributeValue, curNs):
     self.attrib[toClarkQName(tupleOrAttrName)] = attributeValue
Exemple #13
0
 def xmlIfExtGetAttribute (self, tupleOrAttrName):
     clarkQName = toClarkQName(tupleOrAttrName)
     if self.attrib.has_key(clarkQName):
         return self.attrib[clarkQName]
     else:
         return None
Exemple #14
0
 def xmlIfExtGetIterator (self, filterTag=(None,None)):
     clarkFilterTag = toClarkQName(filterTag)
     return self.getiterator (clarkFilterTag)
Exemple #15
0
 def xmlIfExtGetElementsByTagName (self, filterTag=(None,None)):
     clarkFilterTag = toClarkQName(filterTag)
     descendants = []
     for node in self.xmlIfExtGetChildren():
         descendants.extend(node.getiterator(clarkFilterTag))
     return descendants
 def xmlIfExtRemoveAttribute(self, tupleOrAttrName):
     clarkQName = toClarkQName(tupleOrAttrName)
     if self.attrib.has_key(clarkQName):
         del self.attrib[clarkQName]
 def xmlIfExtCreateElement(self, nsName, attributeDict, curNs):
     clarkQName = toClarkQName(nsName)
     return ElementExtension(clarkQName, attributeDict)
Exemple #18
0
 def xmlIfExtCreateElement (self, nsName, attributeDict, curNs):
     clarkQName = toClarkQName(nsName)
     return ElementExtension (clarkQName, attributeDict)