13 lines
350 B
Python
13 lines
350 B
Python
|
|
import xml.etree.ElementTree as ET
|
||
|
|
import sys
|
||
|
|
|
||
|
|
try:
|
||
|
|
tree = ET.parse('dialogalgoarg.ui')
|
||
|
|
print('XML is valid!')
|
||
|
|
root = tree.getroot()
|
||
|
|
print(f'Root tag: {root.tag}')
|
||
|
|
except ET.ParseError as e:
|
||
|
|
print(f'XML Parse Error at line {e.position[0]}, column {e.position[1]}: {e}')
|
||
|
|
except Exception as e:
|
||
|
|
print(f'Error: {e}')
|