[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sorting the result of a calculation on xml that can ha

Subject: sorting the result of a calculation on xml that can have missing/blank tags
From: Sean <srguard2000-triallicense@xxxxxxxxxxx>
Date: Fri, 16 Dec 2005 11:56:49 +0000 (GMT)
xsl format number 0
Thanks Michael for the answer.

I ran out of time and used format-number() in the calculation - the problem was I had '#' instead
of '0':

<xsl:decimal-format name="MyDecimalFormat" NaN="0" />

...

(format-number(HomePupils, '0', 'MyDecimalFormat')

This also covers converting NaN to zero...

Sean


> Dealing with missing elements and empty elements are actually two slightly
> different problems.
> 
> However, to get a default value of "0", 
> 
>  number(concat('0', string(HomePupils)))
> 
> works in both cases.
> 
> Michael Kay
> 
...
> > I tried using format-number() to replace blanks with '0' and even 'number(0)', but when the
output
> > of format-number is used in a calculation, the result is NaN.
> 
> 

___________
Sean Ryan

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.