[xslt] using a key and generate-id()



Hi,

I'm trying to debug a problem that has come up in the XSLT files that 
Tellico uses (http://periapsis.org/tellico/). The newest release of libxslt 
1.1.23 was resulting in incomplete results output, and I've been able to 
track it down to the changes introduced in r1451.

The commit message mentions superfluous regeneration of keys, and I'm trying 
to figure out if this is an actual regression or just improper usage on 
Tellico's part, undetected up to now.

The stylesheet uses a global variable which is intended to contain a 
_unique_ list of categories. Because the categories occur multiple times, 
first I generate a key, then I use the generate-id() function to create a 
global variable with the unique categories. And that's what's failing. If I 
move the variable inside a template, so that it's no longer global, then 
everything works ok.

I'm attaching two files, both identical, except that xslt-key1.xsl has a 
global variable and xslt-key2.xsl has a template-scope variable. key1 
generates no output, key2 does, when running xsltproc on itself, 
i.e. "xsltproc xslt-key1.xsl xslt-key1.xsl". Up until r1451, they both gave 
the same output.

Can someone who has more knowledge about the standard perhaps help me out? I 
can't tell whether Tellico was depending on "undefined behavior", so to 
speak, up until libxslt 1.1.12.

Thanks,
Robby

Attachment: xslt-key1.xsl
Description: application/crossover-xsl

Attachment: xslt-key2.xsl
Description: application/crossover-xsl



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