Keys

Within the XSLT standard, a powerful mechanism is included that overcomes the limitations of the XML ID scheme described above. XSLT can identify elements using a 'key'. A key is a combination of three things. First, it includes a specific target element, and the purpose of the key is to retrieve this element when required. Second, it includes a value by which the element can be identified. Third, it includes a name that creates a distinct namespace for the value. This means that the same value can be used in different contexts, without causing any conflicts. For example, the value 'orange' would have one meaning in the 'colour' space, and a different meaning in the 'fruit' space. The names 'colour' and 'fruit' make this distinction, and ...

Get XSL companion, The 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.