Click here to Skip to main content
15,881,644 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
i take 2 xml backup registry from two pc
when i compare between them
i have that error

XML
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<k name="HKEY_CURRENT_USER">
<k name="SOFTWARE">
<k name="yahoo">
<k name="pager">
<k name="profiles">
<v name="LastSkin" value="Glossy Berry></v>
<v name="ViewSettings0" value="00 00 00 00 00 00 00 00" type="REG_BINARY"></v>
<v name="pref" value="Connection></v>
<v name="Flags0" value="00 00 00 00 00 00 00 00" type="REG_BINARY"></v>
<v name="WarnOnceFlags" value="0xffffffff 4294967295" type="REG_DWORD"></v>
<v name="Flags1" value="ff ff ff ff ff ff ff ff" type="REG_BINARY"></v>
<k name="Alerts"></k>
<k name="Archive"></k>
<k name="Chat">
<v name="WordFilter" value="0x00000001 1" type="REG_DWORD"></v>
</k>
<k name="Launchcast"></k>
<k name="Plugins"></k>
<k name="RecentSearches"></k>
<k name="Skins">
<v name="Default_SkinDir" value="C:\Program Files\Yahoo!\Messenger\skins\Default></v>
</k>
<k name="UI Settings">
<v name="CC_Vitality_Compact" value="0x00000001 1" type="REG_DWORD"></v>
</k>
</k>
</k>
</k>
</k>
</k>
</registry>






C#
using Microsoft.XmlDiffPatch;
            System.Xml.XmlWriter writer = System.Xml.XmlWriter.Create("D:\\diff.xml");
 
            // There are a number of available options in the XmlDiffOptions enum
            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);



error
C#
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:
Posted

1 solution

Please refer the link given below:

hexadecimal-value-0-is-an-invalid-character

hexadecimal value 0x00, is an invalid character





Don't forget to mark useful responses as Answer if they helped you towards a solution. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900