Re: [xsl] Referencing unique values by their order number.

Subject: Re: [xsl] Referencing unique values by their order number.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 9 Dec 2006 01:17:49 GMT
> The real input example has various sections of the original example -
> aside from being also more convoluted in other aspects. All sections
> need to use their own unique value set and reference it appropriately.
> My concern was that the top-level (i.e., somewhat global) key feature
> wouldn't be appropriate. 

you can make keys work locally by using concat to make up specific
identifiers, for example if you want all keys to be unique to descendants
of a given chapter, just make the chapter part of the key ie instead of
use="." use use="concat(ancestor::chapter/@id,':',.) or whatever works
in your case.

> Is there a way to do the same without keys?
perhaps, perhaps not, apart from making things faster the functional key
notation alows you to avoid some problems related to the fact that you
can't bind variables in xpath 1, variable binding has to be done at the
xslt level so can't happen within a path.  some cases of course don't
need variables, some do, not sure which case you are in, There are parts
of the world where it isn't 1 in the morning, someone else can think
about it:-) 

David

Current Thread