1 16 19 package org.apache.xalan.transformer; 20 21 import java.text.Collator ; 22 import java.util.Locale ; 23 24 import org.apache.xalan.res.XSLTErrorResources; 25 import org.apache.xpath.XPath; 26 27 31 class NodeSortKey 32 { 33 34 35 XPath m_selectPat; 36 37 38 boolean m_treatAsNumbers; 39 40 41 boolean m_descending; 42 43 44 boolean m_caseOrderUpper; 45 46 47 Collator m_col; 48 49 50 Locale m_locale; 51 52 53 org.apache.xml.utils.PrefixResolver m_namespaceContext; 54 55 56 TransformerImpl m_processor; 58 72 NodeSortKey( 73 TransformerImpl transformer, XPath selectPat, boolean treatAsNumbers, 74 boolean descending, String langValue, boolean caseOrderUpper, 75 org.apache.xml.utils.PrefixResolver namespaceContext) 76 throws javax.xml.transform.TransformerException 77 { 78 79 m_processor = transformer; 80 m_namespaceContext = namespaceContext; 81 m_selectPat = selectPat; 82 m_treatAsNumbers = treatAsNumbers; 83 m_descending = descending; 84 m_caseOrderUpper = caseOrderUpper; 85 86 if (null != langValue && m_treatAsNumbers == false) 87 { 88 m_locale = new Locale (langValue.toLowerCase(), 99 Locale.getDefault().getCountry()); 100 101 105 if (null == m_locale) 106 { 107 108 m_locale = Locale.getDefault(); 110 } 111 } 112 else 113 { 114 m_locale = Locale.getDefault(); 115 } 116 117 m_col = Collator.getInstance(m_locale); 118 119 if (null == m_col) 120 { 121 m_processor.getMsgMgr().warn(null, XSLTErrorResources.WG_CANNOT_FIND_COLLATOR, 122 new Object []{ langValue }); 124 m_col = Collator.getInstance(); 125 } 126 } 127 } 128 | Popular Tags |