[xslt] Adding support for variable reference inside user-defined function that is used in xsl:key definition

Hi libxslt developers,

Daniel suggested me to open this issue once again now on this mailing list.

I have implemeted internationalized indexing feature as a part of the DocBook XSL stylesheets. With internationalized indexing you can get proper grouped and sorted index for languages like German, French, Czech, Spanish and many others. In a near future support for CJKV languages is planned.

Unfortunately XSLT 1.0 is too powerless for this task. My solution is depending on several EXSLT features. One of them is user defined function that is used in a definition of xsl:key. The problem is that this function must reference global variable in its body.

As I understand Daniel's opinion is that this is error because XSLT 1.0 spec forbids reference to variables inside expression used in xsl:key definition (use attribute). My opinion is that this does not say anything about usage of variables inside functions that are used in xsl:key. This feature is a part of EXSLT and it is not covered by XSLT spec anymore IMHO.

The problem is that relation of EXSLT to XSLT 1.0 is not 100% clear and it is then hard to decide where the truth is.

I can support my point of view by fact that both Xalan and Saxon allow usage of variable refence in this particular situation.

You can find previous discussion in comments for the following bug:


Usage of user-defined function that references global variable in xsl:key is essential for internationalized indexing because xsl:key is needed for grouping which is done by Muenchian method. I tryed to use different grouping method that does not rely on xsl:key. I was successful -- new implementation worked in xsltproc. But it was 40 (forty) times slower than xsl:key based implementation performed by Saxon or Xalan. You can imagine how many people will use tool that needs several minutes to process medium sized document.

Do you think that you might change behaviour of libxslt in order to support variable references inside user-defined functions that are used in xsl:key? I think that now it is clear that there is a real demand for this feature at least from DocBook users who need indexes in non-English languages.


  Jirka Kosek     e-mail: jirka kosek cz     http://www.kosek.cz
  Profesionální školení a poradenství v oblasti technologií XML.
     Podívejte se na náš nově spuštěný web http://DocBook.cz

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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