A
Atara
I use the following code to load xml file:
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.Read() + 0x80 bytes
system.xml.dll!System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
+ 0x93 bytes
system.xml.dll!System.Xml.XmlValidatingReader.Read() + 0x1b bytes
system.xml.dll!System.Xml.XmlLoader.LoadCurrentNode() + 0x9e bytes
system.xml.dll!System.Xml.XmlLoader.LoadDocSequence(System.Xml.XmlDocume
nt parentDoc) + 0x32 bytes
system.xml.dll!System.Xml.XmlLoader.Load(System.Xml.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.
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.ParseRoot() + 0xed bytessystem.xml.dll!System.Xml.XmlTextReader.ParseTag() + 0x96b bytes
system.xml.dll!System.Xml.XmlTextReader.Read() + 0x80 bytes
system.xml.dll!System.Xml.XmlValidatingReader.ReadWithCollectTextToken()
+ 0x93 bytes
system.xml.dll!System.Xml.XmlValidatingReader.Read() + 0x1b bytes
system.xml.dll!System.Xml.XmlLoader.LoadCurrentNode() + 0x9e bytes
system.xml.dll!System.Xml.XmlLoader.LoadDocSequence(System.Xml.XmlDocume
nt parentDoc) + 0x32 bytes
system.xml.dll!System.Xml.XmlLoader.Load(System.Xml.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.