XML technologies / XSLT / Introduction to XSLT 2.0 / XSLT and XPath – round three / Keys and identifiers / Comparing keys and IDs

(Excerpt from “XSLT 2.0 & XPath 2.0” by Frank Bongers, chapter 3.)

Whereas targets of id() must be identifiers declared in the DTD, with corresponding limitations, key() has no such restrictions. Think of a key as a generalized ID generated only when the stylesheet runs. Compare the concepts:

Especially useful, keys can be built from several sources at once, such as two or more attributes or child contents of an element. Just write the appropriate XPath expression. This makes xsl:key and key() powerful tools.

   

back to top