This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: class and graphic in FO?
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: yan bai <bytj at yahoo dot com>
- Cc: xsl-list at lists dot mulberrytech dot com
- Date: Sat, 22 Dec 2001 08:54:17 +0000
- Subject: Re: [xsl] class and graphic in FO?
- Organization: Jeni Tennison Consulting Ltd
- References: <20011221193605.10838.qmail@web10002.mail.yahoo.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Yan,
> Just began to work on a project by using XSL-FO. As in html page, we
> can use CSS to define a class to format a html page. I am wondering
> how I can define a class to do a similar trick b/c it is very
> cumbersome for me to set the text formatting for every <fo:block>.
If you're generating XSL-FO using XSLT (as is intended), attribute
sets can be really useful. Define an attribute set for each 'class',
so things like:
<xsl:attribute-set name="paragraph">
<xsl:attribute name="font-size">12</xsl:attribute>
<xsl:attribute name="text-align">justify</xsl:attribute>
...
</xsl:attribute-set>
You can then use an attribute set on a particular fo:block with
xsl:use-attribute-sets:
<fo:block xsl:use-attribute-sets="paragraph">
...
</fo:block>
Attribute sets can be based on other attribute sets, and you can use
several attribute sets on any particular element if you want to (in
effect having several classes).
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list