如何比较XML文件和突出显示差异 [英] How to compare XML files and highlight differences

查看:106
本文介绍了如何比较XML文件和突出显示差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我们可以帮助我如何比较两个XML文件广告突出文件的差异,我只想要输出如下,可以告诉我除XMLDiff之外的任何API使用



ActualFile:



Hello can anyone help me how to compare two XML files ad highlight the differences in files, I just want the output like below, can tell me any API's to use apart from XMLDiff

ActualFile :

<Human>
  <Legs>2</Legs>
  <Hands>2</<Hands>
  <Eyes>2</Eyes>
</Human>





预期文件:



Expected File:

<Human>
  <Legs>5</Legs>
  <Hands>2</<Hands>
 <Eyes>8</Eyes>
<Human>





我尝试过:



尝试了一些无法帮助我的C#代码,XML Diff对我没有帮助



What I have tried:

Tried with some C# code which couldn't help me, XML Diff wasnot helpful to me

推荐答案

你可能想要给< a href =https://www.xmlunit.org/> XMLUnit - 针对Java和.NET的XML测试单元 [ ^ ]试一试。

您不仅可以比较文件,还可以实现非常具体的自定义比较器。
You might want to give XMLUnit - Unit Testing XML for Java and .NET[^] a try.
You can not only compare files, but also implement very specific custom comparers.


这篇关于如何比较XML文件和突出显示差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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