XmlDocument Comparison

I want to compare an XML document. some of them are 50 KB. I am comparing OuterXml. is it effective? is there a more efficient way?

+3
source share
5 answers

Depends on which comparison you want.

For example, if you just want to compare the contents in two files and get the status true / false, I would suggest using XmlReader for each of the two files you want to compare, and then analyze the nodes. The moment you encounter the difference, you can stop parsing.

XML-, , . ( )

XML- , . ( ).

, / DOM ( XmlDocument API).

+4

XML - :

<node x="1" y="2" />

<node y="2" x="1" />

XML ( node ), , , .

Microsoft XmlDiff GotDotNet, , -.....

UPDATE
XmlDiff, -, - - , Diff Patch Tool " MSDN.

+8

: http://diffxml.sourceforge.net/

XmlDiff MicroSoft, . , MS XmlDiff , . open source, DiffXml - .

+2

XML, MS XmlDiff, . , , XML, , node. XPath://[@]
, . XPath, attruibute . , XPath.
, , node XPath. , , , . , , , . , .

XML, .: -)

+1

Project: Merge - Windows, ( ) XML .

0

Source: https://habr.com/ru/post/1711320/


All Articles