module: xml_utility¶
XML utility methods
-
exception
Assign_GUP.xml_utility.IncorrectXmlRootTag[source]¶ Bases:
lxml.etree.DocumentInvalidthe root tag of the XML file is incorrect
-
exception
Assign_GUP.xml_utility.InvalidWithXmlSchema[source]¶ Bases:
lxml.etree.DocumentInvaliderror while validating against the XML Schema
-
exception
Assign_GUP.xml_utility.XmlSyntaxError[source]¶ Bases:
lxml.etree.XMLSyntaxErrorXml Syntax error
-
Assign_GUP.xml_utility.getXmlText(parent, tag, default=None)[source]¶ Read the text content of an XML node
Parameters: - reviewer – lxml node node
- default – default value is no node text
Returns: node text or None
-
Assign_GUP.xml_utility.readValidXmlDoc(filename, expected_root_tag, XML_Schema_file, alt_root_tag='', alt_schema=None)[source]¶ Common code to read an XML file, validate it with an XML Schema, and return the XML doc object
Parameters: XML_Schema_file (str) – name of XML Schema file (local to package directory)