OK, so the issue is that the module which supports German-language numbering is installed/configured in one of these environments but not the other. I think the most likely explanation for that is that you are using a plain net.sf.saxon.Configuration rather than an EnterpriseConfiguration. When Saxon runs from the command line, it will load the best configuration available - in other words, if it can load the EnterpriseConfiguration class then this will be used. When you run from an application, a lot depends on which APIs you are using. For example, with s9api you need to call new Processor(true); with JAXP it may depend on the setting of the javax.xml.transform.TransformerFactory system property. So we need to know how you are first loading Saxon from the application.

Another possibility is that you have loaded an EnterpriseConfiguration but it is running without a license file, in which case many Saxon-EE features will be disabled but execution will continue.

Michael Kay

On 02/02/2012 17:28, Marzilli Dave wrote:



From: Michael Kay [mailto:mike@saxonica.com]
Sent: Thursday, February 02, 2012 7:25 AM
To: saxon-help@lists.sourceforge.net
Subject: Re: [saxon] format-date() Language/locale issue


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



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


Hi, Thanks for getting back to me.


Answering your questions:


(a)    The version is 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).




CONFIDENTIALITY: This communication, including attachments, is for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, or distribution or the taking of any action in reliance upon this information is strictly prohibited. If you are not the intended recipient, please notify the sender immediately and delete this communication and destroy all copies.

Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!

saxon-help mailing list archived at http://saxon.markmail.org/