Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P1302
xmlschema uri
Active
Public
Actions
Authored by
vlorentz
on Feb 24 2022, 6:35 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
SWORD deposit
Subscribers
None
✘ 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 foo bar</testurl>''')
>>> schema.to_dict('''<testurl>123 foo bar</testurl>''')
'123 foo bar'
Event Timeline
vlorentz
created this paste.
Feb 24 2022, 6:35 PM
2022-02-24 18:35:13 (UTC+1)
vlorentz
edited the content of this paste.
(Show Details)
Log In to Comment