|
-
Sep 27th, 2004, 10:02 PM
#1
Thread Starter
Hyperactive Member
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....
-
Sep 27th, 2004, 10:51 PM
#2
-
Sep 28th, 2004, 03:02 AM
#3
Thread Starter
Hyperactive Member
<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....
-
Sep 28th, 2004, 03:05 AM
#4
Thread Starter
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|