xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bowditch <bowditch_ch...@hotmail.com>
Subject Re: Is there any equivalent for CSS in XSL-FO
Date Tue, 08 Jun 2004 09:19:48 GMT
Amita Rathore wrote:

ill answer your first question first ....

 > I am looking forward to something similar to CSS. So that I define the
 > formatting at one place and then can reuse the tag whereever required.

in XSL you can define attribute sets which define re-usuable groups of 
properties, e.g.

<xsl:attribute-set name="Large Text">
<xsl:attribute name="font-family">Helvetica</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
<xsl:attribute name="font-size">20pt</xsl:attribute>
<xsl:attribute name="background-color">blue</xsl:attribute>

and then re-call the attribute set in your templates, e.g.

<xsl:template match="p">
<fo:block xsl:use-attribute-set="Large Text">

> I created the following template in the xsl which is using the fo tags:
> <xsl:template match="B">
> <fo:inline font-weight="bold">
> <xsl:apply-templates/>
> </fo:inline>
> </xsl:template>
> As per my understanding if in this xsl i write <fo:block> This is a <B> 
> test </B> </fo:block>, the result should be displayed with "test" in bold.
> But the "test" is not getting displayed at all. Surely I am making a 
> mistake, what is it ?
> I am creating a pdf which needs a lot of formatting. Defining the same 
> font size, color for multiple inlines is redundant.

The template for processing the <B> looks okay by itself, the problem is more 
likely to do with the template(s) that process the parent elements of <B>


To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org

View raw message