I installed the xml file comparer tool from this link :


and add the dll to my project and created this application :


<%@ 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>
    <form id="form1" runat="server">
        <asp:Literal ID="Literal1" runat="server" Mode="Encode"></asp:Literal>&nbsp;</div>

Default.aspx.cs :

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();
        XmlDocument doc2 = new XmlDocument();
        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);
        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 |
        bool bIdentical = xmldiff.Compare(originalFile, finalFile, false, diffGramWriter);


it generates this error:

Invalid URI: The Uri string is too long

Do you have any idea why?

Recommended Answers

All 5 Replies

What is the value of Server.MapPath("xmlfiles/deneme.xml")

What is the value of Server.MapPath("xmlfiles/deneme.xml")

why does it matter?

Where is the error generated from?

Anyway guys i dont want to think about that problem anymore, i am trying to compare two xml files which dont have xsd. I tried to use that tool from microsoft but they didnt even bother to correct typos on the sample code, so anyway, thanks for the replies..

The reason the value was relevant is that was probably the URI it complained on.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.