XML-Technologien / XSL-FO / Referenz / Antenna House Formatter XSL Extensions / Elements / hyphenation-info

(Auszug aus "XSL-FO ― Die Referenz" von 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.
The language property is indispensable to indicate which language this element is associated with. It is not available to do hyphenation if the specified language is originally not hyphenated. This setting is invalid for Thai.
The src property can optionally specify the exception dictionary. It's an additional setting to the original dictionary and effective only in this FO. There is no language dependency constraint for the file name unlike the original dictionary. It is a relative base-uri for the relative path. It's not a relative path to the environment valuable of the hyphenation dictionary. <exceptions> in the specified dictionary is evaluated. When multiple words of the same spelling are registered, the information on the last registered word becomes effective.

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.

CAUTION:

In the example above, do not use the following setting. (<hyphen/> is disregarded.)

abc<hyphen/>defg

Instead, please make sure to specify

abc<axh:hyphen/>defg

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>

Download der Beispiele

Output:

nach oben