Name

<xsl:key>

Synopsis

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

Keys are comparable to identifiers in XML. This element is used in xsl:stylesheet to create a reference to elements specified by the pattern and expression values. For example:

<xsl:key name="chap" match="chapter" use="@title"/>

This element creates a key named chap to identify chapters by title. You can then reference a chapter with an XPath function such as:

key("chap", "The XSL Language")

Get XML Pocket Reference, Second 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.