On 31/01/2012 20:10, Marzilli Dave wrote:

Hello,

 

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 9.0.3.11j (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()?

 

Thanks,

Dave Marzilli


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 "9.0.3.11" is probably a typo for "9.3.0.11". 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?

Michael Kay
Saxonica