[ http://issues.apache.org/jira/browse/XALANJ-2157?page=comments#action_12315697 ]
Franz Fackelmann commented on XALANJ-2157: ------------------------------------------ Brian, I found the collator factory feature while scanning the source code of XSLTC for a possiblity to influence the way xsl:sort is sorting. The default (Java) collator doesn't do the job correctly for most of the languages. The property stuff is a handy mechanism and actually I'm already using it in our application :-) This property seems to be an undocumented feature (at least I didn't find anything in the Xalan docs). Hope it will stay there in future Xalan-J versions. Re: The question is, is it OK for Xalan-J interpretive to have buildtime/runtime dependencies on XSLTC? Actually I don't like it either, that Xalan-J interpretative depends on the XSLTC collator factory property. I used it just like that to illustrate my feature request. I think it would be nice if the COLLATOR_FACTORY property would become something common for both Xalan types (interpretative and compiled) but I don't know where this could be. > Definition of CollatorFactory for XalanJ without translets > ---------------------------------------------------------- > > Key: XALANJ-2157 > URL: http://issues.apache.org/jira/browse/XALANJ-2157 > Project: XalanJ2 > Type: Improvement > Components: Xalan > Versions: 2.6 > Reporter: Franz Fackelmann > Attachments: org.apache.xalan.transformer.2157.patch.txt, > xalan-j_2_6_0-src-patch2.2-feature.zip > > *** Feature request in org.apache.xalan.transformer.NodeSortKey *** > The class org.apache.xalan.xsltc.dom.NodeSortRecord allows one to use a > user-defined CollatorFactory for sorting. Unfortunatelly this feature works > only in conjuction with translets. It would be nice to have a similar feature > for the non-translet based transformations. > The following patch (relative to NodeSortKey.java,v 1.13) adds this feature > to Xalan: > diff src/org/apache/xalan/transformer/NodeSortKey.java: > 23a24,25 > > import javax.xml.transform.TransformerException; > > > 24a27 > > import org.apache.xalan.xsltc.CollatorFactory; > 117,118c120,145 > < m_col = Collator.getInstance(m_locale); > < > --- > > // Try to use collator factory (as it happens for xsltc) > > String colFactClassname = > > System.getProperty("org.apache.xalan.transformer.COLLATOR_FACTORY"); > > > > if (colFactClassname != null) { > > CollatorFactory _collatorFactory = null; > > try { > > Class candClass = ObjectFactory.findProviderClass(colFactClassname, > > ObjectFactory.findClassLoader(), true); > > Object candObj = candClass.newInstance(); > > _collatorFactory = (CollatorFactory) candObj; > > } > > catch (ClassNotFoundException e) { > > throw new TransformerException(e); > > } > > catch (Exception e) { > > throw new TransformerException(e); > > } > > > > m_col = _collatorFactory.getCollator(m_locale); > > } > > > > if (null == m_col) { > > m_col = Collator.getInstance(m_locale); > > } > > > In addition the following new files are required (see attachement): > src\org\apache\xalan\transformer\ObjectFactory.java > src\org\apache\xalan\transformer\SecuritySupport.java > src\org\apache\xalan\transformer\SecuritySupport12.java -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
