是否有任何选项可以使用XMLDiff和XMLDiffView仅获取两个xml之间的差异。
也有可能在xml
中获取修改的行号看一下下面的样本。
XML1
<Products>
<Product level="1" >
<ProductId>1001</ProductId>
<Name>ProductName1</Name>
<ProductType>Groceries</ProductType>
<Stock type="box">100</Stock>
<Comment />
</Product>
<Product>
<ProductId>1003</ProductId>
<Name>ProductName3</Name>
<ProductType>Garments</ProductType>
<Stock type="packet">50</Stock>
<Comment>Information about the product</Comment>
</Product>
XML2
<Products>
<Product>
<ProductId>1003</ProductId>
<Name>ProductName3</Name>
<ProductType>Garments</ProductType>
<Stock type="box">50</Stock>
</Product>
<Product>
<ProductId>1004</ProductId>
<Name>ProductName4</Name>
<ProductType>SportsEquipment</ProductType>
<Stock>100</Stock>
<Comment />
</Product>
<Product level="1" >
<ProductId>1001</ProductId>
<Name>ProductName1</Name>
<ProductType>Groceries</ProductType>
<Stock type="box">80</Stock>
<Comment />
</Product>
结果:
<Products>
<Product>
<Stock type="box">50</Stock>
<Stock>80</Stock>
</Product>
<Product>
<Comment>Information about the product</Comment> //Removed - Need to specify
</Product>
<Product>
<ProductId>1004</ProductId>
<Name>ProductName4</Name>
<ProductType>SportsEquipment</ProductType>
<Stock>100</Stock>
<Comment />
</Product>
XMLDiffView中是否有任何设置可将上述结果作为输出。我正在比较大量的xml,所以显示所有内容将看起来像混乱。