Re: [xslt] XSL Sort + ICU



On Fri, Nov 22, 2002 at 04:42:58PM -0000, Richard Jinks wrote:
> Hi all.
> 
> I've just started modifying libxslt so that people can plug in the ICU
> library to handle Unicode / Locale type sorting.

  Hum, yes this makes sense. Too big to embbed, should allow to be plugged

> >From what I can tell, the main function that performs the sorting is
> xsltDoSortFunction() in xsltutils.c.

 yes

> The two best ways I can think of modifying this are:
> 1) Add a #define and have two copies of the function
> 2) Add an API call to allow users to register their own sort function and
> get xsltDoSortFunction to call it (in a similar manner to the Error
> routines).
> 
> The former requires no API changes, and is relatively painless.
> The second seems more future-proof should someone need a different method of
> collating Unicode characters, or have their own optimised sort routine, etc.
> This method would require a new API function call to let users register a
> new sort routine, and would require somewhere to store the pointer to the
> sort function.
> Does any one have any preference for either or are aware of anything I've
> not taken into account before I start work implementing the second method?

  Well I definitely prefer the second one, you know my style :-)

> Second question is regarding the attributes for lang and case-order.
> Both the pre-compile and the sort function store the contents of the
> attributes for the xsl:sort element on the xsltStylePreComp structure. This
> structure doesn't currently contain any variables to store the lang or
> case-order attributes. Is it safe to add these, or are people's code likely
> to be so dependant on this structure that they'll break if it changes?

  Well people's code really should not be dependant on that, I may actually
break that structure at some point because it's too big, each compiled item
only need a few of those fields, so feel free to add, yes, it's not part
of the official API,

  thanks,

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]