On 06.02.2009 23:29:13 Andreas Delmelle wrote: > On 06 Feb 2009, at 08:19, Apache Wiki wrote: > > Hi Jost, Jeremias > > > '''(R3)''' Decide how the language should be defined. Other > > implementations specify the @xml:lang on fo:root level. The same > > attribute is set for descendant's to override the default language. > > There is also the common FO property {{{country}}} and > > {{{language}}} to consider. > > > > + * [JM] XSL defines {{{xml:lang}}} as a shorthand for > > {{{country}}}/{{{language}}}/{{{script}}}. So both are equivalent > > from a user's perspective. It should be verified that {{{xml:lang}}} > > is properly mapped to the other three properties. Internally, the > > code should work off the basic XSL properties, not the shorthand. > > FWIW: I think I have made sure at one point that the mapping of > xml:lang to country/language should work (see a.o. > org.apache.fop.fo.properties.XMLLangShorthandParser). The mapping to > 'script' is not yet implemented. > Very basically, however, since there is no validation whatsoever at > parse-time of whether the specified value conforms to the ISO > specification. > I see the possibility of adding this, and it doesn't even seem too > complicated.
I remember you working on this some time ago. I just made a note to recheck because accessibility relies on it. However, I don't think supporting "script" is high on the priority list given the restricted capabilities of FOP concerning eastern scripts. > Note that none of those properties apply to fo:root, so we'll probably > have to assume that the natural language of the document is the one of > the first fo:page-sequence. Agreed. > In theory, we always have access to the > specified value on fo:root, ...if the user bothered to specify it there... > but accessing that from the renderer > context may get a bit messy (it exists only in the > 'currentPropertyList' that is available in FOTreeBuilder) We can always expose the values from org.apache.fop.fo.pagination.Root (by adding property variable and adjusting bind()). Not messy at all I would think. But that would be a proprietary extension. If possible I think we should stick to the above rule: Use the first page-sequence for the document language. That should cover 99% of the cases and follows the spec as I understand it. And if anyone needs a different document-level language, we can simply expose language/country on fo:root, right? Jeremias Maerki