How to compare XML files

I have two XML files (XSD) that are generated by some kind of tool.
The tool does not preserve the order of elements, therefore, despite the fact that the content is comparable to it, since the text will be displayed in different ways.
Is there any tool that can sort items before comparing and will include text-based comparison of documents? Of course, sorting should be done recursively.

Sample data:
File A:

<xml>
  <A/>
  <B/>
</xml>

File B:

<xml>
  <B/>
  <A/>
</xml>
+5
source share
5 answers

I had a similar problem and ended up finding: http://superuser.com/questions/79920/how-can-i-diff-two-xml-files

xml, diff. , linux, mac - cygwin:

$ xmllint --c14n FileA.xml > 1.xml
$ xmllint --c14n FileB.xml > 2.xml
$ diff 1.xml 2.xml
+4

XSLT , xslt

+1

perl DifferenceMarkup http://metacpan.org/pod/XML::DifferenceMarkup xmldiff pecl.php.net/xmldiff PHP. XML- XML diff.

0

, Java- ( kotlin) xml.

:

  • .
  • ( - - - ).
  • .

, :

  • node - , , - <RequestReceivedTimestamp> .
  • - , , <Contact> <ListOfFavourites> .

XSLT .

- . .

, - - . , .

: XMLNormalize

0

XML . , , . XML , , DOM, . , , , . XML XML , . http://prettydiff.com/, , , , , .

-1

All Articles