XML technologies / XSL-FO / Reference / Antenna House Formatter XSL Extensions / Elements / hyphenation-info
(Excerpt from “XSL-FO ― The Reference” by Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Category Extension for Hyphenations
Common usage: | Specifies additional hyphenation information. This element doesn't generate the area tree. This feature is not available in CSS. This feature is not available with AH Formatter V6.3 Lite. [no-LT] | ||
Areas: | None. | ||
Constraints: | <!ELEMENT axf:hyphenation-info (%axh-elements;)*> <!ATTLIST axf:hyphenation-info language CDATA #REQUIRED> <!ATTLIST axf:hyphenation-info src CDATA #IMPLIED> The axf:hyphenation-info extension element can be set as many as you want right under fo:declarations.
| ||
Contents: | %axs-settings; is an element which belongs to the name space http://www.antennahouse.com/names/XSL/Hyphenations. The elements in the Hyphenation Exception Dictionary are included in the name space, however currently only <exceptions> (and its child element, <hyphen>) can be described. | ||
Examples: | <fo:declarations> <axf:hyphenation-info language="eng" src="en-add.xml" xmlns:axh="http://www.antennahouse.com/names/XSL/Hyphenations"> <axh:exceptions> abc-defg </axh:exceptions> </axf:hyphenation-info> </fo:declarations> In this example, an additional exception dictionary, en-add.xml is specified for English language, and then the exception hyphenation is specified for the word spelled abcdefg.
|
XSL-FO sample:
<fo:root font-size="12pt" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
<axf:document-info name="author" value="Alex Critchfield, Antenna House"/>
<axf:document-info name="keywords" value="extensions, document-info"/>
<axf:document-info name="subject" value="document-info extension"/>
<axf:document-info name="title" value="document-info extension demonstration"/>
<fo:layout-master-set>
<fo:simple-page-master page-width="8.5in" page-height="11in" master-name="main">
<fo:region-body region-name="body" margin-top="1in" margin-bottom="1in" margin-left=".75in" margin-right=".75in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:declarations>
<axf:hyphenation-info language="en">
abcd-efg
</axf:hyphenation-info>
</fo:declarations>
<fo:page-sequence master-reference="main">
<fo:flow flow-name="body">
<fo:block>
This FO has a declaration section that changes the hyphenation configuration when it is formatted but only for this document. This document has a hyphenation rule for the word "abcdefg" to hyhpenate after the "d".
<fo:block-container space-before="5mm" space-after="5mm" padding="5pt" border="2pt solid blue" width="1in">
<fo:block>
no hyphenation
<fo:block/>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</fo:block>
</fo:block-container>
<fo:block-container space-before="5mm" space-after="5mm" padding="5pt" border="2pt solid blue" width="1in" hyphenate="true" language="en">
<fo:block>
with hyphenation
<fo:block/>
abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg abcdefg
</fo:block>
</fo:block-container>
<fo:block space-before="5mm" font-family="monospace" white-space-treatment="preserve" linefeed-treatment="preserve">
<fo:declarations> <axf:hyphenation-info language="en" xmlns:axh="http://www.antennahouse.com/names/XSL/Hyphenations"> <axh:exceptions> abcd-efg </axh:exceptions> </axf:hyphenation-info></fo:declarations>
</fo:block>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>Output: