Attempt to apply the value as a new instance of the particle's
term.
The ContentState_mixin created for the particle's term is
consulted to determine whether the instance can accept the given value.
If so, the particle's maximum occurrence limit is checked; if not, and
the particle has a parent state, it is informed of the failure.
- Parameters:
instance - An instance of a subclass of basis.complexTypeDefinition, into which the
provided value will be stored if it is consistent with the
current model state.
value - The value that is being validated against the state.
element_use - An optional ElementUse instance that specifies the element
to which the value corresponds. This will be available when the
value is extracted by parsing a document, but will be absent if
the value was passed as a constructor positional parameter.
- Returns:
( consumed, underflow_exc ) A tuple where the first
element is True iff the provided value was accepted
in the current state. When this first element is
False , the second element will be None
if the particle's occurrence requirements have been met, and is
an instance of MissingElementError if the observed
number of terms is less than the minimum occurrence count.
Depending on context, the caller may raise this exception, or may
try an alternative content model.
- Raises:
pyxb.UnexpectedElementError - if the value satisfies the particle, but having done so exceeded
the allowable number of instances of the term.
|