我可以将 EMF/ECore 用于基于 XML 的模型吗?
EMF 通过 Ecore 到 XSD 导入导出功能支持 XSD,但我有一个用例需要在两个域之间连续切换。
我有一组已发布的 XSD 架构,以及使用与该架构兼容的 XML 的各种软件。我想使用 EMF 在此之上构建一个工具层,并且我可以从 XSD 创建 Ecore 模型。然而,在基于 Ecore 的工具创建输出之后,我需要创建新的模式,它使用开始时使用的模式中的类型,即:
XSD ->生态->修改后的XSD-> XML
我还需要在我的基于 EMF 的工具中使用与这些模式兼容的 XML,即
XML(与原始模式兼容)->生态-> XML(再次与原始模式兼容)
看看网络上的讨论,我有一种感觉,这条路线可能不可能,至少不能直接实现。您认为这个总体目标可行吗?需要进行什么样的修改等才能实现这一点?我无法将所有建模移至 EMF,因为世界其他部分将保留在 XSD 域中,但我确实可以从 EMF 工具中受益,并将其链接到 XSD 世界。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在知道这是可能的。 Ed Merks 在这里友好地回答了这个问题: http://www.eclipse .org/forums/index.php/m/825082/#msg_825082
基本上,您必须使用正确的资源工厂实现来确保来自 xsd 的元数据被使用。
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.