hi ..

i'm currently working with xml-beans and i found some "strange" behaviour:

<xsd-snip>
<xs:element name="property">
       <xs:complexType>
           <xs:choice>
<xs:element ref="value" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="element" minOccurs="0" maxOccurs="unbounded"/>
           </xs:choice>
       </xs:complexType>
</xs:element>
</xsd-snip>

i had this before and found out, that i only need one value/property, so i changed to xsd to

<xsd-snip>
<xs:element name="property">
       <xs:complexType>
           <xs:choice>
               <xs:element ref="value" minOccurs="0" maxOccurs="1"/>
<xs:element ref="element" minOccurs="0" maxOccurs="unbounded"/>
           </xs:choice>
       </xs:complexType>
</xs:element>
</xsd-snip>

as promised, all the getValueList / getValueArray disappeared but the strange thing is, that this code is still valid:

PropertyDocument.Property p1 = a1.addNewProperty();
ValueDocument.Value v1 = p1.addNewValue();
v1.setStringValue("my new TITLE");
ValueDocument.Value v2 = p1.addNewValue();
v2.setStringValue("my new TITLE sec value");

i expected the second p1.addNewValue() to throw an Exception. also, if i run the validate() method on the xml-objects, everythings
seems to be ok, although the document should be invalid (by xsd-definition)

any ideas?

thx, sascha

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to