I installed the xml file comparer tool from this link :
http://msdn.microsoft.com/en-us/library/aa302294.aspx
and add the dll to my project and created this application :
Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Literal ID="Literal1" runat="server" Mode="Encode"></asp:Literal> </div>
</form>
</body>
</html>
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.XmlDiffPatch;
using System.Xml;
using System.IO;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
XmlDocument doc1 = new XmlDocument();
doc1.Load(Server.MapPath("xmlfiles/deneme.xml"));
XmlDocument doc2 = new XmlDocument();
doc2.Load(Server.MapPath("xmlfiles/deneme2.xml"));
StringWriter sw = new StringWriter();
StringWriter sw2 = new StringWriter();
StringWriter sw3 = new StringWriter();
XmlTextWriter writer = new XmlTextWriter(sw);
XmlTextWriter writer2 = new XmlTextWriter(sw2);
XmlTextWriter gramwriter = new XmlTextWriter(sw3);
doc2.WriteTo(writer2);
doc1.WriteTo(writer);
GenerateDiffGram(sw.ToString(), sw2.ToString(), gramwriter);
//Literal1.Text = sw3.ToString();
}
public void GenerateDiffGram(string originalFile, string finalFile,
XmlWriter diffGramWriter)
{
XmlDiff xmldiff = new XmlDiff(XmlDiffOptions.IgnoreChildOrder |
XmlDiffOptions.IgnoreNamespaces |
XmlDiffOptions.IgnorePrefixes);
bool bIdentical = xmldiff.Compare(originalFile, finalFile, false, diffGramWriter);
diffGramWriter.Close();
}
}
it generates this error:
Invalid URI: The Uri string is too long
Do you have any idea why?