[xslt] XSL Sort + ICU

Hi all.

I've just started modifying libxslt so that people can plug in the ICU
library to handle Unicode / Locale type sorting.

Can I ask a couple of quick questions before I start, please?

>From what I can tell, the main function that performs the sorting is
xsltDoSortFunction() in xsltutils.c.
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

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?

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?


Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts

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