I have an XMLSchema grammar which has the following construct:

 (Add | Remove)+

meaning that the Add and Remove can appear in any order and in any
number as
long as at least one does appear. In XMLSchema this can be represented
as:

<xsd:sequence maxOccurs="unbounded">
<xsd:choice>
<xsd:element name="add" type="xx:Add"/>
<xsd:element name="remove" type="xx:Remove"/>
</xsd:choice>
</xsd:sequence>

or as:

<xsd:sequence>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="add" type="xx:Add"/>
<xsd:element name="remove" type="xx:Remove"/>
</xsd:choice>
</xsd:sequence>

(one can also add maxOccurs="unbounded" to the Add and Remove elements)

wsdl2java seems to simply ignore the maxOccurs attribute in the sequence
or choice element.
Is this known that this does not work?

If I use the construct:


<xsd:sequence>
<xsd:choice>
<xsd:element name="add" type="xx:Add" maxOccurs="unbounded"/>
<xsd:element name="remove" type="xx:Remove" maxOccurs="unbounded"/>
</xsd:choice>
</xsd:sequence>

Then the Java code assumes that I want arrays of Add's and Remove's -
which I assume that I can
not have an instance grammar where the Add and Removes, for example,
alternate their appearence:

<Add> ... </Add>
<Remove> ... </Remove>
<Add> ... </Add>
<Remove> ... </Remove>


How do I implement my (Add | Remove)+ grammar element so that wsdl2java
will
recognize it?

Thanks

Richard

Reply via email to