✘ dev@desktop5 ~/swh-environment/swh-deposit validate-metadata ● pip3 show xmlschema
Name: xmlschema
Version: 1.9.2
Summary: An XML Schema validator and decoder
Home-page: https://github.com/sissaschool/xmlschema
Author: Davide Brunato
Author-email: brunato@sissa.it
License: MIT
Location: /home/dev/.local/lib/python3.9/site-packages
Requires: elementpath
Required-by:
dev@desktop5 ~/swh-environment/swh-deposit validate-metadata ● python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xmlschema
>>> schema = xmlschema.XMLSchema11('''<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="testurl" type="xsd:anyURI" /></xsd:schema>''')
>>> schema.validate('''<testurl>123 bar baz</testurl>''')