A
Andrew Raastad
Got a strange one here.... I am trying to load an XML document into memory
in order to do stuff. Not a big deal, done it before, and it has always
been pretty straight forward.... except this time it is weirding out on me.
I have a load method which takes as an argument the web url of the document,
then loads the info of the XML document into a DataTable for later use:
Private Sub LoadComponents(ByVal WebURL As String)
Dim xmlDom As New Xml.XmlDocument
Dim MainNode As Xml.XmlNode
Try
xmlDom.Load(WebURL)
MainNode = xmlDom.SelectSingleNode("xml")
For Each ComponentNode As Xml.XmlNode In MainNode.ChildNodes
With _ComponentsDT
Dim dr As DataRow = _ComponentsDT.NewRow
dr("Source") =
ComponentNode.SelectSingleNode("source").FirstChild.Value
dr("Description") =
ComponentNode.SelectSingleNode("description").FirstChild.Value
dr("Register") =
CType(ComponentNode.SelectSingleNode("register").FirstChild.Value, Boolean)
dr("SaveTo") =
ComponentNode.SelectSingleNode("saveto").FirstChild.Value
dr("FileName") =
ComponentNode.SelectSingleNode("filename").FirstChild.Value
dr("FileVersion") =
ComponentNode.SelectSingleNode("filever").FirstChild.Value
_ComponentsDT.Rows.Add(dr)
End With
Next
Catch ex As Exception
Throw New Exception("Components:LoadComponents() Failed:" &
vbCrLf & ex.ToString)
End Try
End Sub
The "WbeURL" value is something like:
"http://pminstaller/_mnpstatic/html/components.xml". If I manually open a
browser to this location I get the XML no problem. However, when the app
runs, it errors out on the xmlDom.Load() statement with the error:
"Syetem.IO.DirectoryNotFoundException: Could not find a part of the path
'C:\Documents and Settings\andrewr\Local
Settings\Apps\2.0\1KRLVKPP.ZQ3\791GDX2R.D1Q\npws..tion_aaa3415bf7745aed_0001.0001_d8b10cd45618a9f3\http\pminstaller\_mnpstatic\html\components.xml'."
Where the hell did this come from?? I passed in a web URL and the very next
line it is trying to open something from the local file system. You can see
the Web URL in the error there at the end, but I have verified that this is
NOT what is being passed in but rather the URL.
Help??
-- Andrew
in order to do stuff. Not a big deal, done it before, and it has always
been pretty straight forward.... except this time it is weirding out on me.
I have a load method which takes as an argument the web url of the document,
then loads the info of the XML document into a DataTable for later use:
Private Sub LoadComponents(ByVal WebURL As String)
Dim xmlDom As New Xml.XmlDocument
Dim MainNode As Xml.XmlNode
Try
xmlDom.Load(WebURL)
MainNode = xmlDom.SelectSingleNode("xml")
For Each ComponentNode As Xml.XmlNode In MainNode.ChildNodes
With _ComponentsDT
Dim dr As DataRow = _ComponentsDT.NewRow
dr("Source") =
ComponentNode.SelectSingleNode("source").FirstChild.Value
dr("Description") =
ComponentNode.SelectSingleNode("description").FirstChild.Value
dr("Register") =
CType(ComponentNode.SelectSingleNode("register").FirstChild.Value, Boolean)
dr("SaveTo") =
ComponentNode.SelectSingleNode("saveto").FirstChild.Value
dr("FileName") =
ComponentNode.SelectSingleNode("filename").FirstChild.Value
dr("FileVersion") =
ComponentNode.SelectSingleNode("filever").FirstChild.Value
_ComponentsDT.Rows.Add(dr)
End With
Next
Catch ex As Exception
Throw New Exception("Components:LoadComponents() Failed:" &
vbCrLf & ex.ToString)
End Try
End Sub
The "WbeURL" value is something like:
"http://pminstaller/_mnpstatic/html/components.xml". If I manually open a
browser to this location I get the XML no problem. However, when the app
runs, it errors out on the xmlDom.Load() statement with the error:
"Syetem.IO.DirectoryNotFoundException: Could not find a part of the path
'C:\Documents and Settings\andrewr\Local
Settings\Apps\2.0\1KRLVKPP.ZQ3\791GDX2R.D1Q\npws..tion_aaa3415bf7745aed_0001.0001_d8b10cd45618a9f3\http\pminstaller\_mnpstatic\html\components.xml'."
Where the hell did this come from?? I passed in a web URL and the very next
line it is trying to open something from the local file system. You can see
the Web URL in the error there at the end, but I have verified that this is
NOT what is being passed in but rather the URL.
Help??
-- Andrew