2

I have two xmls:

first.xml

<text>This is text</text>
<output>This is output</output>

second.xml

<text>This is not text</text>
<output>This is output</output>

I want to compare these two xmls and output should like this

<text>This is <inserted>not</inserted> text</text>
    <output>This is output</output>

Means, I want to add a new tag suppose <inserted> to newly added text. How to compare these xmls and create new one ?

Thanks for ur time :)


  • I would not consider this a duplicate since the original question was 3 1/2 years ago, and the solution (XMLUnit) hasn't had a release in over 2 years. Also, I would not consider using a unit testing library to solve a programming problem. - Paul

2 답변


4

Take a look at diffxml.


3

http://xmlunit.sourceforge.net/

Nice to use in Unit tests, very good output.


  • Why do you think this question is about testing? This is just the answer of the alleged duplicate, and is a library that hasn't had a release in over 2 years. - Paul
  • Because I thought that comparing if two XML files are the same quite like as making a test if two XML files are the same - Farmor
  • @Farmor - the body of the question makes it clear that the OP wants the differences between the XML documents ... not just a yes/no answer. - Stephen C

Linked


Related

Latest