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

Re: Some draft code for mobileOK Basic Tests RI

From: Roland Gülle <roland@7val.com>
Date: Thu, 8 Feb 2007 14:57:24 +0100
Message-Id: <C816DC56-BD55-4747-ADB2-F48BB0E9D2C3@7val.com>
Cc: <public-mobileok-checker@w3.org>
To: "Jo Rabin" <jrabin@mtld.mobi>

> 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"  

   <xsl:output method="xml" indent="yes"/>

   <xsl:template match="/">
       <!-- page checks -->
       <xsl:call-template name="testCompletePageSize"/>

       <!-- element checks -->
       <xsl:apply-templates select="//tidiedPayload"/>

       link validation
   <xsl:template match="*[local-name() = 'a']">
     <check name="linkAccessKey" value="{@accesskey}">
       <xsl:attribute name="linkAccessKey" >
	  <xsl:when test="number(@accesskey) &gt;= 0 and number(@accesskey)  
&lt;= 9">passed</xsl:when>

   <xsl:template match="node()">

       page size check
   <xsl:template name="testCompletePageSize">
     <xsl:variable name="completePageSize" select="sum(//payload/ 
     <check name="completePageSize" value="{$completePageSize}">
       <xsl:attribute name="result">
	  <xsl:when test="$completePageSize &gt; 10000">failed</xsl:when>
Received on Thursday, 8 February 2007 13:57:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:21:17 UTC