Re: [exslt] Need help on using Math Functions
by Florent Georges other posts by this author
May 18 2007 2:36AM messages near this date
[exslt] Need help on using Math Functions
|
Re: [exslt] Need help on using Math Functions
& XSLT "Ngo, Cathy T CIV NSWCCD W. Bethesda, 2230" wrote:
Hi
> The error that I got as "Microsoft JScript runtime error
> Wrong number of arguments or invalid property assignment
> line = 2, col = 20 (line is offset ...". I tried to call
> math function at xsl:stylesheet section
> <xsl:variable name="price" select="catalog/cd/price[position()=1]" />
> <xsl:variable name="value" select="math:sqrt($price)" />
$price contains all the price elements that are the first
price element within their cd parent element. So with your
sample input, $price will contain a node-set with *two*
elements.
math:sqrt <http://www.exslt.org/math/functions/sqrt/index.html>
takes one (and only one) number in argument. So your error.
It is like you want in the for-each to take the price
element of the current cd element instead:
<xsl:for-each select="catalog/cd">
<xsl:value-of select="price"/>
<xsl:value-of select="math:sqrt(price)"/>
</xsl:for-each>
Regards,
--drkm
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Ques
tions/Réponses
http://fr.answers.yahoo.com
_______________________________________________
exslt mailing list
list@[...].org
http://www.exslt.org/list
Thread:
Cathy T CIV NSWCCD W. Bethesda
Florent Georges
Florent Georges
James Fuller
|