def schema(self): """Return schema element (used for XSD validation).""" schema_el = self.root.xpath( '/wsdl:definitions/wsdl:types/xsd:schema', namespaces=NS_MAP, )[0] return element_as_tree(schema_el)
def schema(self): """Return schema element (used for XSD validation).""" if self._schema is None: schema_el = self.root.xpath( '/wsdl:definitions/wsdl:types/xsd:schema', namespaces=NS_MAP, )[0] self._schema = element_as_tree(schema_el) return self._schema
def __init__(self, schema_root): """XSDValidator init.""" self.root = element_as_tree(schema_root) self.schema = etree.XMLSchema(self.root)