Last post Oct 13, 2010 09:05 PM by sanchau_in
Oct 06, 2010 01:49 AM|sanchau_in|LINK
Using xml file in an application.
received following error,
"The 'REVIEW' start tag on line 117 does not match the end tag of 'REVIEWTYP'. Line 117; position 21."
The above error is not reproducible and when I check the file after error occured, I can see the tags present (both tags correctly).
I tried opening file in different editors, notepad, studio, explorer etc but not found any mismatch. (using Windows XP Japanese for development) . The target machine is XP English.
Can somebody help me in understanding the error and the reasons?
asp.NET 2.0 web servies
c# xml xmlReader
C# .NET XML XML NODE Repeater Control String
Oct 06, 2010 06:39 PM|sansan|LINK
It seems like you have the xml document with following structure.
<?xml version="1.0" encoding="utf-8" ?><REVIEW> <!--something here--></REVIEWTYP>
That's invalid, start tags and end tags should match.
<?xml version="1.0" encoding="utf-8" ?><REVIEW> <!--something here--></REVIEW>
Oct 06, 2010 07:41 PM|sanchau_in|LINK
Actually the tags are correctly written in xml as follows,
<?xml version="1.0" encoding="utf-8" ?>
Basically it works all the time except few when I get the mismatch exception. I am accessing the xml file through IP address from the same PC. (.net remoting).
Oct 06, 2010 07:44 PM|sansan|LINK
I am assuming that you are using either XmlDocument or XDocument to read the xml string/file. Did you debug and see what you are getting as xml response?
Oct 06, 2010 07:57 PM|sanchau_in|LINK
Yes I am using XmlDocument,
The exception comes at XmlDoc.Load, (it looks like that).
XmlDoc = new XmlDocument();
But at the time of exception if I check the xml file all the tag are intact and there is no fault in xml.
Is there any other way to debug this issue? Please guide,
Thanks & Regards,
Oct 06, 2010 09:27 PM|sansan|LINK
One way is reading text from the file and see what's the xml you are getting.
string strXML = System.IO.File.ReadAllText("your file path");
You can add that line and debug to see what that string is. I'm assuming that you will get incorrect string in there. Debug and post the value are getting.
Oct 13, 2010 09:05 PM|sanchau_in|LINK
Actually I saw following funny thing happening (reasons are unknown yet)
1. When I open the xml file in wordpad on one of the English OS machine (used as server windows 2003), I found that the file is corrupted,
If I try to copy the file content from wordpad to notepad, I cannot copy till end, only till corrupted tag can be copied in notepad.
2. If I try to open file in wordpad from other machine (without coping on other machine) with english OS same behaviour can be seen.
3. But if I copy the file and pen in wordpad and check I cannot see the corrupted characters and can copy complete content in notepad.
I tried to check the encoding but it is same in all cases, UTF8-DOS.
Can you put some light why such diffrent behaviours are seen?
Are there any extra settings needed?