From: Chris T. <chr...@gm...> - 2013-08-26 17:00:55
|
Begin forwarded message: > From: Chris Tomlinson <chr...@gm...> > Subject: Re: Using a Java sort comparator in XQuery > Date: August 26, 2013 11:57:05 AM CDT > To: <mh...@uv...> > > No namespace decls and enable-java-binding="no" in my conf.xml. > > the only thing is to signal the order-by that the collation is done via java by the "java:" prefix on the class name. Here's an example of the collation at work: > > > > Here's the jar file. See if you can get the above to work for you: > > > > Here's the source: > >> xquery version "3.0"; >> >> <list>{ >> let $items := >> (<nm>rdo rje snying po</nm>, >> <nm>dpal ldan</nm>, >> <nm>mkhan po dpal tseg</nm>, >> <nm>khrid yig</nm>, >> <nm>kyis la dreng bu</nm>, >> <nm>gnas pa'i nyid pa</nm> >> ) >> for $i in $items >> order by $i ascending collation "java:org.tbrc.common.server.TibetanCollator" >> return >> <x>{$i}</x> >> }</list> > > > Chris > > > > On Aug 26, 2013, at 11:26 AM, Martin Holmes <mh...@uv...> wrote: > >> I have restarted eXist, and the permissions are clearly right because when eXist calls Saxon using transform:transform, it uses the collator. I don't have to include any special namespaces or anything, do I? In your config file, do you have this: >> >> <xquery enable-java-binding="yes"> >> >> Cheers, >> MNartin >> >> On 13-08-26 08:33 AM, Chris Tomlinson wrote: >>> I don't have anything else in my environment - no configs in modules >>> section of conf.xml and so on. I'm also using eXist 2.1 (rev 18724) in >>> tomcat 7.0.11. The only thing I can think of is a spelling error or may >>> be a restart of eXist / tomcat but I bet you've already done all that. >>> Permissions on the jar file? >>> >>> Here's my lib dir: >>> >>> >>> and the jar file contents: >>> >>> >>> Chris >>> >>> >>> ' >>> On Aug 26, 2013, at 10:11 AM, Martin Holmes <mh...@uv... >>> <mailto:mh...@uv...>> wrote: >>> >>>> I can't get this to work. I'm using eXist 2.1 under Tomcat, with all >>>> the jars in WEB-INF/lib, and the jar is there; Saxon finds it and uses >>>> it when doing XSLT sorts, but when I try to use it in XQuery I get: >>>> >>>> err:FOCH0002 The specified collator class >>>> ca.uvic.hcmc.mol.MolSortComparator could not be found >>>> >>>> Is there anything else I need to do? >>>> >>>> Cheers, >>>> Martin >>>> >>>> On 13-08-25 06:43 AM, Chris Tomlinson wrote: >>>>> Hello, >>>>> >>>>> We use the following: >>>>> >>>>> order by $pname collation >>>>> "java:org.tbrc.common.server.TibetanCollator" >>>>> >>>>> A jar containing the java custom collator is placed in eXist's lib/user. >>>>> >>>>> Chris >>>>> >>>>> >>>>> >>>>> >>>>> On Aug 23, 2013, at 1:30 PM, Martin Holmes <mh...@uv... >>>>> <mailto:mh...@uv...>> wrote: >>>>> >>>>>> Hi all, >>>>>> >>>>>> I have a Java sort comparator (implements java.util.Comparator) which I >>>>>> use for sorting in XSLT operations, like this: >>>>>> >>>>>> <xsl:sort select="persName/reg" order="ascending" >>>>>> collation="http://saxon.sf.net/collation?class=ca.uvic.hcmc.mol.MolSortComparator"/> >>>>>> >>>>>> I'd like to be able to use the same comparator for sorting in XQuery, >>>>>> but I can't figure out exactly how to do that. Does anyone have any >>>>>> suggestions? >>>>>> >>>>>> All help appreciated, >>>>>> Martin >>>>>> >>>>>> >>>>>> ------------------------------------------------------------------------------ >>>>>> Introducing Performance Central, a new site from SourceForge and >>>>>> AppDynamics. Performance Central is your source for news, insights, >>>>>> analysis and resources for efficient Application Performance Management. >>>>>> Visit us today! >>>>>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >>>>>> _______________________________________________ >>>>>> Exist-open mailing list >>>>>> Exi...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/exist-open >>>>> >>>>> >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Introducing Performance Central, a new site from SourceForge and >>>>> AppDynamics. Performance Central is your source for news, insights, >>>>> analysis and resources for efficient Application Performance Management. >>>>> Visit us today! >>>>> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> Exist-open mailing list >>>>> Exi...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/exist-open >>>>> >>>> >>> >> >> -- >> Martin Holmes >> University of Victoria Humanities Computing and Media Centre >> (mh...@uv...) > |