Created
April 19, 2016 08:52
-
-
Save tinogis/801c959e2589abb32c6ff2f1a216d2bf to your computer and use it in GitHub Desktop.
Validates a CNMC ATR management XML file with using switching library. Selects the correct XSD file automatically from message header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
import sys | |
from switching.input.messages import message | |
from switching.input.messages.message import except_f1 | |
with open(sys.argv[1], 'r') as xml_file: | |
try: | |
data = xml_file.read() | |
m = message.Message(data) | |
m.parse_xml() | |
sys.stdout.write('Fitxer Correcte\n') | |
except Exception, e: | |
sys.stdout.write('Fitxer Invàlid: {0}\n'.format(str(e.value))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment