Xml Comparison in C#

前端 未结 5 2058
离开以前
离开以前 2020-11-30 05:30

I\'m trying to compare two Xml files using C# code. I want to ignore Xml syntax differences (i.e. prefix names). For that I am using Microsoft\'s XML Diff and Patch C# API.

5条回答
  •  不知归路
    2020-11-30 05:39

    Those documents aren't semantically equivalent. The top-level element of the first is in the http://myNS namespace, while the top-level element of the second is in the default namespace.

    The child elements of the two documents are equivalent. But the documents themselves aren't.

    Edit:

    There's a world of difference between xmls:ns='http://myNS' and xmlns='http://myNS', which I appear to have overlooked. Anyway, those documents are semantically equivalent and I'm just mistaken.

提交回复
热议问题