-
Xml reader
hi.. i have problem on reading XML string data..
i need to receive this stream of XML tag..
<show>
<Title date="8-12-04" time="6 pm" place="lot 1">The Great One</Title>
<Title date="8-12-04" time="7 pm" place="lot 2">The Great Two</Title>
<Title date="8-12-04" time="8 pm" place="lot 3">The Great Three</Title>
.
.
.
</show>
how should go about retriving the data(places and show name) like, if i want to watch any show on 8-12-04 , and i am able to see the place and the movie names?
thanks....
-
-
<show>
<Title date="8-12-04" time="6 pm" place="lot 1">The Great One</Title>
<Title date="8-12-04" time="7 pm" place="lot 2">The Great Two</Title>
<Title date="8-12-04" time="8 pm" place="lot 3">The Great Three</Title>
i have try using your code, but have error on the "selectnodes"
.
.
For Each nod As XmlNode In ("//*")doc.SelectNodes
i am using the code below,
Dim dc As XmlDocument
dc = New XmlDocument
dc.LoadXml(rcv) [COLOR=seagreen]'received data rcv) /COLOR]
Dim nod As XmlNodeList = dc.GetElementsByTagName("program")
Dim i As Integer
Dim n As Integer
n = nod.Count
Dim sgf(n - 1) As String
For i = 0 To n - 1
'MsgBox(nod.ItemOf(i))
sgf(i) = xmlr.GetAttribute("Place")
'xmlr.Read()
Next i
Dim g As Integer
For g = 0 To sgf.Length - 1
MsgBox(sgf(g))
Next
the result i got form my code is always lot 1 ...
i am really in a lost....
-
sorry for the typo error... the getelementatg should be
Dim nod As XmlNodeList = dc.GetElementsByTagName("show")
instead of this
Dim nod As XmlNodeList = dc.GetElementsByTagName("program") (error) correct code