Book a Demo

Author Topic: XML generation has an issue with simplecontent  (Read 4505 times)

ben123

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
XML generation has an issue with simplecontent
« on: April 28, 2016, 11:33:36 pm »
Hi,

I have an issue with creating compleyTypes with simpleContent in them...

I would like to have the following XML:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Parent" type="Parent"/>
<xs:complexType name="Parent">
<xs:simpleContent>
<xs:extension base="string">
<xs:attribute name="Test" use="optional" type="xs:int"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="Child" type="Child"/>
<xs:complexType name="Child">
<xs:simpleContent>
<xs:extension base="Parent">
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="string">
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>

But I can not get EA 12.1.1227 to do it (or any other version that I tried).

I modeled the following:
http://www.directupload.net/file/d/4339/5jlsnm54_png.htm

I resulted in the following:
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Parent" type="Parent"/>
<xs:complexType name="Parent">
<xs:simpleContent>
<xs:extension base="string">
<xs:attribute name="Test" use="optional" type="xs:int"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="Child" type="Child"/>
<xs:complexType name="Child">
<xs:complexContent>
<xs:extension base="Parent">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:simpleType name="string">
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:element name="NoRealParentAnymore" type="NoRealParentAnymore"/>
<xs:complexType name="NoRealParentAnymore">
<xs:simpleContent>
<xs:extension base="string">
<xs:attribute name="Test1" use="optional" type="xs:int"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element name="ChildWithItOwnAttribute" type="ChildWithItOwnAttribute"/>
<xs:complexType name="ChildWithItOwnAttribute">
<xs:sequence/>
<xs:attribute name="Test1" use="optional" type="xs:int"/>
</xs:complexType>
</xs:schema>

Which is in both cases wrong...

Does anybody have an idea how to model such thing correctly in EA?

Best regards
Ben