read an xml file

Ghost

Member
Joined
May 27, 2003
Messages
16
when i read an xml file from a web service client, it is not read properly. whereas, if i read the file from a normal web application, it is being read properly.

any idea why?
 
This is the code to read file from disk or from some where else

C#:
System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader("c:\\IntroToVCS.xml");
         string contents = "";
         while (reader.Read()) 
         {
            reader.MoveToContent();
            if (reader.NodeType == System.Xml.XmlNodeType.Element)
               contents += "<"+reader.Name + ">\n";
            if (reader.NodeType == System.Xml.XmlNodeType.Text)
               contents += reader.Value + "\n";
         }
Console.Write(contents);

Please check you might be doing some thing worng while accessing the WEB Service or Parsing XML data.
 
Back
Top