Language support in XSL-FO Stylesheets

Frank Steimke <[email protected]> Thu, 23 Jun 2022 16:07:26 +0200
Newsgroups gmane.text.docbook.apps
Message-ID <[email protected]>
Dear List Members,

i had already sent this to the docbook List, but probably this list 
docbook-apps fits better.

I am using DocBook for a bi-lingual book. Most of the content is written 
in english, but parts are written in the german language. PDF is 
produced with XSL Stylesheets 1.79.2 shipped within Oxygen 24 and the 
Antenna House Formatter v7.

Since most content is english, /book/@xml:lang is 'en'. Fragments in 
german have @xml:lang='de' at the appropriate level, e. g. for section 
or note elements. Sometimes i have phrase or emphasis elements only 
because of the @xml:lang attribute.

Observation is, that hyphenation is wrong in the PDF Document for the 
german fragments. I think i have found the reason, but i am puzzled. 
There are two issues which i can't understand:

1) There is a template named "language.attribute" in I10n.xsl. It 
calculates the language value looking at the ancestor axis, and emits an 
attribute named @lang with that value. *First Issue: *the name of the 
attribute is wrong, the correct name is @language. See section 7.10.2 
"Language" <https://www.w3.org/TR/xsl11/#language>  in Extensible 
Stylesheet Language (XSL) Version 1.1.

2) The template named "language.attribute" is rarely used. *2nd Issue: 
*I had to create a customization layer for the templates that matches 
d:para or d:simpara, which do emit an fo:block element, so that they 
call the language.attribute template. Same for d:phrase and d:emphasis 
in inline.xsl

Maybe i have missed something obvious. Are there any reasons for this 
lack of language support?

Sincerely, Frank Steimke