OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook] DocBook XSL Stylesheets v1.75.2 uses US date format


I (Øyvind) wrote some days ago:
>  I just regenerated some documentation in a project of mine using the
>  DocBook XSL Stylesheets v1.75.2, and noticed that the generated date
>  at the man page is in the US date format:
>
>      .\"      Date: 04/25/2010
>
>  [...]
>
>      .TH "GPST" "1" "04/25/2010" "[FIXME: source]" "[FIXME: manual]"
>
>  This is ambiguous and prone to errors when the date is for example
>  "01/02/03". Is it 2003-02-01, 2003-01-02, or even 2001-02-03?

Thanks for the answers, Larry and Mauritz. I have created custom XSL
sheets before, but didn't think about doing it this time. For the
record, I ended up with this:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
      <xsl:import
href="/usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl"/>
      <xsl:param name="local.l10n.xml" select="document('')"/>
      <l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0";>
        <l:l10n language="en">

          <!-- Get rid of ambiguous US date format -->
          <l:context name="datetime">
            <l:template name="format" text="Y-m-d"/>
          </l:context>

        </l:l10n>
      </l:i18n>
    </xsl:stylesheet>

and it works great. I still think this default should be changed though,
because both US and UK share the "en" locale, and in the UK "dd/mm/yyyy"
is the default. If the yyyy-mm-dd format is not an option, using the
three letter abbrevation as Larry suggested would be good enough. If
DocBook is meant to be a worldwide standard, it should use an
unambiguous format not tied to a specific locale.

Cheers,
Øyvind A. Holm


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]