Re: 'role' should be property

2007/5/31, Mark Birbeck:
>
> Hi Thomas,
>
> > If you put semantic data (because I think "roles" belong to the
> > semantic facet of documents, the one which allows accessibility for
> > everyone) in a stylesheet (or "rolesheet"), the document could
> > potentially not have the same "meaning" depending on whether the sheet
> > is loaded (supported by the UA) or not. Even worse, you could change
> > the semantics of a document by just changing the sheet being used!
>
> Hey...great...you're getting the idea!
>
> Just teasing...but that is the whole point of Dmitri's proposal. One
> could take a document over which you have no control, such as an
> online newspaper like the New York Times, and then use a stylesheet
> that says, the second 'div' with a class of 'xyz' is actually the main
> menu, i.e., role="menu". An accessibility interface could make use of
> that...a metadata storage system could make use of it...and so on.

If you have no control over the document, you cannot add a link to the
"rolesheet". Just use a transformation tool (XSLT* or another tool of
your own using CSS-like selectors) to add the role= attributes where
you think they should be and let your accessibility interface or
metadata storage system consume the transformed version instead of the
original one.

* oh yeah you can use XSLT on an HTML source document: download
html5lib, use the lxml.tree treebuilder to parse the document into an
lxml.tree, and then use lxml's XSLT facilities to transform the parsed
document into another tree. You could then use the (still under active
development) HTMLSerializer from the same html5lib package to
serialize everything's back into HTML5 (rather than XHTML as you would
generally have with an XML processing chain).

-- 
Thomas Broyer

Received on Thursday, 31 May 2007 14:51:25 UTC