Package pyxb :: Package binding :: Module content :: Class GroupChoice
[hide private]
[frames] | no frames]

Class GroupChoice

source code

    object --+            
             |            
       cscRoot --+        
                 |        
ContentModel_mixin --+    
                     |    
                _Group --+
                         |
                        GroupChoice

Nested Classes [hide private]
  _StateClass
A reference to a ContentState_mixin class that maintains state when validating an instance of this group.
Instance Methods [hide private]
 
_validate(self, symbol_set, output_sequence)
Determine whether an output sequence created from the symbols can be made consistent with the model.
source code

Inherited from _Group: __init__, newState, particles

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from _Group (private): _Group__particles

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_validate(self, symbol_set, output_sequence)

source code 

Determine whether an output sequence created from the symbols can be made consistent with the model.

The symbol set represents letters in an alphabet; the output sequence orders those letters in a way that satisfies the regular expression expressed in the model. Both are changed as a result of a successful validation; both remain unchanged if the validation failed. In recursing, implementers may assume that output_sequence is monotonic: its length remains unchanged after an invocation iff the symbol set also remains unchanged. The _validateCloneSymbolSet, _validateCloneOutputSequence, and _validateReplaceResults methods are available to help preserve this behavior.

Parameters:
  • symbol_set - A map from ElementUse instances to a list of values. The order of the values corresponds to the order in which they should appear. A key of None identifies values that are stored as wildcard elements. Values are removed from the lists as they are used; when the last value of a list is removed, its key is removed from the map. Thus an empty dictionary is the indicator that no more symbols are available.
  • output_sequence - A mutable list to which should be appended tuples ( eu, val ) where eu is an ElementUse from the set of symbol keys, and val is a value from the corresponding list. A document generated by producing the elements in the given order is expected to validate.
Returns:
True iff the model validates. symbol_set and output_path will be unchanged if this returns False.
Overrides: ContentModel_mixin._validate
(inherited documentation)