Hi, The problem is if we use simple element in the schema ,in the generated model it represent as a attribute of the parent element.It is totally fine with the normal use case of the EMF.But now we are up to make an DSL(Domain Specific Language) based editor for .dbs.For that we are using EMFText as the rule defining tool. It needs some additional details about EObject. EAttribute can not provide that details to the EMFText context.
I have asked about this with proper schema snippets in the eclipse community forum.According to the response they have recommended to use ComplexType definition for those elements which we want to have hold some value when the model up and running.If this is an unwanted over head for the .dbs schema we can make these changes to project local copy of the schema and I can document about what we have done. Thanks, On Wed, Jan 4, 2012 at 9:27 AM, Prabath Abeysekera <[email protected]>wrote: > Hi, > > I've updated the dataservices configuration schema with the changes > required to eliminate the reported two issues. But I was confronted with > another issue as EMF model generation wizard does not seem to generate the > required mappings properly against simple elements defined in the schema. > IMO, this could be an issue in the EMF model generation process. Kalpa is > currently working on communicating this to the EMF mailing lists to get it > further clarified. > > However, we could get rid of this by adding simpleType definitions to each > of the simpleElements. [1] also provides some insights into this and > recommends that particular approach. IMO, this wouldn't do any harm to the > existing definitions as the recommended approach is just another > representation of the same element. Just thought of getting some feedback > on it before we further proceed. > > The original element definition and the modified element definition (to > get it to work with EMF model generation) are listed below. > > Original Element > ============== > <xs:element name="description" type="xs:string" maxOccurs="1" > minOccurs="0"/> > > Modified element > =============== > <xs:element name="description" maxOccurs="1" minOccurs="0"> > <xs:simpleType> > <xs:restriction base="xs:string"/> > </xs:simpleType> > </xs:element> > > > [1] > http://www.eclipse.org/modeling/emf/docs/overviews/XMLSchemaToEcoreMapping.pdf > > > Regards, > Prabath > > On Wed, Dec 21, 2011 at 1:07 PM, Prabath Abeysekera <[email protected]>wrote: > >> Hi Kalpa, >> >> We'll have a look. >> >> On Wed, Dec 21, 2011 at 12:41 PM, Kalpa Senanayake <[email protected]>wrote: >> >>> Hi All, >>> >>> While trying to generate the EMF model for the updated .dbs schema >>> following things were found. >>> >>> 1. <xs:element name="call-query"> appear in >>> <result>,<operation>,<resource> tag definitions with the same definition >>> while previous schema clearly define >>> it separately and referenced on relevant positions well. >>> >>> Problem :- When generating ecore model it defines CallQueryType1 , >>> CallQueryType2 ext.. >>> >>> 2. In most of the cases content based restrictions are not there >>> for an example In previous schema >>> >>> <xs:element >>> name="property" maxOccurs="unbounded" minOccurs="1"> >>> <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> >>> >>> but in updated schema >>> >>> <xs:element name="property" >>> maxOccurs="unbounded" minOccurs="1" /> >>> >>> Problem :- In the ecore model, the class reffered to those >>> configurations are not defined with data types with true meaning. Because >>> of not well defined content types >>> EMF defines "AnySimpleType" but it is not acceptable >>> when we are in the EMF context. >>> >>> Please have a look. >>> >>> Thanks, >>> Kalpa. >>> >> >> >> >> -- >> Prabath Abeysekara >> Software Engineer >> WSO2 Inc. >> Email: [email protected] <[email protected]> >> Mobile: +94774171471 >> >> <http://harshana05.blogspot.com/> >> >> > > > -- > Prabath Abeysekara > Software Engineer > WSO2 Inc. > Email: [email protected] <[email protected]> > Mobile: +94774171471 > > <http://harshana05.blogspot.com/> > > -- Kalpa Senanayake. Software Engineer, WSO2,Inc :(http://wso2.com/). email : [email protected] mobile : +94783864128 blog : (http://kalpads.wordpress.com/) Lean . Enterprise . Middleware
_______________________________________________ Carbon-dev mailing list [email protected] http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
