xmlclass/xsdschema.py
changeset 1856 c2cba67145eb
parent 1853 47a3f39bead0
child 1872 866fb3ab8778
equal deleted inserted replaced
1855:f33942053466 1856:c2cba67145eb
   150     annotations, children = factory.ReduceElements(elements)
   150     annotations, children = factory.ReduceElements(elements)
   151     union = {"type": "union", "memberTypes": attributes.get("memberTypes", []), "doc": annotations}
   151     union = {"type": "union", "memberTypes": attributes.get("memberTypes", []), "doc": annotations}
   152 
   152 
   153     for child in children:
   153     for child in children:
   154         if child["type"] == SIMPLETYPE:
   154         if child["type"] == SIMPLETYPE:
   155             union["memberTypes"].appendchild
   155             union["memberTypes"].append(child)
   156     if len(union["memberTypes"]) == 0:
   156     if len(union["memberTypes"]) == 0:
   157         raise ValueError("No base type has been defined for union!")
   157         raise ValueError("No base type has been defined for union!")
   158     return union
   158     return union
   159 
   159 
   160 
   160