Пример #1
0
    def xmlIfExtGetAttributeDict(self):
        """Return a dictionary with all attributes of this element."""
        attribDict = {}
        for attrNameNS, attrNodeOrValue in self.element.attributes.itemsNS():
            attribDict[NsNameTupleFactory(attrNameNS)] = attrNodeOrValue

        return attribDict
Пример #2
0
 def xmlIfExtCreateElement(self, nsName, attributeDict, curNs):
     elementNode = self.document.createElementNS(nsName[0], nsName[1])
     intElementWrapper = self.internalElementWrapperClass(elementNode, self)
     for attrName, attrValue in attributeDict.items():
         intElementWrapper.xmlIfExtSetAttribute(
             NsNameTupleFactory(attrName), attrValue, curNs)
     return intElementWrapper
Пример #3
0
 def __getBaseUrl (self, elementWrapper):
     """Retrieve base URL for the given element node.
     
     Input parameter:
         elementWrapper:    wrapper of current element node
     """
     nsNameBaseAttr = NsNameTupleFactory ((XML_NAMESPACE, "base"))
     if elementWrapper.hasAttribute(nsNameBaseAttr):
         return convertToAbsUrl (elementWrapper.getAttribute(nsNameBaseAttr), self.baseUrlStack[0])
     else:
         return self.baseUrlStack[0]
Пример #4
0
 def xmlIfExtGetAttributeDict(self):
     attribDict = {}
     for nsAttrName, attrNodeOrValue in self.element.attributes.items():
         attribDict[NsNameTupleFactory(
             nsAttrName)] = attrNodeOrValue.nodeValue
     return attribDict