[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Question 2: consolidating footnotes/numbering with

Subject: RE: Question 2: consolidating footnotes/numbering with same idref
From: Americo Albuquerque <melinor@xxxxxxxx>
Date: Fri, 17 Oct 2003 00:43:11 +0100
footnotes numbering
Hi

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Whitney, Dan (CanWest Interactive)
> Sent: Thursday, October 16, 2003 9:02 PM
> To: 'mulberry - xsl'
> Subject:  Question 2: consolidating footnotes/numbering 
> with same idref
> 
(...) 
> Works great but want to consolidate the numbering for the 
> riref elements like so:
> 
> <table>
>    <tr>
>       <td>Row 1 - Column 1<sup>1</sup></td>
>       <td>Row 1 - Column 2</td>
>       <td>Row 1 - Column 3<sup>2</sup></td>
>       <td>Row 1 - Column 4</td>
>       <td>Row 2 - Column 1</td>
>       <td>Row 2 - Column 2<sup>3</sup></td>
>       <td>Row 2 - Column 3</td>
>       <td>Row 2 - Column 4<sup>1</sup></td>
>    </tr>
> </table>
> <table>
>    <tr>
>       <td>
>          <tr>
>             <td><b>1. </b>Footnote 1
>             </td>
>          </tr>
>          <tr>
>             <td><b>2. </b>Footnote 2
>             </td>
>          </tr>
>          <tr>
>             <td><b>3. </b>Footnote 3
>             </td>
>          </tr>
> <!-- don't want this output  
>         <tr>
>             <td><b>4. </b>Footnote 1
>             </td>
>          </tr>
>       </td>
>    </tr>
> -->
> </table>
> 
Try this stylesheet:

  <xsl:key match="RIREF" name="RIREF" use="@refid"/>

  <xsl:template match="RS">
    <table>
      <tr>
        <xsl:apply-templates select="RI"/>
      </tr>
    </table>
    <table>
      <xsl:apply-templates mode="footnote"
select="RI/RIREF[generate-id()=generate-id(key('RIREF',@refid)[1])]"/>
    </table>
  </xsl:template>

  <xsl:template match="RI">
    <td>
      <xsl:apply-templates select="text()"/>
      <xsl:apply-templates
select="../RI/RIREF[@refid=current()/RIREF/@refid][generate-id()=generat
e-id(key('RIREF',@refid)[1])]"/>
    </td>
  </xsl:template>

  <xsl:template match="RIREF">
    <sup>
      <xsl:number count="RIREF" format="1" from="RS" level="any"/>
    </sup>
  </xsl:template>

  <xsl:template match="RIREF" mode="footnote">
    <tr>
      <td>
        <b>
          <xsl:number count="RIREF" format="1. " from="RS" level="any"/>
        </b>
        <xsl:value-of select="."/>
      </td>
    </tr>
  </xsl:template>

Regards,
Americo Albuquerque


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.