W3C

XHTML Role Attribute Module

A module to support role classification of elements

W3C Editor's Draft 06 June 2007

This version:
http://www.w3.org/TR/2007/ED-xhtml-role-20070606
Latest version:
http://www.w3.org/TR/xhtml-role
Previous version:
http://www.w3.org/TR/2006/WD-xhtml-role-20061113/
Diff from previous version:
xhtml-role-diff.html
Editors:
Mark Birbeck , x-port.net Ltd.
Shane McCarron , Applied Testing and Technology, Inc.
Steven Pemberton , CWI / W3C ®
T. V. Raman , Google, Inc.
Richard Schwerdtfeger , IBM Corporation

This document is also available in these non-normative formats: PostScript version , PDF version , ZIP archive , and Gzip'd TAR archive .

The English version of this specification is the only normative version. Non-normative translations may also be available.


Abstract

The XHTML Role Attribute defined in this specification allows the author to annotate XML 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 based upon XHTML Modularization [ XHTMLMOD ].

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is the second Public Working Draft, and is nearly complete. It is based upon comments received against the previous draft, and also upon work done in the definition of [ XHTML2 ], and is therefore relatively mature.

This document has been produced by the W3C HTML Working Group ( Members only ) as part of the HTML Activity . The goals of the HTML Working Group are discussed in the HTML Working Group charter .

This document is governed by the 24 January 2002 CPP as amended by the W3C Patent Policy Transition Procedure . W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy .

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Please report errors in this specification to www-html-editor@w3.org ( archive ). It is inappropriate to send discussion email to this address. Public discussion may take place on www-html@w3.org ( archive ).

Table of Contents

1.Introduction

This section is informative.

This document is a module designed to be used to help extend the scope of XHTML-family markup languages into new environments. It has been developed in conjunction with the accessibility community and other groups to make it easier to describe the semantic meaning of XHTML-family document content.

2.Conformance Requirements

This section is normative .

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [ RFC2119 ].

Note that all examples in this document are informative, and are not meant to be interpreted as normative requirements.

2.1.Document Conformance

XHTML Role Attribute Module is not a stand-alone document type. It is intended to be integrated into other host languages such as XHTML. A conforming XHTML Role Attribute Module 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:

  1. The document MUST conform to the constraints expressed in Appendix A - DTD Implementation , combined with the constraints expressed in its host language implementation.

  2. If the host language is not in the XHTML namespace, then elements that use this attribute MUST does not incorporate the XHTML Role Attribute Module attribute into its own namespace, the document MUST contain an xmlns declaration for the XHTML Role Attribute Module namespace [ XMLNAMES ] . The namespace for XHTML Role Attribute Module is defined to be http://www.w3.org/1999/xhtml . An example start tag of a root element might look like:

    This example is informative
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
    

2.2.Host Language Conformance

When the XHTML Role Attribute Module 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. Finally, the attribute MUST be referenced using its namespace-qualified form (e.g., <myml:myelement xhtml:role='definition'>a term</myml:myelement>).

2.3.User Agent Conformance

A conforming user agent MUST support all of the features required in this specification.

3.The XHTML Role Attribute

This section is normative.

The role attribute takes as its value one or more white-space separated QName s. Any non-qualified value MUST be interpreted in the XHTML namespace, and MUST be taken from the list defined in this section.

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).

This example is informative
<ul role="navigation wai:sitemap">
    <li href="downloads">Downloads</li>
    <li href="docs">Documentation</li>
    <li href="news">News</li>
</ul>

Authors may use the following standard oles, listed here with f their conventional interpretations. They are intended to define regions of the document to help orient the user.

banner
A banner is usually defined as the advertisement at the top of a web page. The banner content typically contains the site or company logo and other key advertisements for the site.
contentinfo
This is information about the content on the page. For example, footnotes, copyrights, links to privacy statements, etc. would belong here.
definition
The contents of the associated element represent a definition (e.g., of a term or concept). If there is a dfn element within the contents (as defined in [ XHTMLMOD ]), then that represents the term being defined.
main
This defines the main content of a document.
navigation
This is a collection of links suitable for use when navigating the document or related documents.
note
The content is parenthetic or ancillary to the main content of the resource.
search
This is the search section of a web document. This is typically a form used to submit search requests about the site or a more general Internet wide search service.
secondary
This is any unique section of the document. In the case of a portal, this may include but not be limited to: show times; current weather; or stocks to watch.
seealso
Indicates that the element contains content that is related to the main content of the page.

3.1.Extending the collection of roles

It is possible to define additional role values. Such values MUST be defined in their own namespace. Note that current best practice is that the URI associated with that namespace resolve to a resource that allows for the discovery of the definition of the roles in the namespace. Example definitions include the RDF Schema for the XHTML role attribute values in Appendix B , and the Web Accessibility Initiative's work on an RDF Taxonomy [ WAIRDF ].

A.DTD Implementation

This appendix is normative .

The DTD implementation of XHTML Role Attribute Module conforms to the requirements defined in [ XHTMLMOD ]. Consequently, it provides a Qualified Names sub-module, and a module file for the XHTML Role Attribute Module module defined in this Proposed Recommendation.

A.1.Qualified Names 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. In this case 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 attributes.

<!-- ....................................................................... -->
<!-- XHTML Role Qname Module  ............................................ -->
<!-- file: xhtml-role-qname-1.mod
     This is XHTML Role - the Role Attribute Module for XHTML.
     Copyright 2006 W3C (MIT, ERCIM, Keio), All Rights Reserved.
     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
       PUBLIC "-//W3C//ENTITIES XHTML Role Attribute Qnames 1.0//EN"
       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-role-qname-1.mod"
     Revisions:
     (none)
     ....................................................................... -->
<!-- XHTML Role Attribute Qname (Qualified Name) Module
     This module is contained in two parts, labeled Section 'A' and 'B':
       Section A declares parameter entities to support namespace-
       qualified names, namespace declarations, and name prefixing
       for XHTML Role and extensions.
       Section B declares parameter entities used to provide
       namespace-qualified names for the XHTML role attribute:
         %role.qname;   the xmlns-qualified name for @role
         ...
     XHTML Role extensions would create a module similar to this one.
-->
<!-- Section A: XHTML Role Attribute XML Namespace Framework ::::::::::::::: -->
<!-- 1. Declare a %XHTML-ROLE.prefixed; conditional section keyword, used
        to activate namespace prefixing. The default value should
        inherit '%NS.prefixed;' from the DTD driver, so that unless
        overridden, the default behavior follows the overall DTD
        prefixing scheme.
-->
<!ENTITY % NS.prefixed "IGNORE" >
<!ENTITY % XHTML-ROLE.prefixed "%NS.prefixed;" >
<!-- 2. Declare a parameter entity (eg., %XHTML-ROLE.xmlns;) containing
        the URI reference used to identify the XHTML Role Attribute namespace
-->
<!ENTITY % XHTML-ROLE.xmlns  "http://www.w3.org/1999/xhtml" >
<!-- 3. Declare parameter entities (eg., %XML.prefix;) containing
        the default namespace prefix string(s) to use when prefixing
        is enabled. This may be overridden in the DTD driver or the
        internal subset of an document instance. If no default prefix
        is desired, this may be declared as an empty string.
     NOTE: As specified in [XMLNAMES], the namespace prefix serves
     as a proxy for the URI reference, and is not in itself significant.
-->
<!ENTITY % XHTML-ROLE.prefix  "" >
<!-- 4. Declare parameter entities (eg., %XHTML-ROLE.pfx;) containing the
        colonized prefix(es) (eg., '%XHTML-ROLE.prefix;:') used when
        prefixing is active, an empty string when it is not.
-->
<![%XHTML-ROLE.prefixed;[
<!ENTITY % XHTML-ROLE.pfx  "%XHTML-ROLE.prefix;:" >
]]>
<!ENTITY % XHTML-ROLE.pfx  "" >
<!-- declare qualified name extensions here ............ -->
<!ENTITY % xhtml-role-qname-extra.mod "" >
%xhtml-role-qname-extra.mod;
<!-- 5. The parameter entity %XHTML-ROLE.xmlns.extra.attrib; may be
        redeclared to contain any non-XHTML Role Attribute namespace 
        declaration attributes for namespaces embedded in XML. The default
        is an empty string.  XLink should be included here if used
        in the DTD.
-->
<!ENTITY % XHTML-ROLE.xmlns.extra.attrib "" >
<!-- Section B: XML Qualified Names ::::::::::::::::::::::::::::: -->
<!-- 6. This section declares parameter entities used to provide
        namespace-qualified names for the XHTML role attribute.
-->
<!ENTITY % xhtml-role.role.qname  "%XHTML-ROLE.pfx;role" >
<!-- The following defines a PE for use in the attribute sets of elements in
     other namespaces that want to incorporate the XML Event attributes. Note
     that in this case the XHTML-ROLE.pfx should always be defined. -->
<!ENTITY % xhtml-role.attrs.qname
   "%XHTML-ROLE.pfx;role             CDATA        #IMPLIED"
    >
<!-- end of xhtml-role-qname-1.mod -->

A.2.XHTML Role Attribute Module

<!-- ...................................................................... -->
<!-- XHTML Role Module .................................................... -->
<!-- file: xhtml-role-1.mod
     This is XHTML Role - the Role Attribute Module for XHTML.
     Copyright 2006 W3C (MIT, ERCIM, Keio), All Rights Reserved.
     This DTD module is identified by the PUBLIC and SYSTEM identifiers:
       PUBLIC "-//W3C//ENTITIES XHTML Role Attribute 1.0//EN"
       SYSTEM "http://www.w3.org/MarkUp/DTD/xhtml-role-1.mod"
     Revisions:
     (none)
     ....................................................................... -->
<!-- XHTML Role Attribute Module does nothing, since role is not incorporated
     in any elements content model as part of this module. -->
<!-- end of xhtml-role-1.mod -->

B.RDF Schema

This section is informative

This section will contain an example RDF specification for the roles that are defined in this document.

This example is informative

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
    <!ENTITY dc "http://dublincore.org/2003/03/24/dces#">
    <!ENTITY owl "http://www.w3.org/2002/07/owl#">
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <!ENTITY states "http://www.w3.org/2005/07/aaa#">
    <!ENTITY skos "http://www.w3.org/2004/02/skos/core#">
    <!ENTITY wairole "http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#">
]>
<rdf:RDF xml:base="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:states="http://www.w3.org/2005/07/aaa#" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" xmlns:xhtml="http://www.w3.org/1999/xhtml#">
    <owl:Class rdf:ID="banner">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">A banner is usually defined as the 
      advertisement at the top of a web page. The banner content typically 
      contains the site or company logo and other key advertisements for the site.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="contentinfo">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">This is information about 
      the content on the page. For example, footnotes, copyrights, links to privacy 
      statements, etc. would belong here.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="definition">
        <rdfs:subClassOf rdf:resource="wairole:section"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">The contents of the 
      associated element represent a definition (e.g., of a term or concept). 
      If there is a dfn element within the contents (as defined in [XHTMLMOD]), 
      then that represents the term being defined.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="main">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">This defines the main 
      content of a document.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="navigation">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <wairole:relatedConcept rdf:resource="wairole:menu"/>
        <dc:description xml:lang="en">This is the navigation bar 
      on a web document. This is typically a list of links to other pages on the 
      site or other areas of the same document.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="note">
        <rdfs:subClassOf rdf:resource="wairole:section"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">The content is parenthetic 
      or ancillary to the main content of the resource.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="search">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <wairole:scope rdf:resource="wairole:document"/>
        <dc:description xml:lang="en">This is the search section of 
      a web document. This is typically a form used to submit search 
      requests about the site or a more general Internet wide search service.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="secondary">
        <rdfs:subClassOf rdf:resource="wairole:region"/>
        <dc:description xml:lang="en">This is any unique section 
      of the document. In the case of a portal, this may include but not be 
      limited to: show times; current weather; or stocks to watch.
      </dc:description>
    </owl:Class>
    <owl:Class rdf:ID="seealso">
        <rdfs:subClassOf rdf:resource="wairole:section"/>
        <dc:description xml:lang="en">Indicates that the element 
      contains content that is related to the main content of the page.     
      </dc:description>
        <wairole:relatedConcept rdf:resource="#main"/>
    </owl:Class>
</rdf:RDF>

C.References

This appendix is normative .

C.1.Normative References

[RFC2119]
" Key words for use in RFCs to indicate requirement levels ", RFC 2119, S. Bradner, March 1997.
Available at: http://www.rfc-editor.org/rfc/rfc2119.txt
[XMLNAMES]
" Namespaces in XML ", W3C Recommendation, T. Bray et al. , eds. , 14 January 1999.
Available at: http://www.w3.org/TR/1999/REC-xml-names-19990114
The latest version is available at: http://www.w3.org/TR/REC-xml-names

C.2.Other References

[ WAIRDF ]
" Role Taxonomy for Accessible Adaptable Applications ". L. Seeman, 8 May 2006.
Available at: http://www.w3.org/WAI/PF/GUI/roleTaxonomy-20060508.html
The latest version is available at: http://www.w3.org/WAI/PF/GUI/
[ XHTML ]
" XHTML™ 1.0: The Extensible HyperText Markup Language (Second Edition) ". S. Pemberton et al. , 26 January 2000, revised 1 August 2002.
Available at: http://www.w3.org/TR/2002/REC-xhtml1-20020801
The latest version is available at: http://www.w3.org/TR/xhtml1
[ XHTML2 ]
" XHTML™ 2.0 ". J. Axelsson et al. , 27 May 2005.
Available at: http://www.w3.org/TR/2005/WD-xhtml2-20050527
The latest version is available at: http://www.w3.org/TR/xhtml2
[ XHTMLMOD ]
" Modularization of XHTML™ 1.1 ", W3C Proposed Recommendation, D. Austin et al. , eds. , 13 February 2006.
Available at: http://www.w3.org/TR/2006/PR-xhtml-modularization-20060213
The latest version is available at: http://www.w3.org/TR/xhtml-modularization

D.Acknowledgments

This section is informative.

At the time of publication, the participants in the W3C HTML Working Group were: