How to parse XML diff to show only differences

I compare the xml of two serialized objects using the MS XmlDiffPatch tool . (WITH#)

XML example 1:

<HotelBookingView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
  <Id>119</Id> 
  <RoomId>1</RoomId> 
  <NumberNights>4</NumberNights>
  <CourseBookings>       
   <CourseHotelLink> 
    <Id>0</Id> 
   </CourseHotelLink> 
 </CourseBookings> 
</HotelBookingView>

XML example 2:

<HotelBookingView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
  <Id>119</Id> 
  <RoomId>1</RoomId> 
  <NumberNights>5</NumberNights>
  <CourseBookings>       
   <CourseHotelLink> 
    <Id>0</Id> 
   </CourseHotelLink> 
 </CourseBookings> 
</HotelBookingView>

(NumberNights changed from 4 to 5)

Diff in between:

<?xml version="1.0" encoding="utf-8" ?> 
  <xd:xmldiff version="1.0" srcDocHash="14315823970661993399" options="IgnoreChildOrder" fragments="no" xmlns:xd="http://schemas.microsoft.com/xmltools/2002/xmldiff">
  <xd:node match="1">
   <xd:node match="3">
    <xd:change match="1">5</xd:change> 
   </xd:node>
  </xd:node>

Any tips on how to handle diff so that you can only show the differences between them?

I need a last impression that only shows NumberNights: oldvalue (4), new value (5)

Xml Diff Tool GetHtml(), , . , , html CSS "lightgreen", , node.., , ! !

+4
1

XmlDiffPatch? xmldiff, ( ).

<HotelBookingView xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:diff="http://www.via.ecp.fr/~remi/soft/xml/xmldiff" diff:status="below"> 
  <NumberNights diff:status="modified">4|5</NumberNights>
</HotelBookingView>

, , , / , pipe (|).

+2
source

All Articles