Dim srcXml As String = pathDataFiles & "test.xml"
Dim XmlDoc As New Xml.XmlDocument
XmlDoc.Load(src Xml)
If my xml file starts with the line -
<?xml version="1.0" ?>
I get -
An unhandled exception of type
'System.Xml.Xml Exception' occurred in system.xml.dll
Additional information: System error.
Call Stack:
system.xml.dll! System.Xml.XmlT extReader.Parse Tag() + 0x96b bytes
system.xml.dll! System.Xml.XmlT extReader.Parse Root() + 0xed bytes
system.xml.dll! System.Xml.XmlT extReader.Read( ) + 0x80 bytes
system.xml.dll! System.Xml.XmlV alidatingReader .ReadWithCollec tTextToken()
+ 0x93 bytes
system.xml.dll! System.Xml.XmlV alidatingReader .Read() + 0x1b bytes
system.xml.dll! System.Xml.XmlL oader.LoadCurre ntNode() + 0x9e bytes
system.xml.dll! System.Xml.XmlL oader.LoadDocSe quence(System.X ml.XmlDocume
nt parentDoc) + 0x32 bytes
system.xml.dll! System.Xml.XmlL oader.Load(Syst em.Xml.XmlDocum ent doc,
System.Xml.XmlR eader reader, bool preserveWhitesp ace) + 0x6a bytes
system.xml.dll! System.Xml.XmlD ocument.Load(Sy stem.Xml.XmlRea der reader)
+ 0x49 bytes
system.xml.dll! System.Xml.XmlD ocument.Load(st ring filename) + 0x51 bytes
myPrj.exe!mySln ...myFunction(. ..) + 0xa0 bytes
If I comment-out these header line,
everything seems to work fine.
Question: How can I load a file containing this xml header line, without
getting any exceptions?
Thanks.
Atara.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!