You can use the XmlDocumentclass to represent an XML document. The XmlDocument is the standard DOM-style API for XML, we can use this class to load, validate, edit, add, etc in a document.
You can refer the following sample to better understand how to use the XmlDocument class.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
None
0 Points
1 Post
Extract XML data with Visual BASIC 2010
Apr 13, 2018 02:44 PM|Vangelis___|LINK
Hi,
I am bright new to XML and I have some data like:
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<route message="OKs" code="200">
<day_limit>1000</day_limit>
<today_used>2</today_used>
<off_road>true</off_road>
<token>XPyw7gDnkMbVSLlHDSgZDVpi8Ba5qqx3</token>
<total_distance>1127.5601</total_distance>
<off_road_distance>175.4072</off_road_distance>
<section>
<from_city off_road_city="true">FELOS</from_city>
<to_city off_road_city="false">STENIES</to_city>
<distance>1127.5601</distance>
<distance_off_road>175.4072</distance_off_road>
<waypoint off_road="ture" name="FELOS" lon="22.9500007629395" lat="37.9333000183105"/>
<waypoint off_road="false" lon="22.9347362518311" lat="37.9612731933594"/>
<waypoint off_road="false" lon="22.8005352020264" lat="38.0481071472168"/>
<waypoint off_road="false" name="BATSI" lon="22.4502639770508" lat="38.2301750183105"/>
<waypoint off_road="false" name="STENIES" lon="6.3000001907349" lat="65.0667037963867"/>
</section>
</route>
I like to extract following data:
code, off_road, total_distance, off_road_distance,
off_road_city for from_city and to_city, from_city, to_city
and for each waypoint off_road, name (if exists), lon and lat
Thank You
Star
11464 Points
2439 Posts
Re: Extract XML data with Visual BASIC 2010
Apr 16, 2018 08:21 AM|Yohann Lu|LINK
Hi vangelis,
You can use the XmlDocument class to represent an XML document. The XmlDocument is the standard DOM-style API for XML, we can use this class to load, validate, edit, add, etc in a document.
You can refer the following sample to better understand how to use the XmlDocument class.
XmlDocument XPath Example: Select XML nodes by Name and Attribute values in C# and VB.Net
Best Regards,
Yong Lu