This is the main content of the page
Here is some content that is the primary purpose of this web page.
The Role Attribute defined in this specification allows the author to annotate markup languages with machine-extractable semantic information about the purpose of an element. Use cases include accessibility, device adaptation, server-side processing, and complex data description. This attribute can be integrated into any markup language. In particular, schema implementations are provided to facilitate with languages based upon XHTML Modularization [[XHTML-MODULARIZATION11-2e]].
The role attribute is necessary to support Accessible Rich Internet Applications (WAI-ARIA) [[WAI-ARIA]] to define roles in XML-based languages, when the languages do not define their own role attribute. Although this is the reason the Role Attribute is published by the Protocols and Formats Working Group, the attribute has more general use cases as well.
This is a Proposed Recommendation by the Protocols & Formats Working Group of the Web Accessibility Initiative. The Proposed Recommendation status indicates that the document is a mature technical report that has received wide review for technical soundness and implementability, supported by the Role Attribute Processor and Browser Conformance implementation report. This publication accompanies a request for final endorsement from the W3C Advisory Committee. It also incorporates minor changes in response to public comments received on the previous version. A history of changes to Role Attribute 1.0 is available.
Members of the W3C Advisory Committee are requested to express their opinion about whether this document is ready to become a W3C Recommendation in the @@Call for review. Others may comment via the usual comment channel, though note this document has advanced past the point at which substantive input is likely to be processed for this version; comments may be considered for future versions. Start with the instructions for commenting page to submit comments (preferred), or send email to public-pfwg-comments@w3.org (comment archive). Comments should be made by 1 February 2013. In-progress updates to the document may be viewed in the publicly visible editors' draft.
This document defines an attribute designed be used to help improve the accessibility and semantic markup of documents. It has been developed in conjunction with the accessibility community and other groups to make it easier to describe the semantic meaning of document content.
An important (though not exclusive) use case for the Role Attribute is to support [[WAI-ARIA]]. The Role Attribute meets the requirements of Role Attribute in WAI-ARIA, Section 7.1, enabling [[!XML10]] languages that incorporate this attribute to use WAI-ARIA roles. At time of this publication, no XML-based languages are known to use WAI-ARIA, but this attribute is important to enable planned future support (such as in SVG). By contrast, support for WAI-ARIA in [[HTML5]] includes an attribute named "role". The use of that attribute within [[HTML5]] is consistent with the definition of the role attribute in this specification, although conforming use may be limited to the use of 'TERM's within the value of the attribute.
The Role Attribute does not represent a stand-alone document type. It is intended to be integrated into other host languages such as SVG, HTML, or XHTML. A conforming Role Attribute document is a document that requires only the facilities described as mandatory in this specification and the facilities described as mandatory in its host language. Such a document must meet all the following criteria:
The document MUST conform to the constraints expressed in its host language implementation.
If the host language is an XML [[!XML10-4e]]
markup language and is in the XHTML Namespace
http://www.w3.org/1999/xhtml
), there are no
additional requirements.
If the host language is an XML markup language and is not in the XHTML namespace,
and the
host language does not incorporate this attribute in 'no namespace',
then
the document MUST contain an XML namespace declaration for the Role Attribute Module namespace
[[XML-NAMES11]].
The namespace for Role Attribute Module is
defined to be
http://www.w3.org/1999/xhtml
.
An example start tag of a root element might look like:
When the Role Attribute is included in a host language, all of the facilities required in this specification MUST be included in the host language. In addition, the attribute defined in this specification MUST be included in the content model of the host language.
This specification defines the role
attribute.
The role
attribute takes as its value one or more
whitespace separated TERMorCURIEorAbsIRIs
, which is defined in [[!RDFA-CORE]].
Each component of the value maps to an IRI that corresponds to a vocabulary
term that SHOULD be defined using RDF.
The datatype used for
The specific vocabulary terms from the default vocabulary are not included in this document. They are defined in [[!XHTML-VOCAB]] to ease maintenance. The terms are drawn from [[WAI-ARIA]] and from the original work on this document by the XHTML2 Working Group.
The attribute describes the role(s) the current element plays in the
context of the document.
This can be used, for example, by
applications and assistive technologies to
determine the purpose of an element.
This could allow a user to make informed decisions on which actions may
be taken on an element and activate the selected action in a device
independent way. It could also be used as a mechanism for annotating portions
of a document in a domain specific way (e.g., a legal term taxonomy).
Although the role attribute may be used to add semantics to an element,
authors SHOULD use elements with inherent semantics, such as p
,
rather than layering
semantics on semantically neutral elements, such as div role="paragraph"
.
The following is an example of a good, appropriate use of the role attribute:
This is the main content of the page
Here is some content that is the primary purpose of this web page.
It is possible to define additional role values. Vocabulary authors MUST define such additional role values in their own vocabulary. The URI associated with that vocabulary SHOULD resolve to a resource that allows for the machine and human discovery of the definition of the roles in the vocabulary.
A good example of such a resource is the default vocabulary document at [[XHTML-VOCAB]]. This document uses a format compatible with the requirements of [[!RDFA-CORE]] section 9 for machine-discoverable RDFa Initial Contexts.
If a Host Language contains the
bnode
.role
in the vocabulary
defined at http://www.w3.org/1999/xhtml/vocab
.http://www.w3.org/1999/xhtml/vocab#
for the value(s) of the Remember that TERMorCURIEorAbsIRIs
. An RDFa Processor will intepret
these values using the rules for that that datatype as defined in [[!RDFA-CORE]].
The DTD implementation of XHTML Role Attribute Module conforms to the requirements defined in [[!XHTML-MODULARIZATION11-2e]]. Consequently, it provides a Qualified Names declaration module.
Note that this module defines the parameter entity
%xhtml-role-attrs.qname;
. This entity is intended to be used in
the attribute lists of elements in any host language that permits the use of
the role attribute on elements in its own namespace.
If a host language does not permit role in its namespace, then the host
language driver should set a parameter entity %XHTML-ROLE.prefixed;
to INCLUDE
and a parameter entity %XHTML-ROLE.prefix;
to a value that is the prefix for the XHTML Role Attribute Module attribute.
The schema implementation of XHTML Role Attribute Module conforms to the requirements defined in [[!XHTML-MODULARIZATION11-2e]]. It is included here as an example implementation.
The following people contributed to the development of this document.
Jim Allan (TSB), Simon Bates, Chris Blouch (AOL), Judy Brewer (W3C/MIT), Ben Caldwell (Trace), Charles Chen (Google, Inc.), Christian Cohrs, Dimitar Denev (Frauenhofer Gesellschaft), Donald Evans (AOL), Kentarou Fukuda (IBM Corporation), Becky Gibson (IBM), Alfred S. Gilman, Andres Gonzalez (Adobe Systems Inc.), Georgios Grigoriadis (SAP AG), Jeff Grimes (Oracle), Barbara Hartel, John Hrvatin (Microsoft Corporation), Masahiko Kaneko (Microsoft Corporation), Earl Johnson (Sun), Jael Kurz, Diego La Monica (International Webmasters Association / HTML Writers Guild (IWA-HWG)), Aaron Leventhal (IBM Corporation), Alex Li (SAP), Thomas Logan (HiSoftware), William Loughborough, Linda Mao (Microsoft), Anders Markussen (Opera Software), Matthew May (Adobe Systems Inc.), Artur Ortega (Yahoo!, Inc.), Lisa Pappas (Society for Technical Communication (STC)), Dave Pawson (RNIB), Stephen Pemberton (CWI), David Poehlman, Simon Pieters (Opera Software), T.V. Raman (Google, Inc.), Gregory Rosmaita, Tony Ross (Microsoft Corporation), Martin Schaus (SAP AG), Marc Silbey (Microsoft Corporation), Henri Sivonen (Mozilla), Henny Swan (Opera Software), Vitaly Sourikov, Mike Squillace (IBM), Ryan Williams (Oracle), Tom Wlodkowski.
This publication has been funded in part with Federal funds from the U.S. Department of Education, National Institute on Disability and Rehabilitation Research (NIDRR) under contract number ED-OSE-10-C-0067. The content of this publication does not necessarily reflect the views or policies of the U.S. Department of Education, nor does mention of trade names, commercial products, or organizations imply endorsement by the U.S. Government.