using Microsoft.XmlDiffPatch;
System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create("D:\\diff.xml");
XmlDiff diff = new XmlDiff(XmlDiffOptions.IgnoreChildOrder | XmlDiffOptions.IgnoreComments | XmlDiffOptions.IgnoreWhitespace | XmlDiffOptions.IgnoreXmlDecl | XmlDiffOptions.IgnorePI | XmlDiffOptions.IgnoreNamespaces | XmlDiffOptions.IgnorePrefixes | XmlDiffOptions.IgnoreDtd);
diff.Compare(@"D:\\registrybackup.xml", @"D:\\registrybackupthef.xml", true, writer);
i take 2 xml backup registry from two pc
when i compare between them
i have that error
System.Xml.XmlException was unhandled
Message='.', hexadecimal value 0x00, is an invalid character. Line 8, position 39.
Source=System.Xml
LineNumber=8
LinePosition=39
SourceUri=""
StackTrace:
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlTextReader.Read()
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.LoadChildNodes(XmlDiffParentNode parent, XmlReader reader, Boolean bEmptyElement)
at Microsoft.XmlDiffPatch.XmlDiffDocument.Load(XmlReader reader, XmlHash xmlHash)
at Microsoft.XmlDiffPatch.XmlDiff.Compare(XmlReader sourceReader, XmlReader changedReader, XmlWriter diffgramWriter)
at Microsoft.XmlDiffPatch.XmlDiff.Compare(String sourceFile, String changedFile, Boolean bFragments, XmlWriter diffgramWriter)
at yahoo.Form1.button1_Click(Object sender, EventArgs e) in C:\Users\Sirhirbaz\documents\visual studio 2010\Projects\yahoo\yahoo\Form1.cs:line 31
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at yahoo.Program.Main() in C:\Users\Sirhirbaz\documents\visual studio 2010\Projects\yahoo\yahoo\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Thank You.