1
Automation Interface, Add-Ins and Tools / Generate XSDcomplexType with simpleContent
« on: July 04, 2015, 03:35:02 am »
Hi
Is anyone aware of how to generate XSDcomplexType with simpleContent extending an XSD built-in type such as xs:string, without creating an underlying XSDsimpleType ?
In our xsd file to be produced, we wish to have an XSDcomplexType with simpleContent and extension base = xs:string. If we were extending an XSDsimpleType, we would in the EA XSD model create a Generalization with stereotype of XSDExtension between the two. However when wanting to extend an XSD built-in type, we don’t have an artefact to point the Generalization to. EA offers a package with simple types representing the xsd built-in types. We tried to point the generalization to the simple type ‘String” in that package, but the xsd generator would then generate an extension base =”string” with string being a simple type that it also generates into the xsd file. This is not what we want, because we want an extension directly on the built-in type, without an artificial simple type string. Below is the xsd code we want to achieve.
<xs:complexType name="FreeTextType">
<xs:annotation>
<xs:documentation xml:lang="en">Textual information to provide descriptions and/or additional information.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="LanguageGroup"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Is anyone aware of how to generate XSDcomplexType with simpleContent extending an XSD built-in type such as xs:string, without creating an underlying XSDsimpleType ?
In our xsd file to be produced, we wish to have an XSDcomplexType with simpleContent and extension base = xs:string. If we were extending an XSDsimpleType, we would in the EA XSD model create a Generalization with stereotype of XSDExtension between the two. However when wanting to extend an XSD built-in type, we don’t have an artefact to point the Generalization to. EA offers a package with simple types representing the xsd built-in types. We tried to point the generalization to the simple type ‘String” in that package, but the xsd generator would then generate an extension base =”string” with string being a simple type that it also generates into the xsd file. This is not what we want, because we want an extension directly on the built-in type, without an artificial simple type string. Below is the xsd code we want to achieve.
<xs:complexType name="FreeTextType">
<xs:annotation>
<xs:documentation xml:lang="en">Textual information to provide descriptions and/or additional information.</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="LanguageGroup"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>