Ecore model from a XML model - not a XML Schema! [message #495590] |
Thu, 05 November 2009 12:51 |
Missing name Missing name 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 |
Ed Merks 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/
|
|
|
|
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 |
Ed Merks 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/
|
|
|
Powered by
FUDForum. Page generated in 0.01590 seconds