Re: Need help on using Math Functions

Florent Georges <[email protected]> Mon, 21 May 2007 15:31:59 +0200 (CEST)
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
"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()).

  If you really want to get only the first node of that
node-set, just write it explicitely in your XPath
expression.

  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! Questions/Réponses 
http://fr.answers.yahoo.com