Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from lxml import etree
- schema = open("schema.xsd")
- library = open("library.xml")
- xmlschema_doc = etree.parse(schema)
- xmlschema = etree.XMLSchema(xmlschema_doc)
- library_doc = etree.parse(library)
- if xmlschema.validate(library_doc):
- print "Valid XML"
- else:
- print "Invalid XML"
Add Comment
Please, Sign In to add comment