docbook-apps

  • 1.  Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-14-2017 23:33
    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
    elemewnt, also be added to
    the


  • 2.  Re: [docbook-apps] Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-15-2017 01:48
    Hi Leif,
    This can be easily done by adding the following to your customization layer:

    <xsl:template name="root.attributes">
    <xsl:call-template name="xml.language.attribute"/>
    </xsl:template>

    This makes use of two utility templates. The 'root.attributes' template
    is called right after the opening tag of , and it should output
    xsl:attribute elements.

    The 'xml.language.attribute' will generate an xml:lang attribute name
    and value.

    I'd like to hear from members of the mailing list about whether you
    think this should be default behavior or not.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net

    On 2/14/2017 3:33 PM, Leif Halvard Silli wrote:
    > 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
    elemewnt, also be added to
    > the


  • 3.  Re: [docbook-apps] Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-15-2017 07:37
    On 15 February 2017 at 01:48, Bob Stayton <bobs@sagehill.net> wrote:
    > Hi Leif,
    > This can be easily done by adding the following to your customization layer:
    >
    > <xsl:template name="root.attributes">
    > <xsl:call-template name="xml.language.attribute"/>
    > </xsl:template>
    >
    > This makes use of two utility templates. The 'root.attributes' template is
    > called right after the opening tag of , and it should output
    > xsl:attribute elements.
    >
    > The 'xml.language.attribute' will generate an xml:lang attribute name and
    > value.
    >
    > I'd like to hear from members of the mailing list about whether you think
    > this should be default behavior or not.


    Fair request IMHO. Every element? Suggest that is too much.
    A parameter on the root element, then customisation thereafter perhaps?
    Pareto: suggest most documents will major in one language with (small?)
    parts in another?

    regards




    >> 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
    elemewnt, also be added to
    >> the


  • 4.  Re: [docbook-apps] Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-15-2017 23:04
    Hi Bob and Dave,

    One thing that has held me back from using DocBook is that the XSLT
    XHTML transformation results I have seen, has not been up to my
    expectations. So, thanks for your great feedback. See more below.

    On 15 Feb 2017, at 8:37, Dave Pawson wrote:
    > On 15 February 2017 at 01:48, Bob Stayton <bobs@sagehill.net> wrote:
    >> Hi Leif,
    >> This can be easily done by adding the following to your customization
    >> layer:
    >>
    >> <xsl:template name="root.attributes">
    >> <xsl:call-template name="xml.language.attribute"/>
    >> </xsl:template>
    >>
    >> This makes use of two utility templates. The 'root.attributes'
    >> template is
    >> called right after the opening tag of , and it should output
    >> xsl:attribute elements.
    >>
    >> The 'xml.language.attribute' will generate an xml:lang attribute name
    >> and
    >> value.

    Thanks. This works very well. It even works for the lang attribute:
    <xsl:template name="root.attributes">
    <xsl:call-template name="language.attribute"/></xsl:template>

    >> I'd like to hear from members of the mailing list about whether you
    >> think
    >> this should be default behavior or not.

    (1) According to the i18n community of the W3.org:

    «Always use a language attribute on the html tag to declare the
    default language of the text in the page. When the page contains content
    in another language, add a language attribute to an element surrounding
    that content.»

    See
    https://www.w3.org/International/questions/qa-html-language-declarations

    (2) I try to follow the same attitude when I create a DocBook document:
    I declare the (main) document language on the root element.

    (3) If this community agree that the XSLT sheet should declare the
    language on the element, then, in addition, the XSLT sheet should
    stop declaring the language on the stand-in element for the DocBook root
    element (in this case, this means that the language should not be
    declared on the HTML
    element). It is no error
    to repeat the declaration, but it is not necessary.

    Can this be can be avoided?

    > Fair request IMHO.

    Thanks.

    > Every element? Suggest that is too much.

    Of course. On every HTML root element, only: . That is: The one
    and only element. Anything else is too much - unless you need to
    override the language declaration on the root element (because the text
    switches to/from another language).

    > A parameter on the root element, then customisation thereafter
    > perhaps?
    > Pareto: suggest most documents will major in one language with
    > (small?)
    > parts in another?

    Indeed.

    Btw, I think the main reason for the issuees we here discuss is the fact
    that the DocBook vocabulary does not match the HTML vocabulary. Which
    reminds me of another, perhaps minor, issue:

    If the DocBook title element happens to be in German, while the document
    otherwise is in English (Example:
    <info></info>...
    ), then the XSLT sheet
    should declare the language on the
    ..... Currently, the language is declared on the stand-in element
    of the DocBook

    Nein …

    * Wanted result:


    Nein …
    --
    leif halvard silli



  • 5.  Re: [docbook-apps] Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-16-2017 07:18
    On 15 February 2017 at 23:04, Leif Halvard Silli <verktystell@russisk.no> wrote:

    > Btw, I think the main reason for the issuees we here discuss is the fact
    > that the DocBook vocabulary does not match the HTML vocabulary.

    Nor did it ever intend to. It is a 'different' language.


    Which
    > reminds me of another, perhaps minor, issue:
    >
    > If the DocBook title element happens to be in German, while the document
    > otherwise is in English (Example:
    <info></info>...
    ), then the XSLT sheet should
    > declare the language on the
    > ..... Currently, the language is declared on the stand-in element of
    > the DocBook


  • 6.  Re: [docbook-apps] Conversion: xml:lang not added to root element of Epub/XHTML1/XHTML5 files

    Posted 02-17-2017 18:35
    On 16 Feb 2017, at 8:18, Dave Pawson wrote:

    > On 15 February 2017 at 23:04, Leif Halvard Silli
    > <verktystell@russisk.no> wrote:
    >
    >> Btw, I think the main reason for the issuees we here discuss is the
    >> fact
    >> that the DocBook vocabulary does not match the HTML vocabulary.
    >
    > Nor did it ever intend to. It is a 'different' language.

    Indeed. And /care/ for optimal HTML-transformation(s) is therefore
    necessary.

    >> Which
    >> reminds me of another, perhaps minor, issue:
    >>
    >> If the DocBook title element happens to be in German, while the
    >> document
    >> otherwise is in English (Example:
    <info></info>...
    ), then the XSLT sheet
    >> should
    >> declare the language on the
    >> ..... Currently, the language is declared on the stand-in
    >> element of
    >> the DocBook