File: validation_internal_error.py

package info (click to toggle)
spyne 2.14.0-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,968 kB
  • sloc: python: 35,938; xml: 3,140; sh: 137; makefile: 135; ruby: 19
file content (11 lines) | stat: -rwxr-xr-x 297 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env python

from lxml.etree import XMLParser, fromstring, XMLSchema

schema_doc = open('schema.xsd').read()
inst_doc = open('inst.xml').read()

parser = XMLParser(resolve_entities=False)
elt = fromstring(inst_doc, parser)
schema = XMLSchema(fromstring(schema_doc))
schema.validate(elt)