寻找JavaScript XML差异工具 [英] Looking for a JavaScript XML diff tool

查看:46
本文介绍了寻找JavaScript XML差异工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在面临的任务如下:我有两个XML文件,它们的结构和内容可能略有不同。两种XML均由同一XSD验证。我需要创建另一个XML文件,该文件将成为XSL转换的基础,并允许在XSL转换输出中同时提供元素的旧值和新值。

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.

想法是创建一个新的xml,该XML将在 @diff 属性中包含旧元素值。因此,我尝试使用XSL来实现这一点,但是失败了,因为我不知道如何处理缺少的元素情况。

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.

现在,我决定回退到可以生成JavaScript的JavaScript对我来说,这个新的XML。因此,我正在寻找可以根据需要使用或修改的XML差异库。我正在考虑将XSD用作比较任务的基础。 (在这种情况下有可能摆脱它吗?)

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.

推荐答案

尝试查看漂亮差异。它声称具有语言意识并支持XML。

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

这篇关于寻找JavaScript XML差异工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆