Subject: Re: [xsl] expression syntax From: David Carlisle <davidc@xxxxxxxxx> Date: Mon, 15 Nov 2004 14:23:51 GMT |
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 ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] expression syntax, M. David Peterson | Thread | Re: [xsl] expression syntax, M. David Peterson |
RE: [xsl] expression syntax, Pawson, David | Date | [xsl] 'nother xslt2 engine, David Carlisle |
Month |