Key () in the <key> element

In the key element, this is an error for the value of the use attribute or the match attribute to indicate a variable reference.

But can the use attribute or match attribute contain the key() function?

This seems valid, but only makes sense if key elements are executed in the order of the document in the stylesheet. Is it guaranteed?

(If this really works, then sometimes you can use the key() function within use or match to do the job that a resolved global variable would do.)

+4
source share
1 answer

But can the use attribute or match attribute contain a key () function?

In XSLT 1.0, both of these errors are .

From W3C Errata to XSLT 1.0 specification :

E13 - basic.

Section 12.2, eighth paragraph. Call a key function in a match and use attributes in xsl: key elements can call loops. See http://lists.w3.org/Archives/Member/w3c-xsl-wg/2000Jun/0048.html (members only).

This is an error for the value of the use or match attribute. The attribute contains a variable variable or a key call Function

In XSLT 2.0, the use of the key() function in these places is allowed, provided that the key is not defined in terms of itself (round links in the definitions are not allowed).

+4
source

Source: https://habr.com/ru/post/1388998/


All Articles