On 31/01/2012 20:10, Marzilli Dave wrote:
I am trying to resolve an issue around language specific “format-date()” behavior, one that seems environment specific. We are seeing different results in one environment than another where we are expecting the same. Both environs use saxon ee 184.108.40.206j (same jar files), same xsl and input xml, both pipe to Apache FOP. Neither environment uses a configuration file. In the XSL writing environment we are running from the command line (through XML Spy), where the output works as expected. In the test environment Saxon is invoked from Java code, where we receive the default language substitution ([Language: en]23 July 2010) noted in other posts here . Is there an environment or machine dependency on format-date()?
Sorry for the delay in responding.
Yes, there is an environment dependency. If no language is specified in the language argument of format-date(), the default is assumed to be the language of the default Java locale, which is generally taken from the user profile defined in the operating system.
The [Language: en] prefix in the output means that the requested language is one which is not recognized/supported in the Saxon configuration, so Saxon is outputting in English instead of the requested language.
I think your "220.127.116.11" is probably a typo for "18.104.22.168". What puzzles me is that at some time, well before 9.3, I made a change such that the [Language: en] prefix is added only if an unsupported language is requested explicitly, rather than if it is requested by virtue of defaults in the user profile.
So three follow-up questions come to mind:
(a) can you confirm which version you are using?
(b) what arguments are you supplying in the call to format-date()?
(c) what is the default language in the current user's profile?
Hi, Thanks for getting back to me.
Answering your questions:
(a) The version is 22.214.171.124 in both environments.
(b) Replacing for substituted variables, <xsl:value-of select="format-date($dateToFormat, ‘[D1] [MNn] [Y1]’, ‘de’, (), ())"/>
(c) In both XSL development (where it works) and server (doesn’t work) environments the default language is English
Note that the language is represented as hardcoded in (b) above but in fact is a variable which resolves to one of four values (en/fr/de/es).