code: def _get_required_attribute(node, attr):
      
  
      if not node.hasAttribute(attr):
          raise ParseError(
              'Expecting %s attribute in element %s' % (attr, node.tagName))
  
      return node.getAttribute(attr)
docs: Return an attribute by name.  Raise ParseError if not present.