Book a Demo

Author Topic: XSD Template: Generation of ref element  (Read 3289 times)

Stephanie

  • EA User
  • **
  • Posts: 40
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
XSD Template: Generation of ref element
« on: August 17, 2007, 07:26:52 am »
Hi,

I would like to do a XSD-transformation of an 1:N association from class A to class B .

For this association a ref element should be created in the describtion of class A with the attributes minOccurs, and maxoccurs set according to the multiplicity of the association ends.

This is what I expect:


<xs:complexType name="ClassA">
 <xs:complexContent>
   <xs:sequence>
     <xs:element ref="ClassB" minOccurs="1"  maxOccurs="unbounded"/>
   </xs:sequence>
  </xs:complexContent>
 </xs:complexType>

Instead I get:        

<xs:complexType name="ClassA">
 <xs:complexContent>
  <xs:sequence>
    <xs:element name="ClassB" type="ClassB" minOccurs="1" maxOccurs="unbounded"/>
   </xs:sequence>
 </xs:complexContent>
</xs:complexType>

What I want is what has been presented in the XSD TRANSFORMATION help section, but to me it seems that EA actually behaves differently (?)

I am willing to write my own custom XSD transformation template to generate the addition ref element in classA, but   I don't know how to do that. I can only determine the multiplicity of a class when transforming the connectors, but how can I add an attribute (the ref element) to a class at that time?

Any help is appreciated! I guess this is a well known problem.
« Last Edit: August 17, 2007, 07:30:50 am by Stephanie »