Project

Profile

Help

xsl:key/key() for variables?

Added by Anonymous over 18 years ago

Legacy ID: #3461887 Legacy Poster: dret (dret)

hi there. i am wondering whether this is a principal problem with xslt 2.0: xsl:key/@match takes a pattern, which means that no variables can be indexed with xsl:key, right? this means that if i have complex temporary trees which need indexing, i cannot solve these problems in just one xslt. on the other hand, michael kay writes in his xslt 2.0 book that xsl:key may match nodes from temporary trees, but he does not give examples. it seems to me that the pattern definition excludes variables used with keys, but i would be very happy to be proven wrong... thanks for any information about this subject, erik wilde.


Replies (2)

RE: xsl:key/key() for variables? - Added by Anonymous over 18 years ago

Legacy ID: #3461918 Legacy Poster: Michael Kay (mhkay)

In both XSLT 1.0 and 2.0, a key definition in xsl:key appplies to every document, including a temporary tree. You don't specify in the key definition which document it applies to, rather you specify when calling key() which document you want to search. In practice, the indexes are built for a particular document the first time that key() is used to search that document. This is really an XSLT question not a Saxon questions so it would be better asked on the xsl-list at mulberrytech.com Michael Kay

RE: xsl:key/key() for variables? - Added by Anonymous over 18 years ago

Legacy ID: #3462251 Legacy Poster: dret (dret)

thanks for the information and sorry for using the inappropriate place for asking the question. cheers, dret.

    (1-2/2)

    Please register to reply