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

Re: Conditional xsl:use-attribute-sets

Subject: Re: Conditional xsl:use-attribute-sets
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Mon, 1 Jun 2009 13:37:06 -0700
Re:  Conditional xsl:use-attribute-sets
Thanks for the replies, I get it now.  I was exploring this option:

            <xsl:attribute name="xsl:use-attribute-sets">
                <xsl:if test="position() mod 2 = 0">
                    <xsl:text>alt-</xsl:text>
                </xsl:if>
                <xsl:text>table-row-background</xsl:text>
            </xsl:attribute>

..but quickly realize that the attribute-sets are (in simple terms)
resolved on load of the stylesheet, rather, applied to the stylesheet
so the above is out of context again.  I think I have that correct.

Ken, the attribute sets for me are still valid, and the alternate row
style is a no biggy, I can deal with that.  I was previously calling
templates which i prefaced them as "typical" for example
"typical.background-grey", so familiar with this approach.

Thanks,
Karl..



On Mon, Jun 1, 2009 at 1:01 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
>>
>> Am I doing something wrong because this is not working:
>>
>>         <fo:table-row hyphenate="true">
>>             <xsl:if test="position() mod 2 = 0">
>>                 <xsl:attribute
>> name="xsl:use-attribute-sets">background-gray</xsl:attribute>
>>             </xsl:if>
>>
>> Is that the correct way to call an attribute set conditionally?
>
> No. Guessing at syntax isn't a good way of finding out what the spec allows
> - and this particular guess is miles off.
>
> Attribute sets are only useful if you know statically which attributes you
> want to add. Usually you're likely to know statically what the attribute
> values will be as well - though the value can in fact depend on the context
> node or on global variables.
>
> Regards,
>
> Michael Kay
> http://www.saxonica.com/
> http://twitter.com/michaelhkay

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.