我比较了使用。 (C#)
XML Sample 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 样本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 has changed from 4 to 5)
他们之间的鸿沟:
<?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>
就如何处理监察员只能够表明两者之间的分歧提出建议?
I d like a final display that just shows NumberNights: oldvalue (4), new value (5)
The Xml Diff Tool has a GetHtml() function but it displays all the values and just highlights those that have changed. Currently to get just the difference I look through the produced html for the CSS lightgreen , then do string-manipulation to find the name of the node.. which is insane and really slow for a table full of audit data! Any better ideas appreciated!