Package xmlschema_acue :: Package validators :: Module globals_ :: Class XsdGlobals

Class XsdGlobals

source code


Mediator class for related XML schema instances. It stores the global declarations defined in the registered schemas. Register a schema to add it's declarations to the global maps.

:param validator: the origin schema class/instance used for creating the global maps. :param validation: the XSD validation mode to use, can be 'strict', 'lax' or 'skip'.

Instance Methods
 
__repr__(self) source code
 
lookup_notation(self, qname) source code
 
lookup_type(self, qname) source code
 
lookup_attribute(self, qname) source code
 
lookup_attribute_group(self, qname) source code
 
lookup_group(self, qname) source code
 
lookup_element(self, qname) source code
 
lookup(self, tag, qname) source code
 
iter_schemas(self)
Creates an iterator for the schemas registered in the instance.
source code
 
iter_globals(self)
Creates an iterator for XSD global definitions/declarations.
source code
 
register(self, schema)
Registers an XMLSchema instance.
source code

Inherited from xsdbase.XsdValidator: __str__, __unicode__

Method Details

__init__(self, validator, validation='strict')
(Constructor)

source code 
Decorators:
Overrides: xsdbase.XsdValidator.__init__

copy(self, validator=None, validation=None)

source code 

Makes a copy of the object.

Decorators:
Overrides: xsdbase.XsdValidator.copy

__copy__(self, validator=None, validation=None)

source code 

Makes a copy of the object.

Decorators:
Overrides: xsdbase.XsdValidator.copy

built(self)

source code 

Property that is ``True`` if schema validator has been fully parsed and built, ``False`` otherwise.

Decorators:
  • @property
Overrides: xsdbase.XsdValidator.built
(inherited documentation)

validation_attempted(self)

source code 

Property that returns the *validation status* of the XSD validator. It can be 'full', 'partial' or 'none'.

| https://www.w3.org/TR/xmlschema-1/#e-validation_attempted | https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#e-validation_attempted

Decorators:
  • @property
Overrides: xsdbase.XsdValidator.validation_attempted
(inherited documentation)

validity(self)

source code 

Property that returns the XSD validator's validity. It can be ‘valid’, ‘invalid’ or ‘notKnown’.

| https://www.w3.org/TR/xmlschema-1/#e-validity | https://www.w3.org/TR/2012/REC-xmlschema11-1-20120405/#e-validity

Decorators:
  • @property
Overrides: xsdbase.XsdValidator.validity
(inherited documentation)

resources(self)

source code 
Decorators:
  • @property

all_errors(self)

source code 

A list with all the building errors of the XSD validator and its components.

Decorators:
  • @property
Overrides: xsdbase.XsdValidator.all_errors
(inherited documentation)

iter_components(self, xsd_classes=None)

source code 

Creates an iterator for traversing all XSD components of the validator.

:param xsd_classes: returns only a specific class/classes of components, otherwise returns all components.

Decorators:
Overrides: xsdbase.XsdValidator.iter_components
(inherited documentation)

clear(self, remove_schemas=False, only_unbuilt=False)

source code 

Clears the instance maps and schemas.

:param remove_schemas: removes also the schema instances. :param only_unbuilt: removes only not built objects/schemas.

Decorators:

build(self)

source code 

Build the maps of XSD global definitions/declarations. The global maps are updated adding and building the globals of not built registered schemas.

Decorators:

parse_error(self, error, elem=None)

source code 

Helper method for registering parse errors. Does nothing if validation mode is 'skip'. Il validation mode is 'lax' collects the error, otherwise raise the error.

:param error: can be a parse error or an error message. :param elem: the Element instance related to the error, for default uses the 'elem' attribute of the validator, if it's present.

Decorators: