title: XSL for-each-group using two group-by parameters: first group by date then by name
body: <p>Hello I'm trying to create grouping in the pdf file
  and I have to use grouping inside another grouping. f.e. group by date, then group by name, then by city... </p>
  
  <pre><code>xml:
  &lt;record&gt;
  &lt;name&gt;Palace1&lt;/name&gt;
    &lt;info&gt;
       &lt;date&gt;2012-01-01&lt;/date&gt; 
       &lt;city&gt;Random1&lt;/city&gt; 
    &lt;/info&gt;
    &lt;info&gt;
       &lt;date&gt;2012-01-01&lt;/date&gt; 
       &lt;city&gt;SuperRandom&lt;/city&gt; 
    &lt;/info&gt;
    &lt;info&gt;
       &lt;date&gt;2012-01-02&lt;/date&gt;
       &lt;city&gt;Random22&lt;/city&gt;       
    &lt;/info&gt;
     ...
  &lt;/record&gt;
  &lt;record&gt;
  &lt;name&gt;Palace2&lt;/name&gt;
    &lt;info&gt;
      &lt;date&gt;2012-01-01&lt;/date&gt;  
       &lt;city&gt;Random99&lt;/city&gt;     
    &lt;/info&gt;
    &lt;info&gt;
      &lt;date&gt;2012-01-02&lt;/date&gt; 
       &lt;city&gt;Random1&lt;/city&gt;     
    &lt;/info&gt;
     ...
  &lt;/record&gt;
  ...
  </code></pre>
  
  <p>So lets say we need to group our records by  date from 2012-01-01 to 2012-01-01 and the group them by name</p>
  
  <p><strong>Date 2012-01-01</strong></p>
  
  <p><em>Place1</em></p>
  
  <p>Random1</p>
  
  <p>SuperRandom</p>
  
  <p><em>Palace2</em></p>
  
  <p>Random99</p>
  
  <p><strong>Date 2012-01-02</strong></p>
  
  <p><em>Palace1</em></p>
  
  <p>Random22</p>
  
  <p><em>Palace2</em></p>
  
  <p>Random1</p>
  
  <p>SO I was using </p>
  
  <pre><code>&lt;xsl:for-each-group select="dt:record" group-by="dt:info/dt:date"&gt;
  &lt;xsl:sort select="dt:date" order="ascending"/&gt;
  
  &lt;fo:block font-weight="bold"&gt; Date: &lt;xsl:value-of select="format-dateTime(dt:date,'[Y0001].[M01].[D01]','en',(),'lt')"/&gt;&lt;/fo:block&gt;
  
   &lt;xsl:for-each select="current-group()"&gt; //here im guessing we should put another for- each-group
  
  
  
   &lt;xsl:for-each-group select="parent::dt:info/dt:record" group-by="dt:name"&gt;
   &lt;fo:block&gt;Place1 &lt;xsl:value-of select="dt:name"&gt;&lt;fo:block&gt;
   &lt;xsl:for-each select="current-group()"&gt;
  
   &lt;fo:block&gt; &lt;xsl:value-of select="dt:info/dt:city"&gt;&lt;/fo:block&gt;
  
   &lt;/xsl:for-each&gt;
   &lt;/xsl:for-each-group&gt;
  
  
  &lt;/xsl:for-each&gt;                 
  
  &lt;/xsl:for-each-group&gt;
  </code></pre>
  
  <p>but this doesn't work... for some reason I get way more record names then I should</p>