I need to convert an XML to java object and in turn convert the java object to EMF EObject. Please help me out.
Asked
Active
Viewed 551 times
0
-
Did you read [this](http://stackoverflow.com/questions/3276149/converting-xml-to-java-objects) and [that](http://stackoverflow.com/questions/11221136/convert-xml-to-java-object-using-jaxb-unmarshal)? – Christian St. Mar 14 '14 at 11:28
-
Hello @user3152686, and welcome to Stack Overflow! We encourage users to share as much of their own research as possible. This will allow people to answer your question in a much more detailed way. What have you tried? Where did you look? I know the EMF documentation is _massive_, but please try to show us what you have already learnt so far. – parasietje Mar 14 '14 at 11:29
-
See http://stackoverflow.com/questions/2543987/how-to-use-emf-to-read-xml-file. Please note that you should probably learn about EMF first, before trying to parse XML into EMF Java objects. – parasietje Mar 14 '14 at 11:30
1 Answers
0
Please note that EMF (Eclipse Modeling Framework) unifies: Java, XML, and UML. You can think of it as in the picture below:
Therefore, it is possible to convert the implementation of your model in XML into EMF model directly. Be aware to use the right syntax for the definition of your model in XML (or at least change it appropriately). Take a look at this as a reference, section XML Schema:
XML model in EMF syntax reference
You need to have EMF installed in Eclipse to do this.

ΦXocę 웃 Пepeúpa ツ
- 47,427
- 17
- 69
- 97

userOverflow
- 33
- 1
- 4