VB.net read XML element -
i trying write application in vb.net stuck , spend time searching how can't it. need read specific xml element , write in specific label. if can give me example.
i need output this:
--book 1--- title: everyday italian author: giada de laurentiis --book 2-- title: harry potter author: j k. rowling --etc--
xml:
<bookstore> <book> <title>everyday italian</title> <author>giada de laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book> <title>harry potter</title> <author>j k. rowling</author> <year>2005</year> <price>29.99</price> </book> <book> <title>xquery kick start</title> <author>james mcgovern</author> <year>2003</year> <price>49.99</price> </book> <book> <title>learning xml</title> <author>erik t. ray</author> <year>2003</year> <price>39.95</price> </book>
what need this: image
now showing first book. need loop books.
thank you
dim xmlroot xelement = xdocument.load("x:\books.xml").root each book xelement in xmlroot.<book> debug.writeline(book.<title>.value) debug.writeline(book.<author>.value) debug.writeline(book.<year>.value) debug.writeline(book.<price>.value) next
Comments
Post a Comment