PDA

View Full Version : Loading XML error (.net 1.1)


Sycario
03-14-07, 12:35 PM
I am trying to load an xml document but it blows up every time. I've done this before without a problem.

Dim xmlDoc As New Xml.XmlDocument
If IO.File.Exists(XMLFile) = False Then
ThrowError("Unable to locate the setup xml.", True)
ElseIf IO.File.Exists(XMLFile) Then
xmlDoc.Load(XMLFile)

Then it errors on the load with:
Additional information: System error.

In the debug it says:
XMLFile "E:\Dev\UllsaSetup\UllsaSetup\bin\setup.xml" String

Any ideas?

Head_slinger
03-22-07, 07:37 PM
can you post more of the code please.

supra
03-22-07, 08:04 PM
In the debug it says:
XMLFile "E:\Dev\UllsaSetup\UllsaSetup\bin\setup.xml" String


is this the actual path or is it

"E:\Dev\UllsaSetup\bin\setup.xml"
not
"E:\Dev\UllsaSetup\UllsaSetup\bin\setup.xml"

Sycario
03-29-07, 12:13 PM
That was the correct path. It's usually something simple with an error that makes no sense. In this case the xml had <Replace> and </replace>. Just one capital letter made it give a system error. You'd think that the errors might be a little more helpful sometimes.....

supra
03-29-07, 08:44 PM
hehe yeah but u should already know xml is case sensitive.

i would use a try/catch if u want more details on the error instead of throwerror

Dim xmlDoc As New Xml.XmlDocument
Try
xmlDoc.Load(XMLFile)
Catch ex as Exception
msgbox(ex.tostring)
End Try

Sycario
03-31-07, 12:12 PM
Yeah, I know it's case sensitive. I didn't make the layout of the XML. Noticing 1 capital letter out of place isn't easy for me, I can't even find a loaf of bread on the counter when it's right in front of me. The only reason I found it was because I opened it with IE7 and it told me the tags didn't match.