- From: Rick JELLIFFE <ricko@geotempo.com>
- Date: Thu, 04 May 2000 22:20:14 +0800
- To: w3c-wai-er-ig@w3.org, ricko@gate.sinica.edu.tw
I have been trying to think of a way to add repair as well as diagnosis to Schematron Schemas (e.g. for WAI); it wasn't a direction I intended to take it originally, but I can think of one possibility. I am not sure that it would be particularly useful, so I welcome any input on this: if it seems to be useful, then I will add it. The idea would be something like this: <pattern> <rule context="html:img"> <assert test="string-length(@alt) > 0" repairer="altRepair" >An image should have alternative text.</assert> </rule> <repair name="altRepair" at="@alt" >(The image '<value-of select="@src"/>' does not have a description.) </repair> </pattern> which would convert <img src="x.gif"/> to <img src="x.gif" alt="(The image 'x.gif' does not have a description.)"/> This kind of thing would allow insertions of elements, attributes and their values at arbitrary places determined from the context nodes. But I am not sure if this is really useful. (The technique to implement this, btw, is that first the document is processed to add identifier attributes to every element that fails an assertion--these identifiers label which rule fails. The a second step performs a transformation that decorates the tree with the additional elements. This two-step process is needed because otherwise adding subelements and attributes would change the tree, so we cannot use the path addresses of elements to repair them.) Anyway, my main question is whether this kind of simple automated repair is useful or not. As a related matter, it is conceivable (though I don't want to implement it) that there could be a more interactive repair possible: the first stage that detects problems queries the user for, in particular, text messages. <pattern> <rule context="html:img"> <assert test="string-length(@alt) > 0" repairer="altRepair" >An image should have alternative text.</assert> </rule> <repair name="altRepair" at="@alt" ><prompt href="@src" >Please provide alternative text for image '<value-of select="@src"/>'</prompt> </repair> </pattern> in which the element prompt gives the text of a dialog prompt that the user would see: the UI gives them a chance to look at the resource in question (through the href) and they reply with a text string. This string it then the contents of the repair element, which get put into the alt attribute in this case. Again, I am really not sure whether this kind of thing would scale up to allow the actual kinds of repairs that might be needed on XHTML (and other data), without bloating into requiring a zillion different forms and attributes, giving a poor simulation of a programming language. Rick Jelliffe
Received on Thursday, 4 May 2000 10:12:47 UTC