[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: format-number
> Hello Friends, > I need to format a number with a dynamic format (is it > possible first of all > ?) . > I'm doing the following > <xsl:value-of select="format-number( sum(.), '{$fmt}' )" /> > and I get {$fmt}as output. > I need to get the real sum formatted according to the variable $fmt . > > Does anyone knows what am I doing wrong . > Just write: <xsl:value-of select="format-number( sum(.), $fmt )" /> Attribute value templates are used to insert an XPath expression into an attribute value. They aren't used to insert an XPath expression into a string literal within another XPath expression. sum(.) is a bit odd: sum() gives a total over a node-set, and "." is a node-set containing exactly one node. Michael Kay Software AG home: Michael.H.Kay@xxxxxxxxxxxx work: Michael.Kay@xxxxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|