I've asked for priority support on this but have not received any response from Sparx yet. Anyone have any ideas?
I’ve been struggling with a problem I don’t seem to be able to resolve. Here’s the behavior. I can import a XSD file that is valid (It validates in other tools) and which reports no errors on import (see xml below). However, when I generate the XSD from exactly the same package that results from the import, EA hits one of the top element definitions and errors, reporting this message --> [Checking Class: ValidUser ... Invalid connections found, these will be ignored].
The problem occurs when the XSD defines a simpleType with enumerations (shown below). It imports the relationship between the XSDsimpleType (in this case YesOrNo) and the XSDtopLevelElement as a generalisation. EA doesn’t seem to be able to handle an association of an enumeration type with a top level element. Can you advise if this a bug, if there is a work around that will allow this to work, or any other alternative? This seems like it should be basic XML, Schema capability but maybe its the way it needs to be modeled? I could really use this ASAP. I spent quite a bit of time trying to determine the problem.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="
http://xyz.com/RD/BaseTypes/BaseType/v1" xmlns="
http://xyz.com/RD/BaseTypes/BaseType/v1" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" version="1.0">
<xsd:simpleType name="Text-1">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Text-3">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Text-4">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Text-5">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Text-6">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="Text-8">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="YesOrNo">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3"/>
<xsd:enumeration value="Yes"/>
<xsd:enumeration value="No"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="
http://xyz.com/RD/Services/Sample/v1" xmlns:base="
http://xyz.com/RD/BaseTypes/BaseType/v1" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns="
http://xyz.com/RD/Services/Sample/v1" version="1.0">
<xsd:import namespace="
http://xyz.com/RD/BaseTypes/BaseType/v1" schemaLocation="BaseTypes.xsd"/>
<xsd:element name="ValidUser" type="base:YesOrNo"/>
<xsd:element name="ActiveUser" type="base:YesOrNo"/>
<xsd:element name="UserName" type="base:Text-8"/>
<xsd:complexType name="SampleType">
<xsd:sequence>
<xsd:element ref="ValidUser"/>
<xsd:element ref="ActiveUser"/>
<xsd:element ref="UserName"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
What then gets generated is:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="
http://xyz.com/RD/Services/Sample/v1" xmlns:base="
http://xyz.com/RD/BaseTypes/BaseType/v1" xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns="
http://xyz.com/RD/Services/Sample/v1" version="1.0">
<xsd:import namespace="
http://xyz.com/RD/BaseTypes/BaseType/v1" schemaLocation="BaseTypes.xsd"/>
<xsd:element name="ValidUser"/>
<xsd:element name="ActiveUser"/>
<xsd:element name="UserName" type="base:Text-8"/>
<xsd:complexType name="SampleType">
<xsd:sequence>
<xsd:element ref="ValidUser" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="ActiveUser" minOccurs="1" maxOccurs="1"/>
<xsd:element ref="UserName" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>