Re: Any suggestion on how to integrate into a desktop app

Hi Mike,

On Tue, May 24, 2005, Mike Zornek wrote:
> I'm building a desktop application on Mac OS X that will traverse a 
> website,
> checking for broken links, missing images, and the like. I'd like to 
> embed
> the W3C Markup Validator as well to let the users know if the page is
> "valid" or not.

Cool!


> Now rather that try to do this over a web service I'd prefer to 
> integrate
> the validator in my app so the pages can be checked locally. Looking 
> over
> the source it seems the validator was built with the understanding 
> that it
> would run under an apache install only.

Yes, the validator was written with CGI in mind, and even though we've
been working a lot on making the codebase cleaner (remove inline HTML,
etc), it is still very much a cgi in the way it works. it does not,
however, depend too much on apache, and it *can* be used from the
commandline, e.g:

validator/httpd/cgi-bin% ./check uri=http://www.w3.org output=n3
Content-Type: text/plain; charset=UTF-8
X-W3C-Validator-Status: Valid
X-W3C-Validator-Errors: 0

@prefix earl: <http://www.w3.org/2001/03/earl/1.0-test#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix val: 
<http://validator.w3.org/this_will_change/do_not_rely_on_it!> .

<http://validator.w3.org/> a earl:Assertor;
   earl:name "W3 Validator";
   earl:asserts
     [
       earl:testMode earl:Auto;
       rdf:predicate earl:passes;
       rdf:subject   [earl:testSubject <http://www.w3.org/>];
       rdf:object    [
                       earl:id <http://www.w3.org/HTML/>;
                       earl:note "Valid"
                     ]
     ]
  .

Also, note that although the validator does quite a lot of parsing and 
processing, it is *mostly* a wrapper around openSP+an SGML+xml 
catalogue, made to present results in a "nice" way.  And openSP can run 
from the command line...

> I wonder if there has every been any
> work as creating a standalone command line utility to encapsulate the
> validator? If you know of any such undertaking please let me know. 
> Else I'm
> happy to hear your thoughts on other ways I might get the integration 
> I'm
> looking for.

I can not think of a commandline tool right now (possibly because 
opensp mostly fills that role), but I've seen an IE bar and a windows 
desktop tool both (AFAIK) based on some version of SP, and developed by 
people on this list...

Hope this helps.
-- 
olivier

Received on Thursday, 26 May 2005 10:17:19 UTC