xsl-list
[Top] [All Lists]

Re: [xsl] "grouping" footnote numbers

2011-10-17 14:42:05
Hi,

Being away for a week I missed the fun thread about footnote reference numbering.

(I don't want to think about the fact that I think this is fun, assuming only that on this list I'm in good company.)

In any case, I have only one small thing to add:

On 10/11/2011 9:33 AM, was written:
xref[count(.|key('fn',@href)[1])=1]

In XSLT 2.0:

xref[. is key('fn',@href)[1]]

Cheers,
Wendell

So that's what I've got now:

<xsl:key name="fn" match="xref" use="@href"/>
...
<xsl:template match="xref">
   <a href="{@href}">
     <sup>
       <xsl:for-each-group select="key('fn', @href)" group-by="@href">
         <xsl:number level="any" count="xref[count(.|key('fn',@href)[1])=1]"/>
       </xsl:for-each-group>
     </sup>
   </a>
</xsl:template>

I hope my users will be impressed (but since they view most of what we do as 
magic anyway, they probably won't be). Thank you all for your help.

--
======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

--~------------------------------------------------------------------
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>
--~--