Created
September 29, 2016 14:55
-
-
Save bor8/677c3fd390f004ea7a46bb48bf7a4fa2 to your computer and use it in GitHub Desktop.
Test own schema.
This file contains 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
schema_root = etree.XML('''\ | |
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<xsd:element name="a" type="xsd:integer"/> | |
</xsd:schema> | |
''') | |
schema = etree.XMLSchema(schema_root) | |
parser = etree.XMLParser(schema = schema) | |
root = etree.fromstring("<a>5</a>", parser) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment