[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Conditional xsl:use-attribute-sets
At 2009-06-01 12:37 -0700, Karl Stubsjoen wrote:
Am I doing something wrong because this is not working: Unfortunately, attribute sets cannot be added conditionally. I've wanted to do this myself in the past. If you change the attribute set to a called template (no other changes), then you can put the call to the template in the if. Doing so takes away the cumulative nature of attribute sets in an import/include tree, but if that isn't a concern for you, then a called template should do the trick. So, change: <xsl:attribute-set name="my:background-gray"> <xsl:attribute name="background-color">#dddddd</ <xsl:attribute name="border">#222222</ </xsl:attribute-set> to: <xsl:template name="my:background-gray"> <xsl:attribute name="background-color">#dddddd</ <xsl:attribute name="border">#222222</ </xsl:template> and use: <fo:table-row hyphenate="true"> <xsl:if test="position() mod 2 = 0"> <xsl:call-template name="my-background-gray"/> </xsl:if> .... I hope this helps. . . . . . . . . . . . . . Ken
|
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
|