xmlclass/xsdschema.py
changeset 674 bbffe4110141
parent 592 89ff2738ef20
child 682 4d437bc0ef3f
equal deleted inserted replaced
673:b686f0081e2b 674:bbffe4110141
   805                     choices_tmp.append(new_choice)
   805                     choices_tmp.append(new_choice)
   806                 else:
   806                 else:
   807                     choices_tmp.append(choice)
   807                     choices_tmp.append(choice)
   808             choices.extend(choices_tmp)
   808             choices.extend(choices_tmp)
   809     
   809     
       
   810     for choice in choices:
       
   811         attributes["minOccurs"] = min(attributes["minOccurs"], choice["minOccurs"])
       
   812         choice["minOccurs"] = 1
       
   813     
   810     return {"type": CHOICE, "choices": choices, "minOccurs": attributes["minOccurs"],
   814     return {"type": CHOICE, "choices": choices, "minOccurs": attributes["minOccurs"],
   811             "maxOccurs": attributes["maxOccurs"], "doc": annotations}
   815             "maxOccurs": attributes["maxOccurs"], "doc": annotations}
   812 
   816 
   813 
   817 
   814 def ReduceSequence(factory, attributes, elements):
   818 def ReduceSequence(factory, attributes, elements):