XmlNode.SelectNodes returns empty list

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello everybody
the code line
<span style="color:#2b91af XmlNodeList nodeList = doc.SelectNodes(<span style="color:#a31515 "//trkseg");
returns an empty XmlNodeList. This is how the xml file starts:
<span style="color:#0000ff <span style="color:#0000ff <span style="color:#0000ff <font color="#0000ff
<?
</font>
<span style="color:#a31515 xml<span style="color:#0000ff <span style="color:#ff0000 version<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff 1.0<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 encoding<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff utf-8<span style="color:#000000 "<span style="color:#0000ff ?><font color="#0000ff

<
</font>

<span style="color:#a31515 gpx<span style="color:#0000ff <span style="color:#ff0000 xmlns:xsd<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff http://www.w3.org/2001/XMLSchema<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 xmlns:xsi<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff http://www.w3.org/2001/XMLSchema-instance<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 version<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff 1.1<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 creator<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff Radroutenplaner NRW www.radroutenplaner.nrw.de<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 xsi:schemaLocation<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 xmlns<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff http://www.topografix.com/GPX/1/1<span style="color:#000000 "<span style="color:#0000ff ><font color="#0000ff

<
</font>

<span style="color:#a31515 metadata<span style="color:#0000ff ><<span style="color:#a31515 name<span style="color:#0000ff ><span style="color:#000000 RRP-Track 0015<span style="color:#0000ff </<span style="color:#a31515 name<span style="color:#0000ff ></<span style="color:#a31515 metadata<span style="color:#0000ff ><font color="#0000ff

<
</font>

<span style="color:#a31515 trk<span style="color:#0000ff ><font color="#0000ff

<
</font>

<span style="color:#a31515 trkseg<span style="color:#0000ff ><font color="#0000ff

<
</font>

<span style="color:#a31515 trkpt<span style="color:#0000ff <span style="color:#ff0000 lat<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff 50.774380<span style="color:#000000 "<span style="color:#0000ff
<span style="color:#ff0000 lon<span style="color:#0000ff =<span style="color:#000000 "<span style="color:#0000ff 8.780564<span style="color:#000000 "<span style="color:#0000ff ></<span style="color:#a31515 trkpt<span style="color:#0000ff >
if I remove the all the attributes in the <gpx> node, the result is the one element <trkseg> as expected. I probably have to use an XmlNameSpaceManager, but I dont know how.
Thanks for any hint!
Gerhard


View the full article
 
Back
Top