Re: Need help on using Math Functions

"James Fuller" <[email protected]> Mon, 21 May 2007 16:04:43 +0200
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
Flo

On 5/21/07, Florent Georges <[email protected]> wrote:
> "Ngo, Cathy T CIV NSWCCD W. Bethesda, 2230" wrote:
>
>   Hi
>
> > Thanks for helping my problem. Actually I want define
> > variable and call math function at the stylesheet
> > section. I got answered from Jim Fuller that resolved my
> > problem.
>
> > He wrote:
> > from the error message , it looks related to specific
> > implementation e.g. the msxml script in that it needs a
> > numerica arg.
>
> > try wrapping up your select statement with
>
> > select="number(catalog/cd/price[position()=1])"
>
>   Please don't do that!  This is an example of the more easy
> to write, difficult to track bug in XSLT 1.0.  Your XPath
> expression select a node-set with several nodes, and you
> silently reduce that node-set to its single first node (with
> string() called through number()).


in the past (and we are talking distant past now in internet time)
there were some XSLT processors that needed to be nudged with number()
when doing path...I seem to have a unit test for this (as i did the
exslt math modules) somewhere.

Since u didnt tell me which implementation you were using (and I just
briefly scanned your email)  the brain cell came up with number()
function....listen to Florent as he is right in this situation.

ta, J