System.Xml.XmlException with XPath
Hello everybody,
When I try to read an XML file with XmlTextReader() method I get the System.Xml.XmlException.
My code is like this:
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
XmlTextReader reader = new XmlTextReader(".\\.\\Books.xml");
reader.WhitespaceHandling = WhitespaceHandling.None;
while (reader.Read()) // Here where the error occurs.
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
//
break;
case XmlNodeType.Text:
//
break;
case XmlNodeType.EndElement:
//
break;
case XmlNodeType.SignificantWhitespace:
//
break;
}
}
}
}
|