[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] dynamic usage of attribute sets
Hello,
this time I have a question regarding attribute sets. I create a table in XSL FO and have one template for creating the cells: <xsl:template match="iupb:cell"> <fo:table-cell xsl:use-attribute-sets="table-cell"> <fo:block wrap-option="no-wrap"> <xsl:variable name="value" select="iupb:value0|@iupb:value0|@iupb:value1"/> <xsl:choose> <xsl:when test="$value = 'nd'"></xsl:when> <xsl:when test="@iupb:type = 'AMOUNT'"> <xsl:value-of select="format-number($value div 100000, '#.##0')"/> </xsl:when> <xsl:when test="not(@iupb:type) or @iupb:type = 'LABEL'"> <xsl:value-of select="$value"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="format-number($value, '#.##0')"/> </xsl:otherwise> </xsl:choose> </fo:block> </fo:table-cell> </xsl:template> Now I want to use a different attribute set for header cells. According to the spec http://www.w3.org/TR/xslt#attribute-sets only QNames are allowed as value for use-attribute-sets, but not expressions. So I must assume, that it is not possible in general. But has somebody a workaround. Until now I must add the special attributes via <xsl:attribute>: <fo:table-cell xsl:use-attribute-sets="table-cell"> <xsl:if test="parent::iupb:header-cell"> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="text-align">center</xsl:attribute> </xsl:if> ... </fo:table-cell> For a third type (column headers vs. row headers) I had to add still more <xsl:attribute/>s. Does anybody know a smarter way to achieve "dynamic attribute-sets"? Regards, Joerg -- System Development VIRBUS AG Fon +49(0)341-979-7419 Fax +49(0)341-979-7409 joerg.heinicke@xxxxxxxxx www.virbus.de VIRBUS hat jetzt als erster deutscher Softwarehersteller die Zertifizierung für den 3D Secure-Authentifizierungsstandard "Verified by Visa" erhalten. Details unter http://www.virbus.de/de/press/pressemitteilung/20020828_verified_by_VISA. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|