I know that there is a workaround (which is obvious), but I just wanted to
report it.  position() is supposed to return the position of the node within
the current node list.  So i'd expect 1,2,3,4...N.  It's just strange why it
would behave otherwise.  As for doing it this way?  I'm just playing around
and noticed it.  this isn't production code at all.

----- Original Message -----
From: "Matt McClanahan" <[EMAIL PROTECTED]>
To: "Ken Egervari" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 1:48 PM
Subject: Re: [PHP-DEV] XSLT bug


> On Thu, Apr 18, 2002 at 12:57:21AM -0400, Ken Egervari wrote:
>
> > If I have an XML document with 2 applications nodes and the following
> > template in the style sheet
> >
> > <xsl:template match="application">
> >     <xsl:number format="a" value="position()" />
> >     <xsl:value-of select="@name" />
> >     <br />
> > </xsl:template>
> >
> > the result is
> >
> > b. the name
> > d. the name2
> >
> > When I think it should be "a. " and "b .".  For some reason,
> > position() is returning the wrong result.
>
> Out of curiousity, why are you forcing the <xsl:number> value?  With
> value="position()" I see the same numbering (b, d) as you when I test
> it with xsltproc (Which doesn't use sablotron).  Taking the value
> attribute out gives the desired a, b listing.
>
> So, perhaps it's not a bug, but instead sablotron was doing it wrong
> beforehand, and has been fixed.  When behavior changes, it doesn't
> always mean that the old behavior was correct.
>
> Matt
>


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to