Book a Demo

Author Topic: XSD Generation optional relations  (Read 4103 times)

jdrake

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
XSD Generation optional relations
« on: January 28, 2005, 08:05:38 am »
I have two classes and one of them has a 0 to many relation to the other.
For example two classes Lot and Components. If we have no components I do not want the Components element to show up at all "Components minOccurs=0". However I have not found a way to do it.

<xs:complexType name="Lot">
<xs:all>
<xs:element name="Components">
<xs:complexType>
<xs:sequence>
<xs:element ref="Component" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>