Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ecore model from a XML model - not a XML Schema!
icon9.gif  Ecore model from a XML model - not a XML Schema! [message #495590] Thu, 05 November 2009 12:51 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 9
Registered: November 2009
Junior Member
Hello folks!

I'm a beginner in ATL, so I'm having a little trouble...
I have a XML file and my goal is to make an ATL Transformation that uses it as an entry model. This XML file conforms to a specific XML Schema.
To reach my goal I need to obtain an entry Ecore metamodel for my entry model, that is, for the XML file. I thought that it would be enough to generate an Ecore metamodel from the XML Schema, so I created an EMF Project, and choosed to obtain my Ecore metamodel from my XSD. Then, when I tried to run my ATL transformation using the entry metamodel that I got and the XML file as an entry model, it didn't work: there was no conformity between the entry model and metamodel!

Is the only solution to make a transformation in my entry model (the XML file) to get a new entry model that conforms with the metamodel generated based in the XSD, or is there an easier way to use directly my XML file as an entry model in my ATL Transformation? I.e., do I need to transform my XML file and then use the result in my ATL Transformation, or do I need to change the metamodel that I got so that the conformity model-metamodel is satisfied?

Please help!
Thank you a lot!!!

Ana
Re: Ecore model from a XML model - not a XML Schema! [message #495611 is a reply to message #495590] Thu, 05 November 2009 14:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Ana,

Comments below.

aninha.mainhardt@gmail.com wrote:
> Hello folks!
>
> I'm a beginner in ATL, so I'm having a little trouble... I have a XML
> file and my goal is to make an ATL Transformation that uses it as an
> entry model. This XML file conforms to a specific XML Schema. To reach
> my goal I need to obtain an entry Ecore metamodel for my entry model,
> that is, for the XML file. I thought that it would be enough to
> generate an Ecore metamodel from the XML Schema, so I created an EMF
> Project, and choosed to obtain my Ecore metamodel from my XSD. Then,
> when I tried to run my ATL transformation using the entry metamodel
> that I got and the XML file as an entry model, it didn't work: there
> was no conformity between the entry model and metamodel!
Not sure what you mean, but it's important to use the resource factory
that's generated for the model, or at least a resource configured with
the options in the generated factory.
>
> Is the only solution to make a transformation in my entry model (the
> XML file) to get a new entry model that conforms with the metamodel
> generated based in the XSD, or is there an easier way to use directly
> my XML file as an entry model in my ATL Transformation? I.e., do I
> need to transform my XML file and then use the result in my ATL
> Transformation, or do I need to change the metamodel that I got so
> that the conformity model-metamodel is satisfied?
It seems likely that your transformation will best expressed against an
Ecore model that corresponds to the schema.
>
> Please help! Thank you a lot!!!
>
> Ana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
icon5.gif  Re: Ecore model from a XML model - not a XML Schema! [message #495644 is a reply to message #495611] Thu, 05 November 2009 15:27 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 9
Registered: November 2009
Junior Member
Hello Ed,

Sorry, but I'm not used to this terminology because I don't have such familiarity with this subject, and so I don't understand what you mean with "resource factory"...
What I have is a XML file and its corresponding XML Schema. I want to use this XML file as entry model for an ATL Transformation. Is it possible for me to use exactly the same XML file in the ATL Transformation, and an Ecore metamodel obtained from the XML Schema, or do I need to modify the XML file before??
(I don't know if I have made myself clear enough this time)

Thank you in advance

Ana
Re: Ecore model from a XML model - not a XML Schema! [message #495703 is a reply to message #495644] Thu, 05 November 2009 19:35 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Ana,

Comments below.

aninha.mainhardt@gmail.com wrote:
> Hello Ed,
>
> Sorry, but I'm not used to this terminology because I don't have such
> familiarity with this subject, and so I don't understand what you mean
> with "resource factory"...
Reading some of the introductory material will prove valuable then.
> What I have is a XML file and its corresponding XML Schema. I want to
> use this XML file as entry model for an ATL Transformation. Is it
> possible for me to use exactly the same XML file in the ATL
> Transformation, and an Ecore metamodel obtained from the XML Schema,
> or do I need to modify the XML file before??
Yes, I believe so. Best to ask about ATL on the ATL newsgroup though.
If you've generated the EMF model for your schema, try invoking
"Generate Test Code..." and look in the *.tests project for
XyzExample.java (with Xyz depending on the name of your model). That
shows how to load and save instances according to your schema.
> (I don't know if I have made myself clear enough this time)
>
> Thank you in advance
>
> Ana
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Resource doesn't exist
Next Topic:EMF commands during model import
Goto Forum:
  


Current Time: Thu Apr 18 23:31:16 GMT 2024

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

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

Back to the top