title: Need help with Xpath methods in javascript (selectSingleNode, selectNodes)
body: <p>I want to optimize my javascript but I ran into a bit of trouble. I'm using XSLT transformation and the basic idea is to get a part of the XML and subquery it so the calls are faster and less expensive. This is a part of the XML:</p>
  
  <pre><code>&lt;suite&gt;
  &lt;table id="spis" runat="client"&gt;
      &lt;rows&gt;                      
          &lt;row id="spis_1"&gt;               
          &lt;dispatch&gt;'2008', '288627'&lt;/dispatch&gt;       
          &lt;data col="urGod"&gt;
              &lt;title&gt;2008&lt;/title&gt;
              &lt;description&gt;Ur. god.&lt;/description&gt;
          &lt;/data&gt;
          &lt;data col="rbr"&gt;
               &lt;title&gt;288627&lt;/title&gt;
               &lt;description&gt;Rbr.&lt;/description&gt;
          &lt;/data&gt;
  
  ...
  
      &lt;/rows&gt;
  &lt;/table&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p>In the page, this is the javascript that works with this:</p>
  
  <pre><code>// this is my global variable for getting the elements so I just get the most
  // I can in one call    
  
  elemCollection = iDom3.Table.all["spis"].XML.DOM.selectNodes("/suite/table/rows/row").context;
  
  //then I have the method that uses this by getting the subresults from elemCollection
  //rest of the method isn't interesting, only the selectNodes call
  
  _buildResults = function (){
          var _RowList = elemCollection.selectNodes("/data[@col = 'urGod']/title");
          var tmpResult = [''];
          var substringResult="";
          for (i=0; i&lt;_RowList.length; i++) {
              tmpResult.push(_RowList[i].text,iDom3.Global.Delimiter);
          }
  ...
  
  
  //this variant works
  
  elemCollection = iDom3.Table.all["spis"].XML.DOM
  
  _buildResults = function (){
          var _RowList = elemCollection.selectNodes("/suite/table/rows/row/data[@col = 'urGod']/title");
          var tmpResult = [''];
          var substringResult="";
          for (i=0; i&lt;_RowList.length; i++) {
              tmpResult.push(_RowList[i].text,iDom3.Global.Delimiter);
          }
  
  ...
  </code></pre>
  
  <p>The problem is, I can't find a way to use the subresults to get what I need.</p>