Looking for a JavaScript XML diff tool [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-11 07:57:45

问题


The task I'm facing right now is the following: I have two XML files, which may slightly differ in structure and contents. Both XMLs are validated by the same XSD. I need to create another XML file that will be the base for an XSL transformation and will allow to provide both old and new values of elements in the XSL transformation output.

The idea is to create a new xml which will contain the old element values in a @diff attribute. So I tried to implement this using XSL, but failed because I don't know how to handle the missing element cases.

Now I decided to fallback to JavaScript that would produce this new XML for me. So I'm looking for an XML diff library that may be used or modified for my needs. I'm thinking about using the XSD as a base for the comparison task. (Is it possible to get rid of it in this case?)

If you have any ideas of how this can be solved in a different way, I'll be glad to see them too.


回答1:


Try looking at Pretty Diff. It claims to be language aware and support XML.



来源:https://stackoverflow.com/questions/12896524/looking-for-a-javascript-xml-diff-tool

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!