Firefox XSLT position()

David <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization Guest of ProXad - France
Message-ID <[email protected]>
Hi all,
As a newby, I don't understand the position() in Firefox.
Here my XML sample.

<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="aaa.xsl"?>
<AAA>
   <BBB>a</BBB>
   <BBB>b</BBB>
   <BBB>c</BBB>
</AAA>


Here my two XSLT tests
1.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

<xsl:template match="/">
   <html>
     <body>
       <p>(<xsl:value-of select="position()" />)</p>
       <xsl:apply-templates/>
     </body>
   </html>
</xsl:template>

<xsl:template match="BBB">
       <p>(<xsl:value-of select="position()" />)
       <xsl:value-of select="." />
       </p>
</xsl:template>

</xsl:stylesheet>


2.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">

<xsl:template match="AAA">
   <html>
     <body>
       <p>(<xsl:value-of select="position()" />)</p>
       <xsl:for-each select="BBB">
       <p>
         (<xsl:value-of select="position()"/>)
         <xsl:value-of select="."/>
       </p>
       </xsl:for-each>
     </body>
   </html>
</xsl:template>

</xsl:stylesheet>

What I expect is something like:

(1)

(1) a

(2) b

(3) c

For 1. I have :

(1)

(2) a

(4) b

(6) c

For 2.  I have:

(2)

(1) a

(2) b

(3) c

Is there something wrong about position() on Firefox
or I do something wrong ?
(I have test a little on IE and it seems to work as expected)

Thanks for you light.
David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.