Yes, position() should do the job for you. It specifies the position 
within the context node list. When you select footnotes using  
<xsl:for-each select="//footnote">, all of them are in the same node 
list, so position() should work. What is wrong?

Petr


Örvar Kárason wrote:

> Hi all,
> 
> When processing tags for footnotes in my documents I need to re-numerate
> them, so that the first one that appears is 1, then 2, ... etc. The original
> numbering can´t be used since a web page can contain more then one page of
> the original source, and thus more than one footnote number 1, 2 and etc.
> The footnote tag can appear almost anywhere in my document:
> 
> /doc/source/footnote
> /doc/text/heading/footnote
> /doc/text/p/footnote
> ...
> 
> <footnote value="FOOTNOTE_TEXT">ORIGINAL_NUMBER<footnote/>
> 
> FOOTNOTE_TEXT is printed at the bottom of the page.
> ORIGINAL_NUMBER is not used.
> 
> <xsl:number/> seem to be what I need but its not implemented yet.
> 
> <xsl:template match="footnote">
>   <SUP><FONT SIZE="-1">
>   <A NAME="#BODY{ ??????? }">
>   <A HREF="#FOOT{ ??????? }"> <!-- jump to the footnote text at bottom of
> page -->
>   <xsl:number/> <!-- doesn't work! -->
>   </A></A>
>   </FONT></SUP>
> </xsl:template>
> 
> I use position() to solve this when the footnote-text is printed at the
> bottom of the page.
> 
> <xsl:template match="doc">
> ...
>   <OL>
>   <xsl:for-each select="//footnote">
>       <LI>
>         <A NAME="#FOOT{position()}">
>         <A HREF="#BODY{position()}"> <!-- jump up into main text -->
>         <xsl:value-of select="@value"/>
>         </A></A>
>       </LI>
>   </xsl:for-each>
>   </OL>
> ...
> </xsl:template>
> 
> This seems to be such a simple problem, yet I have been unable to find a
> solution to it.
> All help would be most welcome. :)
> 
> Örvar Kárason (XSLT newbie)
> [EMAIL PROTECTED]


-- 
Petr Cimprich
Ginger Alliance Ltd.
www.gingerall.com

Reply via email to