When I define a Multiplicity (Lower and Upper bound) on (basic) XSDElements these are converted to minOccurs and maxOccurs, as expected, when exporting to a XML Schema.
However when I try to do the same for elements that actually consist of a complexType I can't seem to find an option to set these attributes (minOccurs and maxOccurs).
I have tried to do this with Cardinality but this doesn't seem to have any effect when generating an XML Schema.
Does anyone have a suggestion to realise this?
For illustration I want to show you the below XML fragment:
<xs:schema id="NewDataSet" targetNamespace="" xmlns:mstns="" xmlns="" xmlns:xs="
http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:element name="ROOT">
-<xs:complexType>
--<xs:sequence>
---<xs:element name="TREE" minOccurs="0" maxOccurs="unbounded">
----<xs:complexType>
-----<xs:sequence>
------<xs:element name="LEAF" minOccurs="0" maxOccurs="unbounded">
-------<xs:complexType>
--------<xs:sequence>
---------<xs:element name="ELEMENT1" type="xs:string" minOccurs="0" />
----------<xs:element name="ELEMENT2" type="xs:string" minOccurs="0" />
---------</xs:sequence>
--------<xs:attribute name="Name" form="unqualified" type="xs:string" />
-------</xs:complexType>
------</xs:element>
-----</xs:sequence>
-----<xs:attribute name="Name" form="unqualified" type="xs:string" />
----</xs:complexType>
---</xs:element>
--</xs:sequence>
--<xs:attribute name="Name" form="unqualified" type="xs:string" />
-</xs:complexType>
</xs:element>
</xs:schema>
For ELEMENT1 and ELEMENT2 I have defined a multiplicity in EA and I get the above minOccurs and maxOccurs, that is what I want.
I have been trying to get the same thing for ROOT, TREE and LEAF as illustrated above, but can't seem to find the option in EA to get this when exporting the diagram to an XML Schema. Defining a cardinality between ROOT and LEAF etc. didn't work, neither did adding a Tagged Value for these elements.
Now that I mention it, when importing XSD's into EA minOccurs and maxOccurs attributes are lost, always. Is this a known bug or is there an obvious solution that I am missing?
Thanks in advance for any help and suggestions