W3C home > Mailing lists > Public > public-wai-ert@w3.org > May 2006

Re: (X)HTML to EARL via XSLT

From: Vicente Luque Centeno <vlc@it.uc3m.es>
Date: Wed, 3 May 2006 18:54:48 +0200 (CEST)
To: Christophe Strobbe <christophe.strobbe@esat.kuleuven.be>
Cc: public-wai-ert@w3.org
Message-ID: <Pine.LNX.4.61.0605031830380.5273@violin.it.uc3m.es>

I have already translated most of my XSLT templates into Schematron rules 
(only in a paper, bummer ;-) and into XQuery expressions. However, I have 
no idea about how Schematron support can be got with XSLT tools. Another 
important thing: How can variables be represented in Schematron? There are 
some XSLT expresions that require the usage of multiple variables and the 
"current()" Schematron expression is not enough when I need to use more 
than one variable. Could you help me on that? Could you translate the 
following rule into Schematron?

<xsl:for-each select="//xhtml:select | //xhtml:textarea |
         //xhtml:input[@type='password' or
             @type='text' or
             @type='checkbox' or
             @type='radio' or
             @type='file']">
  <xsl:variable name="ff" select="." />
  <xsl:variable name="labels" select="//xhtml:label[@for = $ff/@id]"/>
  <xsl:if test="count($labels)&gt;1 or (count($labels)=0 and not(@title))">
    <li><xsl:apply-templates select="$ff" mode="print" /> has
    <strong><xsl:value-of select="count($labels)" /></strong> labels.</li>
    <xsl:text>&#10;</xsl:text>
  </xsl:if>
</xsl:for-each>

If this rule is expressible in Schematron, please, tell me how. It states 
that any non-hidden form field without a title attribute, should have a 
label describing its purpose. $ff is each form field. $labels is the set 
of labels referring $ff.

I could easily modify my XSLT file to produce EARL reports as well (the 
wa-earl.xslt file of the step 4 you already mentioned). Maybe in few hours 
I could easily get it to produce "rude" EARL reports. But I also felt that 
I would not be able to exploit all the EARL features and I'd rather have 
well ellaborated EARL reports instead of "rude" EARL reports.

Thanks a lot.

Vicente Luque Centeno
Dep. Ingeniería Telemática
Universidad Carlos III de Madrid
http://www.it.uc3m.es/vlc

On Wed, 3 May 2006, Christophe Strobbe wrote:

>
> Hi Vicente,
>
> At 17:00 3/05/2006, Vicente Luque Centeno wrote:
> <quote>
> Yes, it is possible to rewrite my XSLT templates into Schematron rules (and 
> some other constraint languages as well), but I am not volunteeing either 
> ;-). I think that making a hierarchy of XSLT files would be easier. At least 
> XSLT has a wider tool support than Schematron and is a W3C recommendation by 
> itself. Anyway, can you give us some reference that explains how Schematron 
> rules can generate EARL reports by default?
> </quote>
>
> I thought that Schematron support is a non-issue because all you need is an 
> XSLT that turns the Schematron file into the actual validator/XSLT file that 
> generates the output you want.
> The idea is that you
> 1) first create your Web Accessibility Schematron (wa.sch),
> 2) create schematron-earl.xslt,
> 3) "compile" your schematron, e.g. with C:\saxon wa.sch schematron-earl.xslt 
>> wa-earl.xslt
> 4) then "validate" the XHTML page, e.g. with C:\saxon bad.xhtml wa-earl.xslt 
>> bad.xhtml.earl.
>
> The difficult part is writing schematron-earl.xslt. As far as I know there 
> are XSLTs for HTML (schematron-report.xsl), XML (schematron-xml.xsl) and 
> plain text (schematron-basic.xsl).
>
> There is already a small Schematron example for checking against WCAG 1.0 
> referenced at the bottom of 
> http://xml.ascc.net/schematron/1.5/message1-5/schematron-message.html.
>
> Regards,
>
> Christophe
>
> ---previous message---
> On Wed, 3 May 2006, Christophe Strobbe wrote:
>
>
>>> Hi Vicente,
>>> 
>>> At 21:25 30/04/2006, Vicente Luque Centeno wrote:
>>> <quote>
>>> I have recently developed a Web Accessibility evaluator in a single XSLT
>>> file (namely WAEX). You can find it at http://www.it.uc3m.es/vlc/waex.html
>>> (...)
>>> I would be happy that someone could collaborate by modifying this (rather 
>>> simple but complete) XSLT file to generate EARL reports as well. The XSLT 
>>> file is at http://www.it.uc3m.es/vlc/wcag.xsl
>>> </quote>
>>> 
>>> Since you want different output formats but you probably don't want to 
>>> maintain different versions of the XSLT file, I wonder if it wouldn't be 
>>> possible to make this just a little bit more "abstract" by turning the 
>>> XSLT into a Schematron [1] schema, so that you have various output formats 
>>> by default. If someone would write a schematron-earl.xslt, this xslt would 
>>> be useful beyond accessibility checking. (I'm not volunteering, though.)
>>> (...)
>> 
>> --
>> Christophe Strobbe
>> K.U.Leuven - Departement of Electrical Engineering - Research Group on 
>> Document Architectures
>> Kasteelpark Arenberg 10 - 3001 Leuven-Heverlee - BELGIUM
>> tel: +32 16 32 85 51
>> http://www.docarch.be/ 
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>
>
Received on Wednesday, 3 May 2006 16:54:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:27 GMT