Stylesheets

There are a number of reasons why it is useful to be able to separate formatting instructions from the elements they apply to, including authoring efficiency, gaining the ability to reuse the styles, and the creation of smaller documents.

Remote formatting instructions

In order to remove formatting instructions from the elements they apply to, it is necessary to create a formatting rule to hold them, and to map the rule back to all the elements it applies to by reference instead. The following examples map a rule to all Paragraph element instances (using two of the standards discussed later):

						para { font-size:10pt ; color:black }


<xsl:template match="para"> <fo:block font-size="10pt" color="black"> <xsl:apply-templates/> </fo:block> ...

Get XML Companion, The, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.