This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 199 - Validator "API" Needs Sample Code.
Summary: Validator "API" Needs Sample Code.
Status: RESOLVED WORKSFORME
Alias: None
Product: Validator
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 0.6.1
Hardware: All All
: P2 enhancement
Target Milestone: 0.8.1
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://lists.w3.org/Archives/Public/w...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-19 02:09 UTC by Terje Bless
Modified: 2007-08-06 06:30 UTC (History)
0 users

See Also:


Attachments

Description Terje Bless 2003-04-19 02:09:06 UTC
The various "APIs" to the Validator needs sample code to demonstrate how to use
them. SOmething in the vein of the Perl snippet in the URL but for multiple
languages, platforms, and environments.
Comment 1 Terje Bless 2003-05-24 07:47:00 UTC
Retargetting 0.7.0 (by which time it may be mooted by SOAP).
Comment 2 Terje Bless 2004-09-01 13:03:43 UTC
Retargetting for 1.0; ain't gonna happen for 0.7 (and neither is SOAP).
Comment 3 Olivier Thereaux 2006-10-31 01:28:28 UTC
I think http://validator.w3.org/docs/api.html covers this. 
So does http://validator.localhost/docs/users.html#Output to some extent.
closing.
Comment 4 Terje Bless 2006-10-31 08:18:37 UTC
There's not a single line of code in the API docs referenced. -> Reopening.
Comment 5 Olivier Thereaux 2006-11-01 14:47:18 UTC
(In reply to comment #4)
> There's not a single line of code in the API docs referenced. 

Then I disagree code samples are necessary. I'd rather we encouraged building libraries (see e.g http://www.w3.org/QA/2006/10/validator_api.html on the QA weblog), and link to these libraries.
Comment 6 Terje Bless 2006-11-01 20:22:22 UTC
(In reply to comment #5)
> Then I disagree code samples are necessary. I'd rather we encouraged building
> libraries []

The relationship between those options is not "either or" but "and"; code samples are a good way to encourage building libraries.
Comment 7 Brett Bieber 2007-06-11 15:51:01 UTC
(In reply to comment #4)
> There's not a single line of code in the API docs referenced. -> Reopening.
> 

If code is provided to interact with the API, the W3 would need to maintain their own library to interact with the API. I think this is unnecessary at the moment and we should just link to API libraries which have code samples and documentation. I feel that the W3 has fulfilled enough of an obligation by providing the SOAP output without causing additional coding support.

The other alternative is to make an official API library supported by the W3, but this would add non-core burden on the validator team (there are already libraries which are in the wild and supported externally).

A library which does have documentation and code samples is available at pear.php.net which could be link in the libraries references which may fulfill some of this bug.

Link to library homepage:
http://pear.php.net/package/Services_W3C_HTMLValidator

API and methods available for the library:
http://pear.php.net/package/Services_W3C_HTMLValidator/docs/latest/Services_W3C_HTMLValidator/Services_W3C_HTMLValidator.html

API interaction example:
http://pear.php.net/manual/en/package.webservices.services-w3c-htmlvalidator.examples.php

Comment 8 Olivier Thereaux 2007-08-06 06:30:42 UTC
Just added a link to the PEAR library into the API documentation. 

As for whether to give actual code bits to access the API, I have to admit:
* I 've never see it done (checked a number of APIs like flickr, they all detail their API and give a list of libraries that bind to it)
* I don't know how to do it without actually writing a library and showing the code, which I believe would be too verbose for the documentation. 

given the above, and although I do understand Terje's points, I'm closing as WORKSFORME.