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

Re: more attribute fun...

Subject: Re: more attribute fun...
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Tue, 19 Mar 2002 00:19:44 +0100
Re:  more attribute fun...
The shortest way I know:

<path fill="yellow">
    <xsl:if test="$fill-percentage > 90">
        <xsl:attribute name="fill">green</xsl:attribute>
    </xsl:if>
</path>

Regards,

Joerg

> After some great responses from people (thank you), I
> found some great solutions for adding an offset to a
> value within an attribute. Some people suggested using
> the attribute template method. IE:
> 
> <path d="M 35, {$y_offset + 25} ..."/>
> 
> This worked great, but now I was wondering about
> calculating something in an attribute and then
> outputing the result. What I mean by this is something
> to the effect of:
> 
> <path d="M 35... fill="{fill_percentage > 90 ? green :
> yellow}" />
> 
> so having some sort of conditional that I can use to
> check the percentage filled and output a different
> color if greater than 90 percent. Can I do something
> like this? Or am I going to have to go to the older
> method of doing things, ie:
> 
> <path>
>     <xsl:attribute name="fill">
>         <xsl:choose>
>           <xsl:when test="$fill_percentage > 90">
>             <xsl:text>green</xsl:text>
>           </xsl:when>
>             .
>             .
>             .
>         </xsl:choose>
>     </xsl:attribute>
> </path>
> 
> Thanks for any help or suggestions,
> 
> Bryan


 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.