def __AddPositionToElement(self, tree, parent_element):
    try:
      line, column, f = tree.position.GetLine(), tree.position.GetColumn(), tree.position.GetFile()
    except __HOLE__ as e:
      line, column, f = None, None, None

    attributes = {
        'line'    : str(line),
        'column'  : str(column),
        'file'    : str(f)
    }
    
    position_element = ET.SubElement(parent_element, "Position", attrib=attributes)
    return
dataset/ETHPy150Open spranesh/Redhawk/redhawk/common/writers/xml_writer.py/XMLWriter.__AddPositionToElement