用java编写格式更新器?
我有一个应用程序读取输入 xml 文件并构建 emf/ecore 模型(可以存储为 xmi 文件)。
输入格式文件被“锁定”,这意味着文件中尚未定义的新标签、属性等不能出现。但现有标签的数量或属性值可能会发生变化。
现在我想支持以下场景:
1)用户导入xml_01并构建emf模型。
2)用户修改模型并将其存储到磁盘。
3) 用户导入 xml_02,它与 xml_01 几乎相同,但有一些附加节点。
4) 在第二次导入期间,应根据 xml_02 中的附加内容以及向用户报告的可能冲突来更新现有模型。
现在我知道如何开始使用它 - 基本上是从头开始编写更新程序。
但是是否有任何工具/库可以用来帮助编写这种更新程序 - 特别是在修改电动势模型时?
I have an application that reads an input xml file and builds an emf/ecore model (which can be stores as a xmi file).
The input format file is "locked" meaning that no new tags, attributes etc not already defined in the file can appear. But the number of existing tags or values of attributes can change.
Now I would like to support the following scenario:
1) User imports xml_01 and an emf model is build.
2) User modifies the model and store it to disk.
3) User imports xml_02 which is almost identical to xml_01 but with some additional nodes.
4) During the second import the existing model should be updated based on the additional content from xml_02 and possible conflicts reported to the user.
Now I have an idea on how to get started with this - basically writing the updater from scratch.
But are there any tools/libraries that can be used to help writing this kind of updater - especially when it comes to modifying an emf model?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有任何第三方库可以直接执行此操作。但据我了解,您可以使用 SAX 解析器,用于解析 XML 并为所需功能实现您自己的
Handler
。I do not know of any third party libraries that can directly do this. But from what I understand you can use SAX parsers to parse the XMLs and implement your own
Handler
for the required functionality.