xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Bryant" <...@bryantcs.com>
Subject Re: specify values for attribute once and then refer to it.
Date Mon, 04 Dec 2006 23:41:18 GMT
I set up all my styles as collections of attributes in attribute sets, thus:

  <xsl:attribute-set name="body">
    <xsl:attribute name="font-size">11pt</xsl:attribute>
    <xsl:attribute name="font-family">serif</xsl:attribute>
    <xsl:attribute name="line-height">15pt</xsl:attribute>
    <xsl:attribute name="space-before.optimum">3pt</xsl:attribute>
    <xsl:attribute name="space-after.optimum">3pt</xsl:attribute>
  </xsl:attribute-set>

I keep a whole collection of attribute sets in various files (one or more to a client). Then
I can write 

<fo:block xsl:use-attribute-sets="body">paragraph content</fo:block>

and get all the attributes. This method GREATLY improves readability and consistency, especially
since I can share the same set of styles (in their own file, remember) across multiple documents
(such as all of a customer's user guides).

To link the styles document to your main XSL transform, use the xsl:include command, thus:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="fo xs">

  <xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="no"/>

  <xsl:include href="globe-report-formats.xsl"/>

  <!-- Your transforms here -->

</xsl:transform>

I hope that helps.

Jay Bryant
Bryant Communication Services
  ----- Original Message ----- 
  From: Potje rode kool 
  To: fop-users@xmlgraphics.apache.org 
  Sent: Sunday, December 03, 2006 12:08 PM
  Subject: specify values for attribute once and then refer to it.


  Hi,

  Is it posible to specify on one place some values for attributes and then
  refer to that, a bit like its done with css, where you create a class and refer to it
  with the class attribute in the html element? 

  Thanks.
  Evert

Mime
View raw message