The script doesn't have any decent file path checking or file error checking to prevent it from blowing up when it can't read the file ingested by it or from a bad path misspelling.
$ XMLCheck.py xl.xml
Traceback (most recent call last):
File "C:\Users\name\Documents\python\XMLChecker\XMLCheck.py", line 191, in <module>
main()
File "C:\Users\name\Documents\python\XMLChecker\XMLCheck.py", line 179, in main
et = parse(xmlFile)
File "C:\Users\name\AppData\Local\Programs\Python\Python37-32\lib\site-packages\defusedxml\common.py", line 105, in parse
return _parse(source, parser)
File "C:\Users\name\AppData\Local\Programs\Python\Python37-32\lib\xml\etree\ElementTree.py", line 1197, in parse
tree.parse(source, parser)
File "C:\Users\name\AppData\Local\Programs\Python\Python37-32\lib\xml\etree\ElementTree.py", line 587, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'xl.xml'
The script doesn't have any decent file path checking or file error checking to prevent it from blowing up when it can't read the file ingested by it or from a bad path misspelling.