Using xml: Looking for performant XyDiff Port in C# (XML Diff Patch with XID) on newest questions tagged xml – Stack Overflow
I store some data as XML and the changes of the user as diff to the original XML, so the data for the user can be patched on runtime.
Example for the original xml (only part of it):
<module id=""> <title id=""> ... </title> <actions> ... </actions> <zones id="" selected="right"> <zone id="" key="right" name="Right" /> </zones> </module>
Example of the user diff (the user changed the value of selected from right to left):
<xd:xmldiff version="1.0" srcDocHash="" options="IgnoreChildOrder IgnoreNamespaces IgnorePrefixes IgnoreSrcValidation " fragments="no" xmlns:xd="http://schemas.microsoft.com/xmltools/2002/xmldiff"> <xd:node match="1"> <xd:node match="3"> <xd:change match="@selected">left</xd:change> </xd:node> </xd:node> </xd:xmldiff>
The problem is, that the patch looks for the order of the XML nodes. If the order changes than the diff cannot be applied anymore or even worse it will be applied wrongly. So I would prefer patching by XID.
Does anyone know a performant library or algorith for C# for a XyDiff?
Using xml: using-xml