summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter A. Bigot <pabigot@users.sourceforge.net>2010-05-29 10:26:57 -0500
committerPeter A. Bigot <pabigot@users.sourceforge.net>2010-05-29 10:26:57 -0500
commita87e2c7bb8eb93c4bbf3b653d815f0af8f6683db (patch)
tree602813125520e547fe888ac21ae9204c35aa6e26
parent516c49a62591e0c8d52703e4c8f1f4a32c6e717b (diff)
Allow for the same elt to be accepted by adjacent sequences if the first has a maxOccurs
-rw-r--r--pyxb/binding/content.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pyxb/binding/content.py b/pyxb/binding/content.py
index 89e72e4..a7482ad 100644
--- a/pyxb/binding/content.py
+++ b/pyxb/binding/content.py
@@ -672,9 +672,13 @@ class ParticleState (pyxb.cscRoot):
"""
#print 'PS.STEP %s: %s %s %s' % (self, instance, value, element_use)
- consumed = self.__termState.accepts(self, instance, value, element_use)
- #print 'PS.STEP %s: %s' % (self, consumed)
+
+ # Only try if we're not already at the upper limit on occurrences
+ consumed = False
underflow_exc = None
+ if self.__count != self.__particle.maxOccurs():
+ consumed = self.__termState.accepts(self, instance, value, element_use)
+ #print 'PS.STEP %s: %s' % (self, consumed)
if consumed:
if not self.__particle.meetsMaximum(self.__count):
raise pyxb.UnexpectedElementError('too many')