W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > November 2008

Re: Help needed

From: Francois Daoust <fd@w3.org>
Date: Thu, 06 Nov 2008 09:39:55 +0100
Message-ID: <4912AD5B.6040105@w3.org>
To: peter sham <peter.sham83@gmail.com>
CC: Miguel Garcia <miguel.garcia@fundacionctic.org>, public-mobileok-checker@w3.org

Hi Peter,

I'm not so sure I understand what your question encompasses or not. Let 
me try to answer it with the example of the ImagesSpecifyTest test. 
Let's pretend this test is not part of the Checker yet and that you want 
to add it. The test will be handled by some XSLT stylesheet.

Here is what you would have to do.

Step 1: Create an ImagesSpecifySizeTest java class.
The Class should extend the AbstractXSLTTestImplementation abstract 
class. The abstract class contains the code to actually fetch and apply 
the XSLT stylesheet. You shouldn't have any specific code to add there, 
apart from setting the test type to the one you're about to create in 
Step 2 below.

Step 2: Add the test to the list of tests
The Checker has to know that the test exists.
This is done by completing the TestType.java file:
- add an IMAGES_SPECIFY_SIZE to the TestType enum
- add "temp.put(IMAGES_SPECIFY_SIZE, new ImagesSpecifySizeTest());" to 
the mapping


Step 3: Create the ImagesSpecifySizeTest XSLT
The name of the XSLT file has to match the name of the Java class.
Create the file in the xslt subfolder.
The XSLT is applied to the MOKI document.
The XSLT is to generate a "<test>[blah]</test>" section that will be 
automatically merged with the rest of the tests to produce the final result.


Step 4: Compile the checker
Running "ant build-deploy-jar" from the command-line should do 
everything for you if you've put the new files among the existing ones.
It does 2 things:
  1/ compilation of the code in itself, which could be done by some 
other means (e.g. using Eclipse)
  2/ compilation of the new XSLT file. The Checker uses Saxon to parse 
and apply the XSLT stylesheets. Compilation of the XSLT stylesheets 
increases performance. The compilation can be done manually by following 
the instructions in:

The Checker should then apply the new test and return the result in its 
output XML.

Hope this helps answering your question,

peter sham wrote:
> Hi Miguel,
> I have gone through recent posts. My query over here is on XSLT, How it 
> is interacting with the mokidocument/mokisource and getting test 
> results. If I want to add queries for image then where i should put it 
> in xsl, Some pointer would be helpful.
> Could you please put some flash on it?
> Regards,
> Peter.
> On Tue, Nov 4, 2008 at 10:08 PM, Miguel Garcia 
> <miguel.garcia@fundacionctic.org 
> <mailto:miguel.garcia@fundacionctic.org>> wrote:
>     Hi Peter,
>     It seems like we have discussed this issue recently. I suggest
>     you to read the complete thread starting at [1].
>     Anyway, if after reading the thread you still have any doubt, don't
>     hesitate to ask again.
>     [1]
>     http://lists.w3.org/Archives/Public/public-mobileok-checker/2008Oct/0009
>     ..html
>     <http://lists.w3.org/Archives/Public/public-mobileok-checker/2008Oct/0009.html>
>     Regards,
>     Miguel
>     ________________________________________
>     De: public-mobileok-checker-request@w3.org
>     <mailto:public-mobileok-checker-request@w3.org>
>     [mailto:public-mobileok-checker-request@w3.org
>     <mailto:public-mobileok-checker-request@w3.org>] En nombre de peter sham
>     Enviado el: martes, 04 de noviembre de 2008 10:46
>     Para: public-mobileok-checker@w3.org
>     <mailto:public-mobileok-checker@w3.org>
>     Asunto: Help needed
>     Hi,
>     I would like to create a new test case
>     Description:
>     I want to check whether a particular image is available in given URI or
>     not.
>     I have written logic to check that value, but I would like to know how
>     to use XSLT to write output. i.e. if image present in mokidocument then
>     it should print PASS otherwise FAIL in Result Document.
>     Could you please assist me what is the role of .sxx and XSL/XSLT in it.
>     How I can add my XSL/XSLT for the same?
>     Any good exaple would be greate help.
>     Regards,
>     Peter Sham.
Received on Thursday, 6 November 2008 08:41:04 UTC

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