Dim srcXml As String = pathDataFiles & "test.xml"
Dim XmlDoc As New Xml.XmlDocument
XmlDoc.Load(srcXml)
If my xml file starts with the line -
<?xml version="1.0" ?>
I get -
An unhandled exception of type
'System.Xml.XmlException' occurred in system.xml.dll
Additional information: System error.
Call Stack:
system.xml.dll!System.Xml.XmlTextReader.ParseTag() + 0x96b bytes
system.xml.dll!System.Xml.XmlTextReader.ParseRoot( ) + 0xed bytes
system.xml.dll!System.Xml.XmlTextReader.Read() + 0x80 bytes
system.xml.dll!System.Xml.XmlValidatingReader.Read WithCollectTextToken()
+ 0x93 bytes
system.xml.dll!System.Xml.XmlValidatingReader.Read () + 0x1b bytes
system.xml.dll!System.Xml.XmlLoader.LoadCurrentNod e() + 0x9e bytes
system.xml.dll!System.Xml.XmlLoader.LoadDocSequenc e(System.Xml.XmlDocume
nt parentDoc) + 0x32 bytes
system.xml.dll!System.Xml.XmlLoader.Load(System.Xm l.XmlDocument doc,
System.Xml.XmlReader reader, bool preserveWhitespace) + 0x6a bytes
system.xml.dll!System.Xml.XmlDocument.Load(System. Xml.XmlReader reader)
+ 0x49 bytes
system.xml.dll!System.Xml.XmlDocument.Load(string 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!