开发者

Writing a format updater in java?

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜