I am trying to convert a GPX file to a datatable but seem to be really struggling with the basics of this. A GPX file is just an XML for GPS data. I have managed to put the URI of the file into a variable with a dialog box.
Here is the GPX file I am trying to load (albeit with a reduced number of points):
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1"
xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v3"
xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
xmlns:badelf="http://bad-elf.com/xmlschemas"
version="1.1"
creator="Bad Elf GPS Pro+ 2.1.50"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://bad-elf.com/xmlschemas http://bad-elf.com/xmlschemas/GpxExtensionsV1.xsd">
<metadata>
<extensions>
<badelf:modelNickname>BE021</badelf:modelNickname>
<badelf:modelSerialNumber>011215</badelf:modelSerialNumber>
<badelf:modelName>Bad Elf GPS Pro+</badelf:modelName>
<badelf:modelNumber>BE-GPS-2300</badelf:modelNumber>
<badelf:modelHardwareRevision>8.0.0</badelf:modelHardwareRevision>
<badelf:modelFirmwareRevision>2.1.50</badelf:modelFirmwareRevision>
<badelf:elevationSource>gps</badelf:elevationSource>
</extensions>
</metadata>
<wpt lat="50.650192" lon="-1.186149">
<ele>10.3</ele>
<time>2021-07-24T14:47:40Z</time>
<name>START (2021-07-24T14:47:40Z)</name>
</wpt>
<trk>
<name>2021-07-24T14:47:40Z</name>
<trkseg>
<trkpt lat="50.650192" lon="-1.186149"><ele>10.3</ele><time>2021-07-24T14:47:40Z</time><hdop>0.9</hdop><extensions><badelf:speed>0.00</badelf:speed><badelf:baroEle>52.4</badelf:baroEle><badelf:baroPress>1005.81</badelf:baroPress></extensions></trkpt>
<trkpt lat="50.650195" lon="-1.186144"><ele>8.8</ele><time>2021-07-24T14:47:41Z</time><hdop>0.9</hdop><extensions><badelf:speed>0.00</badelf:speed><badelf:baroEle>52.4</badelf:baroEle><badelf:baroPress>1005.81</badelf:baroPress></extensions></trkpt>
<trkpt lat="50.650193" lon="-1.186146"><ele>8.9</ele><time>2021-07-24T14:47:41Z</time><hdop>0.9</hdop><extensions><badelf:speed>0.00</badelf:speed><badelf:baroEle>52.4</badelf:baroEle><badelf:baroPress>1005.81</badelf:baroPress></extensions></trkpt>
</trkseg>
</trk>
<wpt lat="50.650168" lon="-1.186119">
<ele>13.4</ele>
<time>2021-07-24T15:52:30Z</time>
<name>END (2021-07-24T15:52:30Z)</name>
</wpt>
</gpx>
What I would like is to extract the badelf:modelNickname to a variable and then make a datatable with column headings "lat" "lon" "ele" "time" "hdop" "badelf:speed" and "badelf:baropressure"
Can someone help me do this in VB.Net please? Or even C# as I can probably translate.