Menu

#34 plurality wrong for nested choice model groups

PyXB 0.5.2
closed
None
fixed
Content model
major
PyXB 0.5.1
defect
2009-07-22
2009-07-21
No

In the following schema (abstracted from wfs:FeatureTypeType), PyXB 0.5.1 incorrectly determines that "a" can appear multiple times.

<xs:complexType name="ftt">

<xs:sequence>

<xs:element name="a"/>
<xs:choice>

<xs:element name="b"/>
<xs:element name="c"/>

</xs:choice>

</xs:sequence>

</xs:complexType><

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2009-07-21

    In the definition of _ _ fromModelGroup around line 940 of xmlschema/structures.py, change the branch for ModelGroup.C_CHOICE to read:

    union_map = { }
    for pd in pdll:

    for pdm in pd:

    union_map = self._MapUnion(union_map, pdm)

    self.append(union_map)

    i.e. create one union map over all possible documents rather than one for each set of documents.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-07-22
    • status changed from new to closed
    • resolution set to fixed

    Previous suggestion works for the specific case, but still isn't right. Full solution is more complex and will be in 0.5.2.

     
MongoDB Logo MongoDB