Locale locale = null;
if (null != m_lang_avt)
{
XPathContext xctxt = transformer.getXPathContext();
String langValue = m_lang_avt.evaluate(xctxt, contextNode, this);
if (null != langValue)
{
// Not really sure what to do about the country code, so I use the
// default from the system.
// TODO: fix xml:lang handling.
locale = new Locale(langValue.toUpperCase(), "");
//Locale.getDefault().getDisplayCountry());
if (null == locale)
{
transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode),
XSLTErrorResources.WG_LOCALE_NOT_FOUND,
new Object[]{ langValue }); //"Warning: Could not find locale for xml:lang="+langValue);
locale = Locale.getDefault();
}