简体   繁体   中英

Can I use EMF/ECore for XML based models?

EMF has support for XSD through Ecore to XSD import export capability, but I have a use case that requires continuous switch between the two domains.

I have a set of published XSD schemas, and various software that consumes XML that is compatible with this schema. I want to build a tooling layer on top of this using EMF, and I can create Ecore models from the XSD. However, after Ecore based tooling creates outputs, I need to create say new schemas, which use the types from schemas used at the beginning, that is:

XSD -> ECORE -> Modified XSD -> XML

I also need to consume XML that is compatible with these schemas, in my EMF based tools, that is

XML (compatible with original schema) -> ECORE -> XML (again compatible with original schema)

Looking at the discussions around the web, I have a feeling that this route may not be possible, at least not directly. Do you see this overall goal feasible? What kind of modifications etc would be necessary to implement this? I can not move all the modelling to EMF, since the rest of the world is going to stay in XSD domain, but I could really benefit from EMF tooling, and linking that to XSD world.

I now know that this is possible. Ed Merks has kindly answered this question here: http://www.eclipse.org/forums/index.php/m/825082/#msg_825082

Basically you have to use the right resource factory implementation to make sure that metadata from the xsd is used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM