Petr,
well this is right, but the problem is that you need to display the 
footnote numbers in the text. Here, you can't create context consisting 
of all footnotes (like you do using for-each).

Tom

Petr Cimprich wrote:

> Örvar Kárason wrote:
> 
>> Yes , position() works for me when i'm listing the footnotes at the 
>> bottom
>> of the page. But what I need is to numerate them as they appear in the
>> main body of the document.
>> 
>> <xsl:template match="footnote">
>>   <SUP><FONT SIZE="-1">
>>   <A NAME="#BODY{ ??????? }">
>>   <A HREF="#FOOT{ ??????? }"> <!-- jump to the footnote at
>>                         bottom of page -->
>>   <xsl:number/> <!-- doesn't work! -->
>>   </A></A>
>>   </FONT></SUP>
>> </xsl:template>
>> 
>> Using position() here does not work since every paragraph, heading 
>> etc. is
>> a new context, so that the footnotes start from 1 in every context.
>> 
> If you iterate your footnotes using xsl:for-each select="//footnote", 
> you get all of them to one nodeset and position() refers to their 
> order of appearance. Look at the attached example.
> 
> Petr
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0"?> 
> <data>
> 
>   <item>no.1</item>
>   
>   <sub1>
>     <item>no.2</item>
>     <sub2>
>       <item>no.3</item>
>     </sub2>
>   </sub1>
> 
>   <item>no.4</item>
> 
> 
> </data>
> 
> 
> ------------------------------------------------------------------------
> 
> <?xml version="1.0"?> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   version="1.0">
> 
>   <xsl:template match="data">
> 
>     <xsl:for-each select="//item">
> 
>       <xsl:text><!-- linebreak only -->
>       </xsl:text>
> 
>       <xsl:value-of select="concat(.,' - nodeset position: ',position())"/>
> 
>     </xsl:for-each>
> 
>   </xsl:template>
> 
> </xsl:stylesheet>
> nodeset.xml
> 
> Content-Type:
> 
> text/xml
> Content-Encoding:
> 
> 7bit
> 
> 
> ------------------------------------------------------------------------
> nodeset.xsl
> 
> Content-Type:
> 
> text/xml
> Content-Encoding:
> 
> 7bit
> 
> 

Reply via email to