I tried several things to get xsl:number to not use a separator. Maybe it is 
broken. But I still think that you may be
trying to use xsl:number for the wrong purpose.

7.7 Numbering (from XSLT1.0)
"The xsl:number element is used to insert a formatted number into the result 
tree."

I had some trouble getting position() to work, but I think the trick is to make 
sure that the template you use
position() in is invoked from an xsl:apply-templates that establishes the 
desired context.

===================================================
 <xsl:template match="/boo">
  <xsl:apply-templates select="B/C"/>
 </xsl:template>

 <xsl:template match="C">
  <xsl:call-template name="foo">
   <xsl:with-param name="bar" select="position()"/>
   <!-- NO GOOD <xsl:with-param name="bar"><xsl:number 
level="any"/></xsl:with-param> -->
  </xsl:call-template>
 </xsl:template>

 <xsl:template name="foo">
  <xsl:param name="bar"/>
  <xsl:value-of select="$bar*1000"/>
 </xsl:template>
=========================================

Morten Primdahl wrote:

> On Mon, 4 Feb 2002, Frank E. Weiss wrote:
>
> > I'm not sure why you're using xsl:number which creates a string that you
> > later on want to do arithmetic with. Why don't
> > you just use:
> >
> > <xsl:call-template name="foo">
> >   <xsl:with-param name="bar" select="position()"/>
> > </xsl:call-template>
>
> Because position() returns a context sensitive number while
> <xsl:number level="any"/> is not context sensitive, ie.
> <B><C/></B><B><C/></B> the two C elements do not get the
> same number (which they do with position()).
>
> Morten
>
> >
> > Morten Primdahl wrote:
> >
> > > Hi folks,
> > >
> > > <xsl:call-template name="foo">
> > >   <xsl:with-param name="bar"><xsl:number level="any"/></xsl:with-param>
> > > </xsl:call-template>
> > >
> > > <xsl:template name="foo"><xsl:param name="bar"/>
> > >   <xsl:value-of select="$bar"/>
> > > </xsl:template>
> > >
> > > If <xsl:number level="any"/> is greater than 999 formatting is applied
> > > and the value-of prints eg. 1,000 1,001 (comma). Default format for
> > > xsl:number is (to my understanding) "1" - which should not display this
> > > behaviour?
> > >
> > > Anyway, the place I'm using this is in <xsl:value-of select="$bar*1000"/>
> > > which results in NaN when $bar > 999 and has formatting applied. Any
> > > workarounds for this? I tried forcing number(), and tried format-number
> > > which I did not manage to work out the patter system of :|
> > >
> > > Thanks,
> > >
> > > Morten
> >
> >

Reply via email to