title: parsing tcx document using xdocument selectsinglenode
body: <p>I am trying to parse an TCX document similiar to the one used in this post: <a href="https://stackoverflow.com/questions/8280437/import-tcx-into-r-using-xml-package">Import TCX into R using XML package</a></p>
  
  <p>Only I'm trying to use XmlDocument.SelectNodes and SelectSingleNode instead of getNodeSet.   The line with xmlns looks like this:</p>
  
  <pre><code>&lt;TrainingCenterDatabase xmlns="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd"&gt;
  </code></pre>
  
  <p>If I remove the xmlns and just have , I can parse it without any problems.</p>
  
  <p>My (vb.net) code:</p>
  
  <pre><code>    Dim tcxXmlDocument As New System.Xml.XmlDocument()
      tcxXmlDocument.Load(tcxFile)
      Dim xmlnsManager = New System.Xml.XmlNamespaceManager(tcxXmlDocument.NameTable)
  
      Dim trackpoints As New List(Of Trackpoint)
  
      For Each tpXml As System.Xml.XmlNode In tcxXmlDocument.SelectNodes("//Trackpoint", xmlnsManager)
          Dim newTrackpoint As New Trackpoint
  
          With newTrackpoint
              .Time = tpXml.SelectSingleNode("Time").InnerText
              .LatitudeDegrees = tpXml.SelectSingleNode("Position/LatitudeDegrees").InnerText
              .LongitudeDegrees = tpXml.SelectSingleNode("Position/LongitudeDegrees").InnerText
              .HeartRateBpm = tpXml.SelectSingleNode("HeartRateBpm").InnerText
          End With
  
          trackpoints.Add(newTrackpoint)
      Next
  </code></pre>
  
  <p>How can I configure the XmlNamespaceManager so that I can access the nodes in such a tcx document?</p>
  
  <p>Thanks,</p>
  
  <p>Jason</p>