Microsoft XML Diff 1.0 and XML Patch 1.0
The XmlDiff is a class used to compare two XML documents, detecting additions, deletions and other changes between XML documents. XmlDiff produces an XML Diff Language Diffgram that describes the differences between the two XML documents.
The Microsoft® XML Patch tool enables you to take a XmlDiff Language Diffgram produced from the XmlDiff class, and apply it against the source document to recreate the modified document.
The benefits of the XmlDiff class are:
- Detect equivalence between two XML documents, fragments, or nodes.
- Concisely report the differences between two documents, fragments, or nodes.
- Contains functionality to optionally ignore certain differences, such as comments or processing instructions.
The benefits of the XmlPatch class are:
- Apply an XmlDiff Language Diffgram to a document, fragment, or node, and re-create the changed document.
- Use as a source control or delta-encoding file. For example, if you have an array of servers that cache information as XML. Changes to one server can be sent over the network to the other servers. Rather than create network traffic collisions by trying to ship the entire cached document between servers, each server can use the XML Diff functionality, then send out the resulting XDL Diffgram as the patch.
Note This scenario assumes that the changes are propagated in a constant direction from a single master.
These two classes are contained in the XmlDiffPatch namespace.
In This Section
Describes the XmlDiff class used to compare two XML documents, fragments, or nodes.
Describes the XmlPatch class that applies a XML Diff Language Diffgram to an XML document to create a modified document.