xsl-list
[Top] [All Lists]

Re: expression syntax

2004-11-15 07:23:51


me>test="@foo=1"
me>
me>is false if the source has foo="1.0"
me>
me>but 
me>
me>test="number(@foo)=1"
me>
me>would be true in that case.
me>  
me>
you>again, this brings in to light the purpose of the function...

probably did, although actually the example is completely wrong:-)

comparsion of a node set to a number is one place where number() _is_
implictly applied so
@foo=1
is exactly the same as
number(@foo)=1

A better example would be comparing two attributes

@foo = ../@foo

would be false if
this node had foo="1" and its parent had foo="1.0"
as the default is string comparison but 

number(@foo) = number(../@foo)

or even just one side, eg:

number(@foo) = ../@foo

would force numeric comparison so then 1.0 and 1 would be equal.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>