- From: Jeremy Vander Kam <jvanderkam@mail.arc.nasa.gov>
- Date: Fri, 15 Nov 2002 11:27:19 -0500
- To: xmlschema-dev@w3.org
Hi, I have the following schema: <xsd:complexType name="AEEAggregation"> <xsd:choice> <xsd:sequence> <xsd:element name="Coefficients" type="AEEGroup"/> <xsd:element name="WeightEquation" type="AEEEquation"/> <xsd:element name="Weight" type="AEEDouble"/> <xsd:element name="WeightUpperLimit" type="AEEDouble" minOccurs="0"/> <xsd:element name="WeightLowerLimit" type="AEEDouble" minOccurs="0"/> <xsd:element name="ReferenceWeight" type="AEEDouble" minOccurs="0"/> <xsd:element name="CenterOfGravity" type="AEEArray" minOccurs="0"/> <xsd:element name="MomentOfInertia" type="AEEArray" minOccurs="0"/> <xsd:element name="Mass" type="AEEDouble" minOccurs="0"/> <xsd:element name="MERReference" type="AEESimpleVariable" minOccurs="0"/> </xsd:sequence> <xsd:sequence> <xsd:element name="Coefficients" type="AEEGroup"/> <xsd:element name="Equation" type="AEEEquation"/> <xsd:element name="EquationValue" type="AEEString"/> <xsd:element name="Reference" type="AEESimpleVariable" minOccurs="0"/> </xsd:sequence> </xsd:choice> <xsd:attribute name="name" use="required"/> </xsd:complexType> And the following XML where Aggregation is of the type AEEAggregation from above: <Aggregation name="massRatio"> <Coefficients> <gross>string</gross> <propellant>string</propellant> </Coefficients> <Equation>gross/(gross-propellant)</Equation> <EquationValue>9999</EquationValue> </Aggregation> I get the following validation error: [Error] AEE_data_021115.xml:14440:129: cvc-complex-type.2.4.a: Invalid content starting with element 'Equation'. The content must match '((("":Coefficients),("":WeightEquation),("":Weight),("":WeightUpperLimit){0-1},("":WeightLowerLimit){0-1},("":ReferenceWeight){0-1},("":CenterOfGravity){0-1},("":MomentOfInertia){0-1},("":Mass){0-1},("":MERReference){0-1})|(("":Coefficients),("":Equation),("":EquationValue),("":Reference){0-1}))'. Now, it seems to me that my XML is valid based on the choice between the two sequences. In fact, if I reverse the order of the sequences in the schema document, I get the same error for all my Aggregation elements that implement the second sequence in the xsd:choice element. This behavior seems like a bug in the validation to me. The validation done in XMLSpy (I don't know which parser they use) accepts things just fine with the exact same schema and xml. Has anyone seen this type of behavior? Have any suggestions? Thanks -Jeremy
Received on Friday, 15 November 2002 11:30:32 UTC