def get_schema_version_from_xml(xml):
    """ Get schemaVersion attribute from OpenMalaria scenario file
    xml - open file or content of xml document to be processed
    """
    if isinstance(xml, six.string_types):
        xml = StringIO(xml)
    try:
        tree = ElementTree.parse(xml)
    except ParseError:
        # Not an XML file
        return None
    root = tree.getroot()
    return root.attrib.get('schemaVersion', None)
Get schemaVersion attribute from OpenMalaria scenario file
    xml - open file or content of xml document to be processed