Say i have these XML tag:
how do i actually extract the country and date attributes using XMLDocument
I tried but it could not worked, below is my coding
and substring the "1" from the date attributes........
Thanks
VB.NET:
<Books country = "USA" date= "21/1/2005">
<Title section ="1">
<Reference web = "[url="http://www.any.com"]www.any.com[/url]" topic = "1">
</Title>
<Title section ="1">
<Reference web = "[url="http://www.idea.com"]www.idea.com[/url]" topic = "2">
</Title>
<Title section ="2">
<Reference web = "[url="http://www.howTo.com"]www.howTo.com[/url]" topic = "3">
</Title>
<Title section ="3">
<Reference web = "[url="http://www.do.com"]www.do.com[/url]" topic = "4">
</Title>
</Books>
I tried but it could not worked, below is my coding
VB.NET:
Dim cou, da As Integer
Dim xdoc As New XmlDocument
Dim nodelist As XmlNodeList
Dim node As XmlNode
xdoc.Load("..\book.xml")
nodelist = xdoc.SelectNodes("/Books")
For Each node In nodelist
cou = node.Attributes.GetNamedItem("country").Value
MessageBox.Show(cou)
da = node.Attributes.GetNamedItem("date").Value
MessageBox.Show(da)
Next
Thanks