Example #1
0
 def _getValue(self, container, tagname):
     """ finds the first leaf element with given tagname contained in given element,
         and returns its value.
         
         Params:
             container -- a non leaf Element containing the wanted leaf element
             tagname -- tag (str) of the wanted leaf element
     """
     if not hasattr(container, "getElementsByTagName"):
         return ""
     leafNode = self._getElement(container, tagname)
     #given a leaf node, returns its value.
     return utils.nodeValue(leafNode)
Example #2
0
    def _getValue(self, container, tagname):
        """ finds the first leaf element with given tagname contained in given element,
            and returns its value.

            Params:
                container -- a non leaf Element containing the wanted leaf element
                tagname -- tag (str) of the wanted leaf element
        """
        if not hasattr(container, "getElementsByTagName"):
            return ""
        leafNode = self._getElement(container, tagname)
        #given a leaf node, returns its value.
        return utils.nodeValue(leafNode)