This commit is contained in:
2023-02-10 14:51:06 +01:00
parent d35103422b
commit 84aef5d830

View File

@@ -37,14 +37,16 @@ def xsd(source: str, xsd: str) -> bool:
:type source: str
:param xsd: XSD schema to validate XML against
:type xsd: str
:return: If the validation was successful or not
:rtype: bool
:return: Message saying, if the validation was successful or not
:rtype: str
"""
xml_schema = etree.XMLSchema(etree.XML(xsd))
xml = etree.XML(source)
return xml_schema.validate(xml)
if xml_schema.validate(xml):
return "XML is valid."
else:
return "XML is NOT valid."
def xslt(source: str, xslt: str) -> str: