Simple headlines are text blocks emphasized by typographical means.
This example shall indicate how headlines can be highlighted within the running content and be treated as headlines.
Excerpt from the DTD:
<!ELEMENT Article (Title, ...)> ❶ <!ELEMENT Title (#PCDATA | ...)*> ❷
❶ For the <Title> title element it is assumed that it always has the same name on the various structuring levels (and that it is modelled the same way). In order to make it possible to distinguish the titles typographically according to the structuring level, templates have to be generated for each level.
❷ It is assumed that the contents of <Title> may contain also substructures (e. g. footnote references) in addition to simple character data. This influences the method of content integration in the XSL-FO structure (see stylesheet).
<xsl:attribute-set name="Headline-Title1"> ❶ <xsl:attribute name="font-family">Arial Unicode MS</xsl:attribute> <xsl:attribute name="font-size">18pt</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="text-align">center</xsl:attribute> <xsl:attribute name="space-before">30mm</xsl:attribute> <xsl:attribute name="space-after">10mm</xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute> ❷ </xsl:attribute-set> ... <xsl:template match="Article/Title"> ❸ <fo:block xsl:use-attribute-sets="Headline-Title1" hyphenate="false"> ❹ <xsl:apply-templates/> </fo:block> </xsl:template> ❺
❶ The bundling of typographical features in the structure of <xsl:attribute-set> is recommendable if you want to use the bundling more than once within the stylesheet and if you want to change typographical means only once.
❷ The keep-with-next attribute with its always attribute value effects that the headline is never placed at the bottom column or page margin without a following block (usually a first text paragraph).
❸ The template only refers to <Title> within the <Article> parent element. The appearance and the design of <Title> in another environment is specified in further templates.
❹ For the block in which the content of <Title> shall appear, the typographical features specified in <xsl:attribute-set> are included by the xsl:use-attribute-sets attribute. In addition, the hyphenation being unwanted in headlines is deactivated.
❺ By using <xsl:apply-templates>, the entire content of <Title> including any substructures is copied into the block. If you only want to include the character data contained in <Title> and eliminate the substructures, you have to use <xsl:value-of select="."/>.
|<< back||next >>|
Copyright © dpunkt.verlag GmbH 2004
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "XSL-FO in der Praxis" ("XSL-FO in practice") is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19B, 69115 Heidelberg, fon 06221-14830, fax 06221-148399, email@example.com