title: How to select the nth item in xpath 1.0?
body: <p>I have some XML and an XPath query. I'm using Yahoo! widgets, so I'm using XPath 1.0.</p>
  
  <p>Here's the gist of my XML...</p>
  
  <pre><code>&lt;root&gt;
      &lt;cat num="SOURCE"&gt;
          &lt;movie&gt;
              &lt;swf&gt;speak.swf&lt;/swf&gt; 
              &lt;width&gt;250&lt;/width&gt; 
              &lt;height&gt;150&lt;/height&gt; 
              &lt;colour&gt;cccccc&lt;/colour&gt; 
          &lt;/movie&gt;
          &lt;movie&gt;
              &lt;swf&gt;inertia.swf&lt;/swf&gt; 
              &lt;width&gt;380&lt;/width&gt; 
              &lt;height&gt;130&lt;/height&gt; 
              &lt;colour&gt;9a9a9a&lt;/colour&gt; 
          &lt;/movie&gt;
          &lt;movie&gt;
              &lt;swf&gt;swing.swf&lt;/swf&gt; 
              &lt;width&gt;380&lt;/width&gt; 
              &lt;height&gt;130&lt;/height&gt; 
              &lt;colour&gt;9A9A9A&lt;/colour&gt; 
          &lt;/movie&gt;
          ....
  </code></pre>
  
  <p>Now... if I run this query:</p>
  
  <pre><code>"root/cat/movie/swf"
  </code></pre>
  
  <p>I get 42 results, all 'swf' nodes which is correct.</p>
  
  <p>If however, I just want the 6th one, I'd like to be able to do:</p>
  
  <pre><code>"root/cat/movie/swf[6]"
  </code></pre>
  
  <p>But I get a list containing 0 nodes.</p>
  
  <p>Weirdly, using [1] (And no other value) yields my list of all 42 nodes.</p>
  
  <p>Clearly I'm missing something quite fundamental here. Anyone see what it is?</p>