Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » XSD generation from ecore
XSD generation from ecore [message #836637] Wed, 04 April 2012 18:26 Go to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi All,

I have been trying to generate XSD from ecore.

One confusion which i am coming across is generation of references.
The references in the ecore model are getting generated as attributes with ecore:reference having the type information. Then if it is a list it is coming as a xsd:list with anytype within the xsd:simpletype tags.

Whereas i would like to have the references generated as elements.

Am i missing something here ?

cheers,
Saurav


Re: XSD generation from ecore [message #836691 is a reply to message #836637] Wed, 04 April 2012 19:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Saurav,

Comments below.

On 04/04/2012 8:26 PM, saurav sarkar wrote:
> Hi All,
>
> I have been trying to generate XSD from ecore.
>
> One confusion which i am coming across is generation of references.
> The references in the ecore model are getting generated as attributes
> with ecore:reference having the type information.
Yes, for non-containment references...
> Then if it is a list it is coming as a xsd:list with anytype within
> the xsd:simpletype tags.
I would expect anyURI not anyType...
>
> Whereas i would like to have the references generated as elements.
You can use extended meta data annotations to specify they be elements,
but they'll still be of type anyURI with ecore:reference for
non-containment reference.
>
> Am i missing something here ?
It might just be an issue of expectations verses how non-containment
references must be specified in a schema.
>
> cheers,
> Saurav


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD generation from ecore [message #836715 is a reply to message #836691] Wed, 04 April 2012 20:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

On 04/04/2012 20:54, Ed Merks wrote:
> Saurav,
>
>> Whereas i would like to have the references generated as elements.
> You can use extended meta data annotations to specify they be
> elements, but they'll still be of type anyURI with ecore:reference for
> non-containment reference.
EMF's Ecore to XSD capabilities are powerful but need some skill to get
right.

You may find it easier to produce a simple test XSD that demonstrates
your required style and then load/convert that to Ecore to discover the
appropriate annotations to achieve that style.

Regards

Ed Willink
Re: XSD generation from ecore [message #837115 is a reply to message #836715] Thu, 05 April 2012 09:35 Go to previous messageGo to next message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Thanks a lot both the Eds for the help Smile.

Makes perfect sense to have non -containment reference generated like that.

I checked by adding the metadata annotations that helps me to generate them as elements, so that solve some of my problems.

I would just go back to my original problem i.e. the above mentioned ecore files were originally generated from the Ration Rose (.mdl) files.

There i found some relationships which i thought should have had come as containment as true are instead coming as false.
I tried to decipher the .mdl files in the notepad++ but could not gather much Smile.

Any hints on this would be hugely appreciated?

cheers,
Saurav


Re: XSD generation from ecore [message #837164 is a reply to message #837115] Thu, 05 April 2012 10:44 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
Saurav,

The rose files are really not so human readable. In the diagrams it
would be clear whether you have a black diamond or not. Of course you
can edit the *.ecore to change anything to whatever you want.


On 05/04/2012 11:35 AM, saurav sarkar wrote:
> Thanks a lot both the Eds for the help :).
>
> Makes perfect sense to have non -containment reference generated like
> that.
>
> I checked by adding the metadata annotations that helps me to generate
> them as elements, so that solve some of my problems.
>
> I would just go back to my original problem i.e. the above mentioned
> ecore files were originally generated from the Ration Rose (.mdl) files.
>
> There i found some relationships which i thought should have had come
> as containment as true are instead coming as false.
> I tried to decipher the .mdl files in the notepad++ but could not
> gather much :).
>
> Any hints on this would be hugely appreciated?
>
> cheers,
> Saurav


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSD generation from ecore [message #837200 is a reply to message #837164] Thu, 05 April 2012 11:40 Go to previous message
saurav sarkar is currently offline saurav sarkarFriend
Messages: 428
Registered: July 2009
Senior Member
Hi Ed,

Yes the problem now is that we don't own the rational rose license now.
So its a foregone story now Smile.
Yes now i would have to modify the ecore.

Thanks for the reply.
cheers,
Saurav


Previous Topic:efficient strategy to avoid too many transaction.commit()
Next Topic:Generating proper TestSuites, at least one operation needed
Goto Forum:
  


Current Time: Thu Mar 28 18:23:29 GMT 2024

Powered by FUDForum. Page generated in 0.04368 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top