Hi,
I am trying to get all the wpt nodes in this XML file. Just cannot seem to get the right Xpath syntax to work. For some reason even "//wpt", just won't do it. It has something to do with namespaces I think, but I do not know enough on this subject.
Thanks for the help.
RishiD
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="MapSource 6.9.2" version="1.1" 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">
<metadata>
<link href="http://www.garmin.com">
<text>Garmin International</text>
</link>
<time>2007-02-27T03:12:19Z</time>
<bounds maxlat="45.579700" maxlon="12.616124" minlat="41.882329" minlon="9.180408"/>
</metadata>
<wpt lat="45.469537" lon="9.180408">
<time>2007-02-24T22:16:12Z</time>
<name>CastelloSforze</name>
<cmt>Castello Sforzesco</cmt>
<desc>Castello Sforzesco</desc>
<sym>Museum</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v2 http://www.garmin.com/xmlschemas/GpxExtensions/v2/GpxExtensionsv2.xsd">
<gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode>
<gpxx:Categories>
<gpxx:Category>Milan</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</wpt>
<wpt lat="43.756914" lon="11.298881">
<time>2007-02-21T04:10:14Z</time>
<name>Firenze Holiday Inn</name>
<cmt>Viale Europa</cmt>
<desc>Viale Europa</desc>
<sym>Lodging</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v2 http://www.garmin.com/xmlschemas/GpxExtensions/v2/GpxExtensionsv2.xsd">
<gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode>
<gpxx:Categories>
<gpxx:Category>Hotels</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</wpt>
<rte>
<name>Milan Crowne Plaza to Rome Crowne Plaza</name>
<extensions>
<gpxx:RouteExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v2 http://www.garmin.com/xmlschemas/GpxExtensions/v2/GpxExtensionsv2.xsd">
<gpxx:IsAutoNamed>true</gpxx:IsAutoNamed>
</gpxx:RouteExtension>
</extensions>
<rtept lat="45.423061" lon="9.251640">
<time>2007-02-21T04:04:32Z</time>
<name>Milan Crowne Plaza</name>
<cmt>Via Konrad Adenauer</cmt>
<desc>Via Konrad Adenauer</desc>
<sym>Lodging</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v2 http://www.garmin.com/xmlschemas/GpxExtensions/v2/GpxExtensionsv2.xsd">
<gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode>
<gpxx:Categories>
<gpxx:Category>Hotels</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</rtept>
<rtept lat="43.756914" lon="11.298881">
<time>2007-02-21T04:10:14Z</time>
<name>Firenze Holiday Inn</name>
<cmt>Viale Europa</cmt>
<desc>Viale Europa</desc>
<sym>Lodging</sym>
<extensions>
<gpxx:WaypointExtension xmlns:gpxx="http://www.garmin.com/xmlschemas/GpxExtensions/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/GpxExtensions/v2 http://www.garmin.com/xmlschemas/GpxExtensions/v2/GpxExtensionsv2.xsd">
<gpxx:DisplayMode>SymbolAndName</gpxx:DisplayMode>
<gpxx:Categories>
<gpxx:Category>Hotels</gpxx:Category>
</gpxx:Categories>
</gpxx:WaypointExtension>
</extensions>
</rtept>
</rte>
</gpx>