Proposals:
Can the official XSLT converstion files for Epub/XHTML5/XHTML1 be
updated to add the xml:lang attribute to the root element of all HTML
documents?
And/Or how can I at least make it happen in my local version of the XSLT
files?
If XSLT has technical limiations that prevents this behavior, then at
the very least - as a workaround, xml:lang should in addition to be
added to the (in this case) HTML <section> elemewnt, also be added to
the <title> element. (Or else, the title element would be 'hanging in
the air', as an element without language tag assigned.)
Background:
The (x)HTML XSLT conversion sheets for DocBook fails to add a
(xml:)lang) attribute to the <html> element. This happens for Epub,
XHTML1 and XHTMl5 conversion. (I have not tested HTML conversion.)
For instance, if I (1) create an DocBook article document, adding
xml:lang="en" to the DocBook <article> element and then (2) apply
converstion to XHTML5 using the docbook.xsl file found at
cdn.docbook.org [1], then, (3) the end result is a XHTML5 file where
xml:lang is *not* applied to <html> (and not to <body>, for that matter
and not, as a workaround, to <head> or <title> either). The first
occurrence of xml:lang is found only on the <section> element.
By the way: I consider this behavior a bug. And I belive that the reason
for this bug is mechanistic conversion of the DocBook root element (in
this case: <article>) to the HTML element that “we” have decided to
correspond to the root element (for Docbook <article> documents, then
”we” have decided that the corresponding HTML element is the HTML
<section> element). The *correct* behavior ought to have been to
*always* add the xml:lang attribute of the Docbook root element (in this
case: <article>), to the HTML root element of (<html>).
[1] http://cdn.docbook.org/release/xsl/current/xhtml5/docbook.xsl
--
leif halvard silli