Name

xsl:key

Synopsis

<xsl:key 
  name  = "QualifiedName"
  match = "pattern"   
  use   = "expression" />

The xsl:key top-level element defines one or more keys that can be referenced from elsewhere in the stylesheet using the key( ) function. Each key has a name, a string-value, and a node.

Attributes

name, required

The key’s name.

match, required

An XSLT match pattern, like that used by xsl:template, specifying which nodes have this key. If this pattern matches more than one node in the source document, then a single xsl:key element may define many keys, all with the same name and possibly the same value, but with different nodes.

use, required

An XPath expression that is converted to a string to give the value of keys defined by this element. The expression is evaluated with respect to each key’s node. If match identifies multiple nodes, then use may produce different values for each key.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.