xsl-list
[Top] [All Lists]

[xsl] XSL-FO group by problem

2009-10-27 14:01:03
Hello all,
In an XSLT-FO style sheet, I have created groups similar to the one shown at the end of this email. I have one template for formatting the <CatalogNumber> and another for formatting the remaining data. The <CatalogNumber> is always identical in a group, but the remaining information differs. I want a single copy of the <CatalogNumber> and one copy each of all of the remaining information from each <Item>as indicated in the output below (I can format everything, that's not my problem, I just can't get the single copy of the <CatalogNumber>).

Thanks,
Mark

Output:
4: New issues: Czech Republic, May/Jun 1993, p. 22; Letters to the editor, Mar/Apr 2002, p. 27; Joint issues, Nov/Dec 2002, p.18.

My style sheet code is:
<xsl:for-each-group select="Item" group-by="concat(Prefix, CatalogNumber, Range)">
           <fo:block xsl:use-attribute-sets="base">
               <xsl:for-each select="current-group()">

<!-- What do I put here so that I only get one copy of the Catalog Number?
         (This code seems to go into an endless loop.)
-->
                   <xsl:apply-templates select="CatalogNumber" mode="do"/>
                  <xsl:apply-templates select="Title" mode="do"/>

               </xsl:for-each>
           </fo:block>
       </xsl:for-each-group>

Example of a group:
<Item>
     <CatalogNumber>4</CatalogNumber>
     <Title>New issues: Czech Republic</Title>
     <IssueName>May/Jun</IssueName>
     <Year>1993</Year>
     <Page>22</Page>
</Item>
<Item>
    <CatalogNumber>4</CatalogNumber>
    <Title>Letters to the editor</Title>
    <IssueName>Mar/Apr</IssueName>
    <Year>2002</Year>
    <Page>27</Page>
</Item>
<Item>
    <CatalogNumber>4</CatalogNumber>
    <Title>Joint issues</Title>
    <IssueName>Nov/Dec</IssueName>
    <Year>2002</Year>
    <Page>18</Page>
</Item>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--