|
Re: Ecore genaration via xsd have some problems. [message #774261 is a reply to message #774172] |
Tue, 03 January 2012 15:59 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Comments below.
On 03/01/2012 1:12 PM, kalpa Mising name wrote:
> hi,
>
> if I use ComplexType to describe element
> <xs:element name="property">
> <xs:complexType ecore:name="ConfigurationProperty">
> <xs:simpleContent>
> <xs:extension base="xs:string">
> <xs:attribute name="name" type="xs:string" use="required" />
> </xs:extension>
> </xs:simpleContent>
> </xs:complexType>
> </xs:element>
> generated Ecore contains entity like below.As a EClass.
>
>
> If I use SimpleType to describe the element
> <xs:element name="description" minOccurs="0" maxOccurs="1">
> <xs:simpleType>
>
> <xs:restriction base="xs:string"/>
>
> </xs:simpleType>
> </xs:element>
>
> EMF take it as EDataType
>
> but if I use just element.
> <xs:element name="description" type="xs:string" minOccurs="0"
> maxOccurs="1">
>
> I can not refer that element generated ecore dose not contains only is
> as a attribute of the parent element.But i want it as a Entity as in
> the first picture because I am using EMFText for define some DSL but
> in the rule definition I can not refer those "elements" because they
> not have real reference in the .genmodle. what do i do for this.is
> some thing wrong with my usage.?
So the first approach is the one you should take. I.e., if you want an
EObject that holds the value, you have to use a complex type, not a
simple type.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03688 seconds