Roles

A 'role' can be assigned to a locator, and is used by the system to apply a different style to the linking element content, or to affect linking behaviour in some way. For example, if all links are classified as 'internal' (referring to objects in the same document) or 'external', then these links can be given different colours so that users will be aware of the distinction.

The Role attribute is used to create these categories. While a browser may simply use the attribute value to apply different styles to the linking text (both CSS and XSLT are able to apply different styles to an element, depending on the value of one of its attributes), a more specialized browser may perform role-specific actions as well.

The value of this attribute ...

Get XML Companion, The, Third 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.