EMF - load an XML file and create model at runtime

331 Views Asked by At

the problem is the following: i have an XML file generated by an external tool and i also have an ecore file. Using EMF i want to load this XML file, parse it and create (at runtime) a new model following the structure described in the ecore file. Is this possible? How can i do it?

1

There are 1 best solutions below

1
On

This is possible, but I am not sure what you are expecting from your question. You want to parse your XML file (which you can do using a variety of XML parsers which exist), and you want to create an EMF model using the generated Java API (see https://www.vogella.com/tutorials/EclipseEMF/article.html#using-the-model-code).