ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> exslt
exslt
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved