RSS Forums RSS
Please support our C# advertiser: Programming Forums
Views: 17644 | Replies: 2
Join Date: Apr 2004
Posts: 555
Reputation: Dark_Omen is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 6
Dark_Omen Dark_Omen is offline Offline
Posting Pro

problem reading xml file in c#

  #1  
May 6th, 2005
Hello,

I am trying to read this xml file. But whenever I get to the load part of it, it gives me this error: "The data at the root level is invalid. Line 1, position 1"
This is the code I am working with:
publicstatic Response Message(string doc)
{
		 StringReader reader = new StringReader(doc);
		 XmlTextReader textReader = new XmlTextReader(reader);
		 XmlDocument xmlDoc = new XmlDocument();
		 xmlDoc.Load(textReader); //gets stuck here
return Response.Message(xmlDoc);
}

doc is the filepath of the xml document.

If anybody has any idea on how to solve this problem that would be great.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
All times are GMT -4. The time now is 3:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC