Hyphenation

The hyphenation for blocks is automatically generated in various languages.

In this section the use of the hyphenate and the xml:lang attributes shall be shown by a short example. The attributes control the automatic hyphenation in text blocks.

Excerpt from the DTD:

<!ELEMENT P (#PCDATA | ...)*><!-- Text paragraph -->

Stylesheet:

<xsl:template match="P">
   <fo:block text-align="justify" hyphenate="true" xml:lang="en">    ❶
      <xsl:apply-templates/>
   </fo:block>
</xsl:template>

❶ Whether the hyphenation shall be performed at a line break or not is determined with the hyphenate attribute and its setting to false or true. When setting the value true, the hyphenation is activated. Since the hyphenation may be inherited to given substructures, it can be switched off with the false value if it is not wanted in a lower level. xml:lang indicates which rules or patterns shall be valid for the hyphenation. In this example en is set for the application of the English hyphenation rules.

 

<< 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, hallo@dpunkt.de