Copyright ©2000, 2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply.
This document explains how to design accessible applications using XML, the Extensible Markup Language. Compared to the HTML or MathML languages, XML is one level up: it is a meta syntax used to describe these languages, as well as new ones. As a meta syntax, XML provides no intrinsic guarantee of device independence or textual alternate support. It is essential, therefore, that XML formats and tools designers are provided with guidelines that explain how to include basic accessibility features - such as those present in HTML, SMIL, and SVG - in all their new developments.
This document is a Working Draft made available by the WAI Protocols and Formats Working Group (PFWG), for review by W3C members and other interested parties. The PF group operates as part of the WAI Technical Activity.
Depending on the feedback received, this document may become a W3C Note, be integrated in the Web Content Accessibility Guidelines suite (e.g as a technique for XML) or enter its own Recommendation track.
Please send comments about the content of this document and how you would like to see it evolving to the publicly archived mailing list: [email protected]. Comments on this version can be sent until September 30th, 2001. Send minor editorial comments directly to the editors.
Publication of this document does not imply endorsement by the W3C, its membership or its staff. This is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C technical reports and publications, including working drafts and notes, can be found at http://www.w3.org/TR/.
XML (Extensible Markup Language) is a meta-syntax, used to create new languages.
It can be seen as a simplification of SGML (Standard Generalized Markup Language), designed to promote a wider acceptance in Web markets, but serving the same functionality of extensibility and new language design.
HTML (HyperText Markup Language), on the other hand, is one particular application of SGML, which covers one set of needs ("simple" hypertext documents) and one set of element and attributes.
For instance, in HTML, authors can write elements like:
<title>XML and Accessibility</title> <address lang=fr>Daniel Dardailler</address> <h1>Background</h1>
and they can only use elements (title, h1, etc) defined by the HTML specification (which defines about a hundred), and their attributes.
In SGML and XML, authors can define their own set of elements, and end up with documents like:
<menu>New England Restaurant</menu> <appetizer>Clam Chowder <photo url="clam.jpg">A large creamy bowl of clam showder, with bread crumbs on top</photo> </appetizer>
which may fit more closely the needs of their information system.
Within W3C, the HTML language is now being recast as XML - this is called XHTML - including a modularization of HTML to suit the needs of a larger community (mobile users, Web TV, etc).
XML is therefore not to be seen as a replacement of HTML, but as a new building layer on top of which HTML is to be placed, next to other languages designed by W3C, such as MathML (for representing mathematical formula), SMIL (for synchronizing multimedia), SVG (for scalable graphics), etc., and other new languages designed by other organizations (such a OpenEBook, XML-EDI, etc.).
Furthermore, it is important to understand that XML is not only a User Interface technology (like HTML), but can and is often used in protocol communication, to serialize and encode data to be sent from one machine to another.
The XML grammars (called schemata - but see the caveat about our use of the term "schema" in the definition section) can be classified along two different axes:
According to this taxonomy, these guidelines only address Data-oriented schemata. This does not imply that there are not accessibility issues or features in a Metadata-Oriented schemata - see, for example, how XSLT, a component of XSL, can assist in Braille formatting. Since they do not convey end-user oriented data, however, Metadata-Oriented schemata are out of the scope of these guidelines.
The WAI (Web Accessibility Initiative) has done extensive work in the HTML area, resulting in lots of new functionalities being added to the version 4.0 of the language (see the HTML4 Accessibility Improvements paper).
These features includes:
One area of concern with the advent of XML is that the freedom of design it bringshas and can result in a loss of accessibility features, present today because of HTML's pervasive presence and widely available specification.
For instance, one could design a new XML language that would prevent the creation of accessible documents, by not including in the element or attribute set a way to attach an alternate textual description for a photo:
<menu>New England Restaurant</menu> <appetizer>Clam Chowder <photo url="clam.jpg"/> <!-- no alt attribute or textual content model here --> </appetizer>
In this example, the problem is not that the author of this document didn't put an alt attribute or textual equivalent attached to the photo element, it's that the designer of the language didn't put the attribute or the proper support in the language itself (that is, in the schema or the DTD).
But let's start by defining what we mean by accessible schema and documents (Details on these definitions are provided at the end of this document):
An XML schema is accessible if it enables, and indeed actively promotes, the creation of accessible documents
A document is accessible if it can be equally understood by its targeted audience regardless of the device used to access it.
An accessible document is also defined as conforming to the Web Content Accessibility Guidelines.
As explained in the introduction, we're only considering Data-oriented languages here, and for them, the message is simple: be device independent and export your semantics as much as you can.
While the priority is stronger on the first aspect (multi-modality), both aspects are important, as without the knowledge of the meaning of the XML elements and attributes, there is little chance that alternative user agents can do something intelligent with just the document bits.
This semantics knowledge can be provided through human readable documentation of course, but having machine readable assertions of semantics that can then be used to present the document in various media is paramount for pervasive access (that is, you don't need a programmer, you just need a program). Enabling others to map from your language to existing ones, or vice versa, is a useful accessibility feature.
ICADD (International Committee on Accessible Document Design) was a pioneer in this topic, for SGML accessibility and ways to convey arbitrary schema semantics (using specific SGML binding mechanisms). A few years later, ICADD has not really been adopted (in fact, the ICADD DTD was replaced by HTML and its well known semantics), and people are still trying to solve the same problem, albeit with more experience in the field of HTML accessibility, and applied to XML this time.
This section provides a list of four guidelines, which are general principles of accessible design. Guidelines include rationale and checkpoints. Each checkpoint expresses a requirement, includes some informative text about the checkpoint and one or several Techniques, where implementations and examples of the checkpoint are discussed. Note that the checkpoints are not prioritized at that point.
Web content providers must able to offer alternative versions of their content if they wish to do so (as the Web Content Accessibility Guidelines tell them to do so). Textual alternatives, for instance, can be repurposed for many different output devices, whereas non-textual content is often confined to a certain set of devices. Thus, by allowing and encouraging synchronized textual alternatives, you allow your tagset to be more interoperable, and hence accessible.
<table border="1" summary="This table gives some statistics about fruit flies: average height and weight, and percentage with red eyes (for both males and females)."> <caption><em>Statistics</em> about fruit flies</caption> <tr><th rowspan="2"><th colspan="2">average <th rowspan="2">red<br>eyes <tr><th>height<th>weight <tr><th>males<td>1.9<td>0.003<td>40% <tr><th>females<td>1.7<td>0.002<td>43% </table>
By flexible, we mean so that it is not
constrained by the language itself. For example, HTML lets you add
"alt" to images, but it does not let you add images to runs of
text/markup, so people have to put up with less adequate
mechanisms, perhaps by adding "see figure 1" at the end of a
paragraph. If the content of <img> was other than empty, this
would have solved the problem to some extent. Another way would
have been to add an "appliesto" attribute to the <img>
element, allowing you to put the associated image elsewhere in the
document. Satisfying this checkpoint takes a lot of thought due to
its subjective nature, but it's very important. For example, if
<img> were non-empty, or if it had an appliesto
attribute, it is probable that many more people would be
associating images with text/markup runs.
<svg xmlns="http://www.w3.org/2000/svg" xml:lang="en"> <g> <desc xmlns:mydoc="http://example.org/mydoc"> <mydoc:title id="title1">The sales bar chart by region</mydoc:title> <mydoc:para>This description uses markup from the <mydoc:emph>mydoc</mydoc:emph> namespace.</mydoc:para> </desc> <!-- now the picture which includes text referencing the description --> <rect x="10" y="20" ...> <text x="100" y="200" font-size="15" fill="red" > <tref xlink:href="#title1"/> </text> </g> </svg>
<!DOCTYPE document SYSTEM "myDTD.dtd" [ <!ENTITY % qnames PUBLIC "-//W3C//ENTITIES XHTML Qualified Names 1.0//EN" "xhtml-qname-1.mod" > <!ENTITY % object PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN" "xhtml-object-1.mod" > %qnames; %object; ]> <i:inventory xmlns:i="http://www.my.org/xmlns/inventory"> <i:stockitem> etc. <xhtml:object...> to include a picture or movie of the part.
Data-oriented XML should contain precise methods of encoding the data for its particular scope. By increasing the semantics of your tagset, and setting linking devices to outside presentations or further semantics, you allow your data to become "Webized" and hence to operate within many environments.
In general, languages must be designed so that they can be presented in a device independent way. Languages used only for presentation to a certain scope of users (that is, final form tagsets) should adhere to the following caveats:
See the last paragraph of the XSL 1.1.1 section for an example of such wording.
Do not include presentational attributes and elements in your language.
<p align="center" font="arial" weight="bold">News items 1</p> <p align="center" font="arial" weight="bold">News items 2</p> <p align="center" font="arial" weight="bold">News items 3</p>
Example: Right
Support the inclusion and processing of external style sheets.
mystyle.css: .news { text-align: center; font: bold arial }
<?xml-stylesheet href="mystyle.css" type="text/css"?> <p class="news">News items 1</p> <p class="news">News items 2</p> <p class="news">News items 3</p>
User Agents have no way of knowing this is a link.
<mylink linkend="http://mysite/myfile.xml"> Current list of references </mylink>
Example: Right
Links can be recognized reliably by XLink applications.
<crossref xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://mysite/myfile.xml"> Current list of references </crossref>
<-- menu - highest level block element appetizer - first child of section, major block element entree - second child of section, major block element entity meal-sequence - common paragraph level blocks --> <!ELEMENT menu (title , ((%meal-sequence;)| appetizer)+)> <!ELEMENT appetizer (title? , ((%meal-sequence;) | entree)+)>
<xsd:schema xmlns="http://www.publishing.org" xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"> <xsd:element name="document"> <xsd:complexType> <xsd:sequence> <xsd:element ref="head"/> <xsd:element ref="section"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="head" type="xsd:string"> <xsd:annotation> <xsd:documentation>Section title</xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element name="section"> <xsd:complexType> <xsd:sequence> <xsd:element ref="head"/> <xsd:element ref="section"/> <xsd:element ref="paragraph" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="paragraph" type="xsd:string"/> </xsd:schema>
<xsd:simpleType name="ISBN-Type"> <xsd:restriction base="xsd:string"> <xsd:pattern value="\d{5}-\d{5}-\d{5}"/> <xsd:pattern value="\d{1}-\d{3}-\d{5}-\d{1}"/> <xsd:pattern value="\d{1}-\d{2}-\d{6}-\d{1}"/> </xsd:restriction> </xsd:simpleType>
Example: XML using RDF and Dublin Core well known semantics.
<someElement xmlns="http://xmlns.com/example"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description about="http://www.dlib.org/"> <dc:Title> D-Lib Program - Research in Digital Libraries </dc:Title> <dc:Description>The D-Lib program supports the community of people with research interests in digital libraries and electronic publishing.</dc:Description> <dc:Publisher> Corporation For National Research Initiatives </dc:Publisher> <dc:Date>1995-01-07</dc:Date> <dc:Type>World Wide Web Home Page</dc:Type> <dc:Format>text/html</dc:Format> <dc:Language>en</dc:Language> </rdf:Description> </rdf:RDF> <!-- .....other xml.... --> </someElement>
<report> <invoice> <amount>25 dollars</amount> .... </invoice> <description> <item>Widgets</item> <amount>25</amount> </description> </report>
In the example above, the designer of the schema intended the first occurrence of the element "amount" to mean 'price' of the products purchased and the second occurrence to mean 'quantity' of the products purchased.
Example: Right
<report> <invoice> <price>25</price> <currency>Dollar</currency> .... </invoice> <description> <item>Widgets</item> <quantity>25</quantity> </description> </report>
In the example above, the meaning of all the elements is clear and none of the individuals elements is overloaded.
... <par> <video src="anchor.mpg" ... /> <switch> <audio src="HiQuality.wav" systemBitrate="56000" ... /> <audio src="MedQuality.wav" systemBitrate="28800" ... /> <audio src="LowQuality.wav" ... /> </switch> </par>
Web content is rapidly shifting from static pages to dynamic pages, called Web applications. This is most often done using a scripting language based on event callback. The language designers must ensure that the model they chose allows for user control of presentation. Always ensure that nothing in the presentational aspect of the document attempts to restrict user control of how the document instance is accessed.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head> <title>Outline of x</title> <body> <-- This provides the link back to the full source document --> <a href="source.xml">full source of document</a> <h3>Outline view</h3> <p> <xsl:for-each select="//section"> <xsl:number level="multiple" count="section" format="1.1.1"/> <xsl:value-of select="title"/> <br /> </xsl:for-each> </p> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="*"/> </xsl:stylesheet>
<script> function DoOnActivate(evt) { .. } </script> <g onactivate="DoOnActivate(evt)"> <rect id="button" x="500" y="500" width="250" height="40"/> </g>
Make sure that all people can understand your design and map to and from your elements, and easily make assertions about them. Furthermore, make sure that you provide your own first party assertions about your languages: for example, don't make users guess an element's purpose.
<?xml version="1.0" encoding="utf-8"?> <my:doc xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:schemaLocation="http://www.example.org/schemas/doc.xsd" xmlns:my="http://www.jenitennison.com/" xmlns="http://www.w3.org/1999/xhtml">
Example: TREX
<element name="paragraph"> <xsd:annotation>the lowest level block container.</xsd:annotation> <empty/> </element>
<xsd:element name="head" type="xsd:string"> <xsd:annotation> <xsd:documentation xml:lang="en-US">Title of the section. Required for table of contents generation. </xsd:documentation> </xsd:annotation> </xsd:element>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml> <head> <title>Mapping of language MenuML to html</title> <body> <h1>Menu of: <xsl:value-of select="menu/"/></h1> <h2>Appetizer: <xsl:value-of select="menu/appetizer/"/></h2> etc... </body> </html>
MenuML technique: use the content of the photo element to indicate the textual equivalent of the picture.
MenuML technique: use the appetizer element to introduce a new appetizer, not a para and some bigger font
Example: Wrong
<element name="paragraph"> <xsd:annotation> <xsd:documentation>paragraph</xsd:documentation> </xsd:annotation> <empty/> </element>
Here the element name has been described using the element name only, which adds no semantic value.
Example: Right
<element name="paragraph"> <xsd:annotation> <xsd:documentation>The lowest level block container. </xsd:documentation> </xsd:annotation> <empty/> </element>
Here the element name has been described in an alternate form to clarify semantics rather than re-enforce the name by repeating it.
In the presentation of guidelines for XML accessibility, we try to separate abstract guidelines from implementation techniques. This allows us to talk about the general guideline principles without spending the time up-front to solve the implementation issues.
In fact, there are several techniques for achieving the same result and people's decision will be a function of time and product available and their own commitment to access.
For instance, if an XML designer want to create some kind of "list" element in a given markup, this can be implemented using various techniques:
Schema: Even though we use the term "schema", we don't want people to assume we are only talking about a schema as defined in XML Schema but rather some document or collection of documents which contains all the references for interpreting a document which is encoded in accordance with the usage of some application or community of discourse. "Profile" might be a better word for our usage.
An XML schema is accessible if it enables and actively promotes the creation of accessible documents
A document is accessible if it can be equally understood by its targeted audience regardless of the device used to access it.
An accessible document is also defined by conforming to the Web Content Accessibility Guidelines.
The word "promote" is important as "enable" alone does not cover the case where a schema could include some open string representation somewhere and claim minimal accessibility.
To take an example, suppose HTML didn't have an ALT attribute on IMG,
it would still in theory "enable" the creation of accessible documents,
since HTML files carry textual content and one could always describe
images inline, as in: <IMG SRC="Tax.gif"> How to pay your
taxes
but this doesn't "promote" accessibility as most authors
will not want to repeat "How to pay your taxes" if the logo already says
"How to pay your taxes" (assuming CSS cannot be used for that instead of
a bitmap). Having the ALT attribute "promotes" accessibility as it allows
images to be described without performance loss - such as duplication -
for image viewer.
In any case, accessibility is not just about alternative content, as the next section will show.
The word "device" is also important as it encompasses more than just media independence: it's both output (graphical, voice, braille, text-only) and input (mouse, keyboard, voice, keypad, one-touch).
This term also potentially carries with it the issues related to high bandwidth availability (or lack thereof), where access to data becomes impossible on slow connection because of their volume.
The term "equal understanding" is critical as it permits some form of graceful transformation when presenting in one media content primarily designed for another media.
Graceful transformation is a key concept in the area of accessibility. Let's define it.
Definition:
For instance, suppose I need to check the online yellow line train schedule and I don't have visual access to the Web. If the train Web site uses a yellow wagon animated icon to point me at the schedule, and does not provide a label somewhere saying that this is for the yellow line, thus only relying on my capacity to see the color, I suddenly cannot understand this site: it does not transform gracefully.
If the schema designer hasn't provided a way to attach alternate content to some rich piece like an animated yellow wagon, the content provider will not reach all of his/her audience with this information.
Suppose now in a different page this Web site provides a nice clickable 2D map with all the stops and ask me to select my start and destination. If a simple list of the line stops is provided in textual form, it does transform gracefully: it's not as fast as a couple of mouse clicks, so there is some "degradation" in the system, but a user reliant on text can obtain the information.
In addition to the editors, the following WAI Protocols and Formats Working Group (PF) participants have contributed directly to the content of this document:
Kynn Bartlett , Geoff Freed, Al Gilman, Vijay Gummadi, Ian Jacobs, Chris Lilley, William Loughborough, Charles McCathieNevile, Dave Pawson, Gregory J. Rosmaita, Aaron Swartz and Carlos A. Velasco.