def checkName(element, name):
    if element.nodeType != element.ELEMENT_NODE:
        raise SyntaxError("Missing element: '%s'" % name)

    if name == None:
        return

    if element.tagName != name:
        raise SyntaxError("Wrong element name: should be '%s', is '%s'" % (name, element.tagName))
dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/attic/PicasaSnap/gdata/tlslite/utils/xmltools.py/checkName/original