W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > February 2007

RE: Some draft code for mobileOK Basic Tests RI

From: Jo Rabin <jrabin@mtld.mobi>
Date: Thu, 8 Feb 2007 13:03:39 -0500
Message-ID: <815E07C915F39742A29E5587B3A7FA19289B51C7@lk0-cs0.int.link2exchange.com>
To: Roland Gülle <roland@7val.com>
Cc: <public-mobileok-checker@w3.org>
I incorporated your stylesheet (and modified it a bit) into the one attached, when run on the same page as before (http://rabin.mobi/r/format?uri=http://t-mobile.mobi) it generates the following:

<?xml version="1.0" encoding="UTF-8"?>
<result xmlns="http://resultdoc.mobi" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:metadoc="http://metadoc.mobi">
	<note>Test results for http://t-mobile.mobi</note>
	<test name="auto_refresh">
		<note>No meta http-equiv 'refresh' declarations were found</note>
	</test>
	<test name="caching">
		<result outcome="WARN">Cache-Control no-cache directive found</result>
		<result outcome="WARN">Pragma no-cache directive found</result>
	</test>
	<test name="character_encoding">
		<result outcome="FAIL">utf-8 encoding not declared (, iso-8859-1, us-ascii)</result>
		<note>meta http-equiv is application/xhtml+xml; charset=us-ascii</note>
		<note>http content-type is text/html</note>
		<note>xml encoding is iso-8859-1</note>
		<result outcome="WARN">Included resource did not specify utf-8 encoding</result>
		<note>resource was http://t-mobile.mobi/styles/tmo_pda.css, encoding was text/css</note>
	</test>
	<test name="page_size_limit">
		<note>Total page weight is 12071 consisting of 5750 in the original page, stylesheets totalling 2637 and images totalling 3684</note>
	</test>
	<test name="access_keys">
		<result outcome="INFO">15 a Links, 0 have an accesskey assigned and 15 do not</result>
	</test>
</result>
> -----Original Message-----
> From: Roland Gülle [mailto:roland@7val.com]
> Sent: 08 February 2007 13:57
> To: Jo Rabin
> Cc: public-mobileok-checker@w3.org
> Subject: Re: Some draft code for mobileOK Basic Tests RI
> 
> > Purely as a recreational exercise this is along similar lines:
> >
> > http://rabin.mobi/r/format?uri=http://t-mobile.mobi
> Very cool!
> Here the beginning of a small XSLT that checks the output.
> The complete page size is checked and if all links has an accesskey
> with a keypad number.
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> 
>    <xsl:output method="xml" indent="yes"/>
> 
>    <xsl:template match="/">
>      <result>
>        <!-- page checks -->
>        <xsl:call-template name="testCompletePageSize"/>
> 
>        <!-- element checks -->
>        <xsl:apply-templates select="//tidiedPayload"/>
>      </result>
>    </xsl:template>
> 
> 
>    <!--
>        link validation
>    -->
>    <xsl:template match="*[local-name() = 'a']">
>      <check name="linkAccessKey" value="{@accesskey}">
>        <xsl:attribute name="linkAccessKey" >
> 	<xsl:choose>
> 	  <xsl:when test="number(@accesskey) &gt;= 0 and number(@accesskey)
> &lt;= 9">passed</xsl:when>
> 	  <xsl:otherwise>failed</xsl:otherwise>
> 	</xsl:choose>
>        </xsl:attribute>
>      </check>
>      <xsl:apply-templates/>
>    </xsl:template>
> 
>    <xsl:template match="node()">
>      <xsl:apply-templates/>
>    </xsl:template>
> 
> 
>    <!--
>        page size check
>    -->
>    <xsl:template name="testCompletePageSize">
>      <xsl:variable name="completePageSize" select="sum(//payload/
> @size)"/>
>      <check name="completePageSize" value="{$completePageSize}">
>        <xsl:attribute name="result">
> 	<xsl:choose>
> 	  <xsl:when test="$completePageSize &gt; 10000">failed</xsl:when>
> 	  <xsl:otherwise>passed</xsl:otherwise>
> 	</xsl:choose>
>        </xsl:attribute>
>      </check>
>    </xsl:template>
> </xsl:stylesheet>



Received on Thursday, 8 February 2007 18:03:49 GMT

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