Hi Cristine,

Thanks for your reply. I think adapting the code generating the source xml is the way to go.

However I'm a bit surprised as http://www.w3.org/TR/xmlschema-2/#float says "For example, -1E4, 1267.43233E12, 12.78e-2, 12 , -0, 0 and INF are all legal literals for float" and I would have thought XSLT and XML Schema share the same datatypes.

Cheers,
reto

Christine Li wrote:

Hi, Reto

My previous email didn't really response to your question. Henry Zongaro pointed to me (Thanks, Henry for correcting me) that string value 9.983066E-6 doesn't match XPath 1.0 syntax for a number. number("9.9E-6") will return NaN. xsl:sort will work, however, the return won't be the expected result.

You'd better change the format of those string values. If you really need to use scientific notation represents numbers, you may have to write a user extension function to do the conversion from string to double.

Hope it helps,

Christine Li
XSLT Development
IBM Toronto Lab
Tel: (905)413-2601
Email: [EMAIL PROTECTED]


*Reto Bachmann-Gmür <[EMAIL PROTECTED]>*

17/03/2006 04:42 AM

        
To
        [email protected]
cc
        
Subject
        exponent in number and sorting



        





hello

My xml contains number in the following format:

<ns6:childStrength rdf:datatype="http://www.w3.org/2001/XMLSchema#float";>9.983066E-6</ns6:childStrength> <ns6:childStrength rdf:datatype="http://www.w3.org/2001/XMLSchema#float";>0.0023</ns6:childStrength>

I'm using xsl:sort with data-type="number", however xalan doesn't seem to regard 9.983066E-6 as being smaller than 0.0023. Any way to tell xalan to do this?

Cheers,
reto



Reply via email to