title: XSL for Xml to table transformation
body: <p>Following up on my xslt question from yesterday, link found below. </p>
  
  <p><a href="https://stackoverflow.com/questions/13116208/first-last-element-2nd-variation#comment17836389_13116208">first last element 2nd variation</a></p>
  
  <p>I have to output the the first and last page number of each section into a table.</p>
  
  <p>I'm puzzled on where to start. The XSLT 1.0 Solution and XSLT 2.0 Solution would be much appreciated. I would really appreciate any given help.</p>
  
  <p>Regards JJ.</p>
  
  <p>INPUT:</p>
  
  <pre><code>&lt;root&gt;
    &lt;page number="1" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="2" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="3" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="4" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="5" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="6" section="Arsenal"&gt;Arsenal&lt;/page&gt; 
    &lt;page number="7" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="8" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="9" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="10" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="11" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="12" section="Chelsea"&gt;Chelsea&lt;/page&gt; 
    &lt;page number="13" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="14" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="15" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="16" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="17" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="18" section="ManUnited"&gt;ManUnited&lt;/page&gt; 
    &lt;page number="19" section="ManCity"&gt;ManCity&lt;/page&gt; 
    &lt;page number="20" section="ManCity"&gt;ManCity&lt;/page&gt; 
    &lt;page number="21" section="ManCity"&gt;ManCity&lt;/page&gt; 
    &lt;page number="22" section="ManCity"&gt;ManCity&lt;/page&gt; 
    &lt;page number="23" section="ManCity"&gt;ManCity&lt;/page&gt; 
    &lt;page number="24" section="ManCity"&gt;ManCity&lt;/page&gt; 
   &lt;/root&gt;
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <pre><code>&lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Arsenal&lt;/td&gt;&lt;td&gt;6&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;7&lt;/td&gt;&lt;td&gt;Chelsea&lt;/td&gt;&lt;td&gt;12&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;13&lt;/td&gt;&lt;td&gt;ManU&lt;/td&gt;&lt;td&gt;18&lt;/td&gt;&lt;/tr&gt;
  &lt;tr&gt;&lt;td&gt;19&lt;/td&gt;&lt;td&gt;Mancity&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;/tr&gt;
  </code></pre>