2023-04-21 11:48:16 -05:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import xml.etree.ElementTree as ET
|
|
|
|
|
|
|
|
# Try to decode line in order to ensure it is a valid XML document
|
|
|
|
for line in sys.stdin:
|
|
|
|
try:
|
|
|
|
ET.fromstring(line)
|
2023-06-10 11:06:17 -05:00
|
|
|
except ET.ParseError:
|
2023-04-21 11:48:16 -05:00
|
|
|
print("Invalid xml: %r" % line)
|
|
|
|
raise
|