Book a Demo

Author Topic: XSD Generation Problem  (Read 4560 times)

Christian.Hinken

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
XSD Generation Problem
« on: November 01, 2006, 09:26:36 am »
Hello there,

I have a problem generating an xsd schema:

For an element that can occur more than once (tagged value minOccurs 0, maxOccurs unbounded), the following XSD is generated:

Code: [Select]


<xs:complexType name="...">


<xs:sequence>



<xs:element ref="Benutzer" minOccurs="0" maxOccurs="unbounded">...


</xs:element>



However, no element for "Benutzer" is generated, only the following SimpleType:

Code: [Select]

<xs:simpleType name="Benutzer">


<xs:restriction base="xs:string"/>

</xs:simpleType>


For SimpleTypes, no elements are generated. How can I tell EA to generate an Element for a SimpleType OR change the reference "ref=" to "type=" in the definition of the complex type?

Thanks for the help,

         Christian.

bennido

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: XSD Generation Problem
« Reply #1 on: November 01, 2006, 04:42:27 pm »
Quote
Hi Christian,

EA does automatically generate the "type=" in the definition of the complex type.

If you create a Complex Type class associated with a Simple Type class, you should get the following XSD which I think is what you are looking for.

Code: [Select]
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Test" type="Test"/>
<xs:complexType name="Test">
<xs:sequence>
<xs:element name="Benutzer" type="Benutzer" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="Benutzer">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>

If you can post a link to your UML model image somewhere, I'll see if I can help you.

On your other question about the Simple Type global element, I agree with you. In a Garden Of Eden design pattern, a global element should be generated for the simple type and I can't seem to find a way to force EA to do it either.

Perhaps a bug ?



Christian.Hinken

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: XSD Generation Problem
« Reply #2 on: November 02, 2006, 02:56:24 am »
Hello bennido,

here is an image of the model:



Does this help?

Thanks in advance,

     Christian.