Package xmlschema_acue :: Package validators :: Module models :: Class ModelGroup

Class ModelGroup

source code


Class for XSD model group particles. This class implements only model related methods, schema element parsing and validation methods are implemented in derived classes.

Instance Methods
 
__init__(self, model) source code
 
__repr__(self) source code
 
__getitem__(self, i) source code
 
__setitem__(self, i, item) source code
 
__delitem__(self, i) source code
 
__len__(self) source code
 
insert(self, i, item) source code
 
__setattr__(self, name, value) source code
 
clear(self) source code
 
iter_subelements(self, depth=0) source code

Inherited from xsdbase.ParticleMixin: is_ambiguous, is_missing, is_over, is_single, is_univocal, parse_error

Class Variables

Inherited from xsdbase.ParticleMixin: max_occurs, min_occurs

Method Details

is_emptiable(self)

source code 
Decorators:
Overrides: xsdbase.ParticleMixin.is_emptiable

is_empty(self)

source code 
Decorators:
Overrides: xsdbase.ParticleMixin.is_empty

is_pointless(self, parent)

source code 

Returns `True` if the group may be eliminated without affecting the model, `False` otherwise. A group is pointless if one of those conditions is verified:

  • the group is empty
  • minOccurs == maxOccurs == 1 and the group has one child
  • minOccurs == maxOccurs == 1 and the group and its parent have a sequence model
  • minOccurs == maxOccurs == 1 and the group and its parent have a choice model

Ref: https://www.w3.org/TR/2004/REC-xmlschema_acue-1-20041028/#coss-particle

:param parent: effective parent of the model group.

Decorators:

has_occurs_restriction(self, other)

source code 
Decorators:
Overrides: xsdbase.ParticleMixin.has_occurs_restriction

iter_model(self, depth=0)

source code 

A generator function iterating elements and groups of a model group. Skips pointless groups, iterating deeper through them. Raises `XMLSchemaModelDepthError` if the argument *depth* is over `MAX_MODEL_DEPTH` value.

:param depth: guard for protect model nesting bombs, incremented at each deepest recursion.

Decorators:

iter_elements(self, depth=0)

source code 

A generator function iterating model's elements. Raises `XMLSchemaModelDepthError` if the argument *depth* is over `MAX_MODEL_DEPTH` value.

:param depth: guard for protect model nesting bombs, incremented at each deepest recursion.

Decorators:

check_model(self)

source code 

Checks if the model group is deterministic. Types matching of same elements and Unique Particle Attribution Constraint are checked. Raises an `XMLSchemaModelError` at first violated constraint.

Decorators:

occurs(self)

source code 
Decorators:
  • @property