Say i have these XML tag:
how do i actually extract the country and date attributes using XMLDocument...Code:<Books country = "USA" date= "21/1/2005"> <Title section ="1"> <Reference web = "www.any.com" topic = "1"> </Title> <Title section ="1"> <Reference web = "www.idea.com" topic = "2"> </Title> <Title section ="2"> <Reference web = "www.howTo.com" topic = "3"> </Title> <Title section ="3"> <Reference web = "www.do.com" topic = "4"> </Title> </Books>
I tried but it could not worked, below is my coding
ThanksCode: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




Reply With Quote