def validate_xml(file):
max_file_size = current_app.config.get(<EOL>'<STR_LIT>', <NUM_LIT:1> * <NUM_LIT> * <NUM_LIT>)<EOL>if file.size > max_file_size:<EOL><INDENT>return False<EOL><DEDENT>with file.open() as fp:<EOL><INDENT>try:<EOL><INDENT>content = fp.read().decode('<STR_LIT:utf-8>')<EOL>xml.dom.minidom.parseString(content)<EOL>return True<EOL><DEDENT>except:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>
Validate an XML file.