title: Using Xpath to Retrieve the Text Content of an Element
body: <p>Hello I am trying to read my xml document using xpath. I have been at it for few weeks now and just learning XML and VB but seems like I hit a road block. I tried a few different attempts at doing this and I have no problem displaying the XML file on a webpage using the xpathnavigator class. But then i needed to format into an html table so i took another route and just added the xmldatasource with a formview. So here is my code for that</p>
  
  <pre><code>&lt;oriondata station='GiftShop'&gt;
  &lt;meas name="GiftShopTime"&gt;2011/02/08 16:39:01&lt;/meas&gt;
  &lt;meas name="GiftShopItemNumber"&gt;6&lt;/meas&gt;
  &lt;meas name="GiftShopDuration"&gt;200&lt;/meas&gt;
  &lt;/oriondata&gt;
  </code></pre>
  
  <p>The values I would like to grab are the date "2011/02/08 16:39:01" in this example and the number "6" and also the duration which is "200"</p>
  
  <p>Not sure what I am doing wrong if i use the </p>
  
  <pre><code>&lt;asp:Label ID="lblID" Runat="server" Text='&lt;%# XPath("//oriondata/meas/@name") %&gt;' /&gt;&lt;/b&gt;&lt;br/&gt;
  </code></pre>
  
  <p>That gives me "GiftShopTime" but not the actual time. Also if i just use this</p>
  
  <pre><code>&lt;asp:Label ID="lblID" Runat="server" Text='&lt;%# XPath(".") %&gt;' /&gt;
  &lt;/b&gt;&lt;br/&gt;
  </code></pre>
  
  <p>That gives me the current node from what I am reading but the current node when i do this happens to be the actual time </p>
  
  <p>I just have not figured out a way to specify each of those names I thought this should work</p>
  
  <pre><code>Xpath("/oriondata/meas/name/@GiftShopTime") 
  </code></pre>
  
  <p>but that displays nothing.</p>