Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Conditional xsl:use-attribute-sets

From: Karl Stubsjoen <kstubs@-----.--->
To: xsl-list@-----.------------.---
Date: 6/1/2009 8:38:00 PM
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@s...> 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
>
>
> --~------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@l...>
> --~--
>
>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent