schrodinger.application.matsci.qexsd.qespresso.xsdtypes.xmlschema module¶
This module contains XMLSchema class for xsdtypes package
-
class
schrodinger.application.matsci.qexsd.qespresso.xsdtypes.xmlschema.XMLSchema(xsd_file)¶ Bases:
objectClass to wrap an XML Schema for types lookups.
-
XML_SCHEMA_NAMESPACES= {'xs': 'http://www.w3.org/2001/XMLSchema', 'xsd': 'http://www.w3.org/2001/XMLSchema', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}¶
-
__init__(xsd_file)¶ Initialize self. See help(type(self)) for accurate signature.
-
namespaces= None¶ Namespaces used by XSD file
-
types= None¶ Map XSD global types to XSDType instance
-
attributes= None¶ Map XSD global attributes to XSDType instance
-
attribute_groups= None¶ Group XSD attributes definitions
-
elements= None¶ Map XSD global elements to XSDType instance
-
groups= None¶ Group XSD elements definitions
-
target_namespace= None¶ Target namespace URI
-
target_prefix= None¶ Namespace prefix for declarations
-
get_type(type_name)¶ Return the XSD type instance corresponding to the argument.
Parameters: type_name – Name of the type. Types in the schema’s namespace have to be provided with namespace URI or prefix. Unqualified names are interpreted as typed of xsd/xs namespace. :return: XSDType or XSDSimpleType instance
-
get_element(element_path)¶
-
__class__¶ alias of
builtins.type
-
__delattr__¶ Implement delattr(self, name).
-
__dict__= mappingproxy({'__module__': 'schrodinger.application.matsci.qexsd.qespresso.xsdtypes.xmlschema', '__doc__': '\n Class to wrap an XML Schema for types lookups.\n ', 'XML_SCHEMA_NAMESPACES': {'xsd': 'http://www.w3.org/2001/XMLSchema', 'xs': 'http://www.w3.org/2001/XMLSchema', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}, '__init__': <function XMLSchema.__init__>, 'get_type': <function XMLSchema.get_type>, 'get_element': <function XMLSchema.get_element>, 'get_element_tag': <function XMLSchema.get_element_tag>, 'get_attributes': <function XMLSchema.get_attributes>, 'get_element_type': <function XMLSchema.get_element_type>, 'get_attribute_type': <function XMLSchema.get_attribute_type>, 'get_element_default': <function XMLSchema.get_element_default>, 'get_attribute_default': <function XMLSchema.get_attribute_default>, 'find': <function XMLSchema.find>, 'findall': <function XMLSchema.findall>, 'getroot': <function XMLSchema.getroot>, 'iselement': <function XMLSchema.iselement>, 'iter': <function XMLSchema.iter>, 'validate': <function XMLSchema.validate>, '__dict__': <attribute '__dict__' of 'XMLSchema' objects>, '__weakref__': <attribute '__weakref__' of 'XMLSchema' objects>})¶
-
__dir__() → list¶ default dir() implementation
-
__eq__¶ Return self==value.
-
__format__()¶ default object formatter
-
__ge__¶ Return self>=value.
-
__getattribute__¶ Return getattr(self, name).
-
__gt__¶ Return self>value.
-
__hash__¶ Return hash(self).
-
__init_subclass__()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__¶ Return self<=value.
-
__lt__¶ Return self<value.
-
__module__= 'schrodinger.application.matsci.qexsd.qespresso.xsdtypes.xmlschema'¶
-
__ne__¶ Return self!=value.
-
__new__()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__()¶ helper for pickle
-
__reduce_ex__()¶ helper for pickle
-
__repr__¶ Return repr(self).
-
__setattr__¶ Implement setattr(self, name, value).
-
__sizeof__() → int¶ size of object in memory, in bytes
-
__str__¶ Return str(self).
-
__subclasshook__()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__¶ list of weak references to the object (if defined)
-
get_element_tag(element_path)¶ Return the XSD type instance of the element.
Parameters: element_path – The absolute path to the element. Schema’s namespace prefixes or URIs are stripped from the path. :return: XSDType, XSDSimpleType or XSDComplexType instance
-
get_attributes(element_path)¶
-
get_element_type(element_path)¶ Return the XSD type instance of the element.
Parameters: element_path – The absolute path to the element. Schema’s namespace prefixes or URIs are stripped from the path. :return: XSDType, XSDSimpleType or XSDComplexType instance
-
get_attribute_type(attribute_name, element_path)¶ Return the XSD type instance of the attribute.
Parameters: attribute_name – The name of the attribute. Schema’s namespace prefix or URI is stripped from the name. :param element_path: The absolute path to the element. Schema’s namespace prefixes or URIs are stripped from the path. :return: XSDType or XSDSimpleType instance
-
get_element_default(element_path)¶ Return the default of the element.
Parameters: element_path – The absolute path to the element. Schema’s namespace prefixes or URIs are stripped from the path. :return: XSDType, XSDSimpleType or XSDComplexType instance
-
get_attribute_default(attribute_name, element_path)¶ Return the XSD type instance of the attribute.
Parameters: attribute_name – The name of the attribute. Schema’s namespace prefix or URI is stripped from the name. :param element_path: The absolute path to the element. Schema’s namespace prefixes or URIs are stripped from the path. :return: XSDType or XSDSimpleType instance
-
find(path, namespaces=None)¶ Find first matching element by tag name or path.
Parameters: - path – is a string having either an element tag or an XPath,
- namespaces – is an optional mapping from namespace prefix to full name.
Returns: the first matching element, or None if no element was found
-
findall(path, namespaces=None)¶ Find all matching subelements by tag name or path.
Parameters: - path – is a string having either an element tag or an XPath,
- namespaces – is an optional mapping from namespace prefix to full name.
Returns: the first matching element, or None if no element was found
-
getroot()¶ Return root element of the XML schema tree.
-
iselement(elem)¶ Checks if an element instance appears to be a valid element object. :param elem:
-
iter(tag=None)¶ Create and return an iterator that loops over all elements in this tree, in document order.
Parameters: tag – is a string with the tag name to iterate over (default is to return all elements).
-
validate(xml_config)¶ Validate the configuration with XSD and with optional parameter dependencies. :param xml_config:
-