Comparing 2 xml files in C#???
Discussion
I think DOM is available with a COM interface. You just create an instance of a parser, collect and compare whatever you want in the tree(s), and spit out the results. Available on all platforms that would support C# (except perhaps mobile).
Perhaps you could even do it, byte by byte.
{{{
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
// Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>");
// Save the document to a file.
doc.Save("data.xml");
}
}
}}}
Copied form the manual.
Perhaps you could even do it, byte by byte.
{{{
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
// Create the XmlDocument.
XmlDocument doc = new XmlDocument();
doc.LoadXml("<book genre='novel' ISBN='1-861001-57-5'>" +
"<title>Pride And Prejudice</title>" +
"</book>");
// Save the document to a file.
doc.Save("data.xml");
}
}
}}}
Copied form the manual.
Edited by dilbert on Thursday 22 May 17:38
http://www.mathertel.de/Diff/
It's the daddy of all text diff algorithms - could be worth a look, even if it's not XML-specific.
It's the daddy of all text diff algorithms - could be worth a look, even if it's not XML-specific.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff