- XML Reference Guide
- Overview
- What Is XML?
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Table of Contents
- The Document Object Model
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- DOM and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Implementations
- DOM and JavaScript
- Using a Repeater
- Repeaters and XML
- Repeater Resources
- DOM and .NET
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Downloads
- DOM and C++
- DOM and C++ Resources
- DOM and Perl
- DOM and Perl Resources
- DOM and PHP
- DOM and PHP Resources
- DOM Level 3
- DOM Level 3 Core
- DOM Level 3 Load and Save
- DOM Level 3 XPath
- DOM Level 3 Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- The Simple API for XML (SAX)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SAX and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- SAX and .NET
- Informit Articles and Sample Chapters
- SAX and Perl
- SAX and Perl Resources
- SAX and PHP
- SAX and PHP Resources
- Validation
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Document Type Definitions (DTDs)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Schemas
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- RELAX NG
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Schematron
- Official Documentation and Implementations
- Validation in Applications
- Informit Articles and Sample Chapters
- Books and e-Books
- XSL Transformations (XSLT)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XSLT in Java
- Java in XSLT Resources
- XSLT and RSS in .NET
- XSLT and RSS in .NET Resources
- XSL-FO
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XPath
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XML Base
- Informit Articles and Sample Chapters
- Official Documentation
- XHTML
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XHTML 2.0
- Documentation
- Cascading Style Sheets
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XUL
- XUL References
- XML Events
- XML Events Resources
- XML Data Binding
- Informit Articles and Sample Chapters
- Books and e-Books
- Specifications
- Implementations
- XML and Databases
- Informit Articles and Sample Chapters
- Books and e-Books
- Online Resources
- Official Documentation
- SQL Server and FOR XML
- Informit Articles and Sample Chapters
- Books and e-Books
- Documentation and Implementations
- Service Oriented Architecture
- Web Services
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Creating a Perl Web Service Client
- SOAP::Lite
- Amazon Web Services
- Creating the Movable Type Plug-in
- Perl, Amazon, and Movable Type Resources
- Apache Axis2
- REST
- REST Resources
- SOAP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- SOAP and Java
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- WSDL
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- UDDI
- UDDI Resources
- XML-RPC
- XML-RPC in PHP
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Ajax
- Asynchronous Javascript
- Client-side XSLT
- SAJAX and PHP
- Ajax Resources
- JSON
- Ruby on Rails
- Creating Objects
- Ruby Basics: Arrays and Other Sundry Bits
- Ruby Basics: Iterators and Persistence
- Starting on the Rails
- Rails and Databases
- Rails: Ajax and Partials
- Rails Resources
- Web Services Security
- Web Services Security Resources
- SAML
- Informit Articles and Sample Chapters
- Books and e-Books
- Specification and Implementation
- XML Digital Signatures
- XML Digital Signatures Resources
- XML Key Management Services
- Resources for XML Key Management Services
- Internationalization
- Resources
- Grid Computing
- Grid Resources
- Web Services Resource Framework
- Web Services Resource Framework Resources
- WS-Addressing
- WS-Addressing Resources
- WS-Notifications
- New Languages: XML in Use
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Google Web Toolkit
- GWT Basic Interactivity
- Google Sitemaps
- Google Sitemaps Resources
- Accessibility
- Web Accessibility
- XML Accessibility
- Accessibility Resources
- The Semantic Web
- Defining a New Ontology
- OWL: Web Ontology Language
- Semantic Web Resources
- Google Base
- Microformats
- StructuredBlogging
- Live Clipboard
- WML
- XHTML-MP
- WML Resources
- Google Web Services
- Google Web Services API
- Google Web Services Resources
- The Yahoo! Web Services Interface
- Yahoo! Web Services and PHP
- Yahoo! Web Services Resources
- eBay REST API
- WordML
- WordML Part 2: Lists
- WordML Part 3: Tables
- WordML Resources
- DocBook
- Articles
- Books and e-Books
- Official Documentation and Implementations
- XML Query
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- XForms
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Resource Description Framework (RDF)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Topic Maps
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation, Implementations, and Other Resources
- Rich Site Summary (RSS)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- Simple Sharing Extensions (SSE)
- Atom
- Podcasting
- Podcasting Resources
- Scalable Vector Graphics (SVG)
- Informit Articles and Sample Chapters
- Books and e-Books
- Official Documentation
- OPML
- OPML Resources
- Summary
- Projects
- JavaScript TimeTracker: JSON and PHP
- The Javascript Timetracker
- Refactoring to Javascript Objects
- Creating the Yahoo! Widget
- Web Mashup
- Google Maps
- Indeed Mashup
- Mashup Part 3: Putting It All Together
- Additional Resources
- Frequently Asked Questions About XML
- What's XML, and why should I use it?
- What's a well-formed document?
- What's the difference between XML and HTML?
- What's the difference between HTML and XHTML?
- Can I use XML in a browser?
- Should I use elements or attributes for my document?
- What's a namespace?
- Where can I get an XML parser?
- What's the difference between a well-formed document and a valid document?
- What's a validating parser?
- Should I use DOM or SAX for my application?
- How can I stop a SAX parser before it has parsed the entire document?
- 2005 Predictions
- 2006 Predictions
- Nick's Book Picks
In our last section, we discussed ways to make your web applications more accessible. It's worth noting, however, that the only reason we were able to
do that is because the authors of the HTML vocabulary and its descendants provided accessibility features such as the
alt
attribute for images and the summary
attribute for tables.
When you're designing your own XML language, you need to keep some of the same considerations in mind to help you along. The World Wide Web Consortium's Web Accessibility Initiative Technical Activity group has provided a list of guidelines and checkpoints to follow.
The list hasn't been finalized yet, but the concepts are sound so let's take a look at the guidelines and some specific things to consider in adhering to them. (Also, the last draft was in October, 2002, so they're obviously not in a big hurry to make changes.)
First off, let's understand what we're trying to accomplish. We want to make end-user-oriented languages -- meaning those ultimately intended for display in some human-readable form -- that do the following:
- Allow for text alternatives for all non-text content.
- Allow browsers (and potentially other user-agents) to find those alternatives.
- Allow authoring tools to understand what content the alternatives are for.
For example, suppose I were creating an XML vocabulary for television scheduling information. If I created a
commercial_video
element, I could satisfy all of these goals by including commercial_description
element as a child of the commercial_video
element, as long as I provided a way for user-agent developers
to know about the relationship so they could display the text instead of the video, if necessary. That same information
would be available to developers of authoring tools, enabling them to make sure that whenever an author used
a particular piece of video, the text went along with it.
That makes things seem pretty simple, but there's really more to the XML Accessibility Guidelines than that. The draft document lists four basic guidelines, each with a set of specific checkpoints. They are:
- Ensure that authors can associate multiple media objects as alternatives.
- Create semantically rich languages.
- Design an accessible user interface.
- Provide documentation and export semantics.
Basically, these guidelines cover the structure of the vocabulary, the form of the vocabulary, the use of the vocabulary, and the documentation of the vocabulary. Let's look at these guidelines in more detail:
-
Ensure that authors can associate multiple media objects as alternatives.
Notice that the guideline does not say "always add an
alt
attribute". What it means is that you should be able to associate different versions of the same content in such a way that tools can understand that they all represent the same content. One example of this in action is the XHTMLobject
element, which can contain several different versions of the same content.In normal use, the browser picks the first version of the content that it understands and ignores the rest. You could, however, create a vocabulary in which users and tools can choose which version to use. For example, you might have a user-agent that displays the text, but includes a button the user can click to show the image, and vice versa.
Basically, this guideline is intended to require you to enable associates in both directions, from text to non-text and back again, if necessary.
-
Create semantically rich languages.
The basic gist of this guideline is that your vocabulary should provide a way to define what the content represents, rather than how it looks when displayed, or even how it functions on the page. For example, I may know that my TV listings will ultimately be displayed in a table, but I would use elements such as
tv_movie
andsitcom_episode
rather thantable_row
, because they provide some kind of meaning.In addition, this guideline had more specific checkpoints, such as prohibiting the re-use of element names for different functions. For example, I'd want to have a
commercial_video
element and asitcom_video
element, rather than calling them bothvideo
and relying on the application to tell the difference by looking at the element's parent.This guideline also suggests re-using existing accessible structures, such as the XHTML
object
element, and using standard mechanisms, such as XLink and XPointer, where possible.Finally, this guideline requires that if your application serves the "final form" of a document, such as an XHTML transformation, that details of how to obtain the original XML should also be present.
-
Design an accessible user interface.
This guideline is more about the application that accesses the data than it is about the data itself, but some suggestions affect the structure of the data. For example, the guideline requires that "navigable structures" such as lists, and guideline number 2 suggests you create classifications, groupings and lists top help organize the data. This guideline also prohibits dependence on a certain type of interaction such as a mouse click, or even on a particular device, going for device-independence instead. It also suggests providing a way for users to control the pace of a presentation, such as a "pause" button or link.
The rest of the guideline requires you to step back and look at your creation, providing default stylesheets for each modality (i.e. screen, print, audio), and CSS or XSL to produce an outline of the data.
-
Provide documentation and export semantics.
This guideline deals with one of the most important -- and most overlooked -- aspect of accessibility: documentation. If nobody can find the accessibility features for your language, nobody's going to use them. Much of the guideline focuses on the issue of the language schema. If you're defining a language, you're going to have one, because that is the definition. This guideline basically prohibits the use of DTDs to define a language by requiring you to use a schema that make's it possible to add machine-readable documentation about your elements and attributes. Because DTDs are generally unstructured, that's not possible. Note that the guideline does not require W3C XML Schemas. Using another schema language such as RELAX-NG is fine, as long as you include the proper documentation.
Another aspect of this guideline is ensuring the usefulness of the documentation you create. First off, it must be accessible (using these guidelines), and it must be retrievable from information in the actual data. For example, you can use the
xsi:schemaLocation
element to tell an application where to get the schema.Within the documentation, you need to make sure that the information is actually useful. For example, you can't assume that element and attribute names mean anything, no matter how semantically careful you were in constructing them. For example, you can't define the
commercial_video
element as, say, "video for a commercial". You'd need a definition more like "Information and metadata about the audio-visual content of this advertisement.". Remember, there may be those following after you that don't speak the language you were using when you constructed the document.Finally, make sure that you document the accessibility features that you've built into your language, and require applications to support these features in order to be considered conformant.
Ultimately, this list may change, but the overall concepts are likely to remain. For a full (and current) list of checkpoints for each of these guidelines, see the XML Accessibility Guidelines.