On Sat, Sep 08, 2001 at 04:44:04PM +0100, Steve Fosdick wrote:
I now have a mostly complete stylesheet for print which just needs some tuning to make it look prettier but it also seems that I am forever having to repeat font attributes in various different bits of the stylesheet. What I would like to do if I can is to define some defaults for the font attributes to apply to the whole document and then the style template for the each of the various XML elements can just override the ones it needs to. Does anyone know how to do this?
Probably, if I understand you correctly, you wan't to use xsl:attribute-set.
<xsl:attribute-set name="font-attrs"> <xsl:attribute name="color">black</xsl:attribute> </xsl:attribute-set>
<xsl:template match="paragraph"> <xsl:element name="font" use-attribute-sets="font-attrs"> xsl:apply-templates/ </xsl:element> </xsl:template>
See http://nwalsh.com/docs/tutorials/xsl/xsl/foil63.html for more comprehensive examples. Having said that, it would probably be better to use div and span elements with different classes and a CSS stylesheet. Hmm.
Malc