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

Re: Can you embed a filter test ahead of the format-nu

Subject: Re: Can you embed a filter test ahead of the format-number function in the xsl:value-of method
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Thu, 8 Nov 2001 02:44:07 +0100
filter te
I had already the apprehension! But if it is so, I can't help you too. The
only thing, what I can suggest, is, changing your <xsl:if> to the following:

<xsl:if test="number(@attribute2)">
    <xsl:value-of select="format-number(@attribute2,"#,###.00")"/>
</xsl:if>

So text-values of @attribute2 won't be formatted to NaN too.

Regards,

Joerg

> Joerg
>
> I would try your suggestion but I should have
> added that there are other things I need to
> do inside the for-each so the filter
> on the for-each would restrict the availability
> of the returned result set ....
>
>  <xsl:for-each select="NodeSomething">
> .
> <!-- do some other xslt things with all the other nodes and their
> attributes... etc --> .
> .
>  <!-- just format the value of attribute2 if in face attribute2 is non
> blank -->
>  <xsl:if test="./@attribute2 != ''">
>   <xsl:value-of select="format-number(./@attribute2,"#,###.00")"/>
>  </xsl:if>
>  </xsl:for-each>
>
> therefore...
>
> I need a less code bloat filter on attribute2 when it comes time in
> the syntax to begin working with attribute2....
>
>  <xsl:for-each select="NodeSomething">
> .
> <!-- do some other xslt things with all the other nodes and their
> attributes... etc -->
> .
>       <!-- just format the value of attribute2 if in face attribute2 is
non
> blank -->
>   <xsl:value-of select="[./@attribute2 !=
> '']format-number(./@attribute2,"#,###.00")"/>
>  </xsl:for-each>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.