Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird XML error

Status
Not open for further replies.

NoviceNet

Programmer
May 26, 2005
15
US
I am using XML along with WinHttp object to download documents from another server over HTTP channel. I come across this error few times.

Description: The '2' character, hexadecimal value 0x32, cannot begin with a name. Line 1, position 26.

Any idea?

 
What does line 1 look like?

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
I have these lines:

url = "strXmlDoc = "123456"

WinHttpRequest objHttp = new WinHttpRequest();

objHttp.Open("POST",URL,false);
objHttp.Send(strXmlDoc);
XmlDocument doc = new XmlDocument();
strResultXml = objHttp.ResponseText;
- - - - -
- - - - -
- - - - -
 
The code you posted didn't actually say which line it was erroring on (i.e. the line that breaks and says the error is at "Line 1, position 26"). From the code you did post I would have to assume that it was erroring on the line that said "url = " which can't be true as you are simply setting a string value.

I suggest you step through the code, and find out where the error is.

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
Wish I could reproduce this issue and also this occured once or twice by our clients. I know that by looking at the code, it's really hard to predict the error type. But are you aware of this type of error regardless of the line number?
 
No I'm afraid I'm not

--------------------------------------------------------------------------------------------------------------------------------------------

Need help finding an answer?

Try the search facility ( or read FAQ222-2244 on how to get better results.
 
It is refering to the line number in the XML doc not your c sharp code.
Looks like your XML is corrupt. Maybe a space(char 32) in line 1 should be removed or something is wrong around that space.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top