M
M. Posseth
Hello ,,,
i am currently bussy to learn some XML parsing however i have a slight
problem with it
in the below code i would expect the msgbox to give the result 0201 however
it returns an empty value
how should i handle this ???
( tryed all sorts of combinations with nodes and elements and attributes but
i do not get any values ..... aaaahrghhhh ;-) )
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim x As String = "<?xml version=""1.0"" encoding=""iso-8859-1""?>" & vbCrLf
& _
"<tirep>" & vbCrLf & "<request>" & vbCrLf & "<cmd>0201</cmd>" & vbCrLf &
"<dsc>VS_GetBrands</dsc>" & vbCrLf & _
"<maxcount>200</maxcount>" & vbCrLf & "<IDsOnly></IDsOnly>" & vbCrLf &
"</request>" & vbCrLf & _
"<params>" & vbCrLf & "<session>{[GUID]}</session>" & vbCrLf &
"<BrandName>Au</BrandName>" & _
vbCrLf & "</params>" & vbCrLf & "</tirep>"
MsgBox(x)
Dim xmldoc As New XmlDocument
xmldoc.LoadXml(x)
With xmldoc.SelectSingleNode("tirep")
MsgBox(.Item("request").Item("cmd").Value)
End With
End Sub
i am currently bussy to learn some XML parsing however i have a slight
problem with it
in the below code i would expect the msgbox to give the result 0201 however
it returns an empty value
how should i handle this ???
( tryed all sorts of combinations with nodes and elements and attributes but
i do not get any values ..... aaaahrghhhh ;-) )
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim x As String = "<?xml version=""1.0"" encoding=""iso-8859-1""?>" & vbCrLf
& _
"<tirep>" & vbCrLf & "<request>" & vbCrLf & "<cmd>0201</cmd>" & vbCrLf &
"<dsc>VS_GetBrands</dsc>" & vbCrLf & _
"<maxcount>200</maxcount>" & vbCrLf & "<IDsOnly></IDsOnly>" & vbCrLf &
"</request>" & vbCrLf & _
"<params>" & vbCrLf & "<session>{[GUID]}</session>" & vbCrLf &
"<BrandName>Au</BrandName>" & _
vbCrLf & "</params>" & vbCrLf & "</tirep>"
MsgBox(x)
Dim xmldoc As New XmlDocument
xmldoc.LoadXml(x)
With xmldoc.SelectSingleNode("tirep")
MsgBox(.Item("request").Item("cmd").Value)
End With
End Sub