SVG QA activities: W3C validator adds SVG DOCTYPE overrides, and some more?


Posted by stelt apropos tools on Thu Oct 26th, 2006 at 14:21:45 BST

W3C has just updated its validator (known by anyone who has built more than a few webpages as THE validator) to include new options for SVG. A validator is important to ensure that content intended to be SVG does indeed conform to the specification, so it reaps the advantages of a standard and to prevent later unpleasant surprises (to make sure that you haven't simply been coding to a single implementation, and that the content survives being repurposed). Before, the official W3C Validator insisted on having a DOCTYPE in your content, a controversial imposition that not all authoring tools followed. The more flexible 'Jiggles' only accepts SVG 1.0 content, so this is a welcome change to the Validator.
See the full story for more ongoing activities on validators and cross-viewer SVG (related, but not the same):

-The W3C validator is being developed into a more modular implementation called the Unicorn.
This also gives next to the fact that the W3C validator's source is available, an extra option for cooperation, namely combining output.

There are quite a few validators and related test tools around the web that could adjust their output format a little to fit a Unicorn setting.
A quite untraditional example are the SVG-specific hacks recently added to the Open Clip Art project. Not just detecting errors, but also help in fixing them, dodging viewer limitations and giving other advice its scope is potentially somewhat wider.

sidenotes:
-tested a random batch of SVG files in collections:Tango bugs, Wikipedia bugs (compare that to average HTML!)
-SVG validity doesn't imply SVG conformance
-Also test on several viewers! (for desktops: Batik and Opera give the most valuable error feedback, none is 100% perfect),
-SVG 1.2, no longer using a DTD, seriously improves validation
Display: Sort:
"The W3C validator is being developed into a more modular implementation called the Unicorn"
would be more accurately written as
"The W3C validator is being integrated into a more modular implementation called the Unicorn."

Because, the validator is not going to be replaced by unicorn. Unicorn is only going to make it possible to mix and match observers/validators for each document.

Thanks!
--olivier

As i wanted loads of URLs to test some SVG validating experiments on i set out to write a spider. Somehow the HttpRequest didn't get installed right, so i messed up my code a bit more, making it way less efficient along the way, by using web-sniffer. That didn't work right away, i lost energy, and now i put it here so i (or better, someone else) can find it and improve it later.

<?php
header("Content-Type:text/plain");

$link=array();
$link['uri']="http://svg.startpagina.nl";
$link['level']=0;

$low=0;
$high=$low;

$links=array();
$links[$low]=$link;

$deepest=3;
while(true){
    search($links[$low++]);
}

function extension($url){ // svg html
    $path_parts = pathinfo(parse_url($url,PHP_URL_PATH));
    return $path_parts['extension'];
}

function hPos($end){
    return (stripos($content,"href=",$end));
}

function addLinks($content,$level){
    global $links,$deepest,$high;
    $end=1;
    if($level<$deepest){
        for($start=hPos($end); $start>0; $start=hPos($end)){
            $opensq=strpos($content,"'",$start);
            $opendq=strpos($content,'"',$start);
            if ($opensq<$opendq) {
                $quot="'";
            }else{
                $quot='"';
            }
            $start=min($opensq,$opendq)+1;
            $end=strpos($content,$quot,$start)-1;
            $extra=array();
            $extra['uri']=substr($content,$start,$end-$start+1);
            $extra['level']=$level+1;
            $links[++$high]=$extra;
        }
    }
}

function search($link){
    global $links,$deepest;
    print_r($links);
    $uri=$link['uri'];
if ($uri!=""){   
    $level=$link['level'];
    if ($level>$deepest) {exit();}
    if ($level==0) {
        $ext="html";
    }else{
        $ext=extension($uri);
    }
    if ($ext=="svg") { echo "\n".$uri ; }
    //$req = new HttpRequest($uri, HttpRequest::METH_GET);  // Parse error: parse error, expecting `'('' in c:\program files\easyphp1-8\www\megavalidate.php on line 62
    //try{
/*
        $req->send();
       if ($req->getResponseCode() == 200) {
           $mime=$req->getResponseHeader("Content-Type");
*/
            sleep(10);
            $sniffURL="http://web-sniffer.net/?url=".rawurlencode($uri)."&submit=Submit&http=1.1&gzip=yes&type=HEAD&ua=Mozilla%2F5.0+%28Windows%3B+U%3B+Windows+NT+5.1%3B+en-US%3B+rv%3A1.8.1%29+Gecko%2F20061010+Firefox%2F2.0+Web-Sniffer%2F1.0.24";
            echo("\nsniffURL=$sniffURL");
            $sniffing=file_get_contents($sniffURL);
            echo("\n\n\nsniffing=$sniffing");
            $before="Content-Type:</td><td>";
            $start=strrpos($sniffing,$before)+strlen($before);
            $after=strpos($sniffing,"</td>",$start);
            $mime=substr($sniffing,$start,$after-$start);
            echo ("\nstart=$start");
            echo ("\nafter=$after");
            echo ("\nmime=$mime");
           if (($mime=="image/svg+xml")&&($ext!="svg")) {echo("\n$uri");}
           if (($mime!="image/svg+xml")&&($ext=="svg")) {echo("ERROR");}
           if ($mime=="text/html"){
               //$content=$req->getResponseBody();
               $content=file_get_contents($uri);
               $extraLinks=addLinks($content,$level);
           }
       }
/*
    } catch (HttpException $ex) {
       echo $ex;
    }
}
*/
}
?>

update:
See http://www.w3.org/QA/Tools/Icons and notice "... all available in PNG, GIF, SVG and EPS. To link to a specific version directly, add .png, .gif, .svg or .eps to the generic URI."

And btw, you can ignore the PHP post below

w3c (none / 0) (#4)
by gent00 on Sun Aug 5th, 2007 at 23:02:54 BST
(User Info) http://www.onlineflashgames.org
Nice updates, but w3c doesn't like my sites :)

Update (none / 0) (#5)
by Films on Fri Aug 17th, 2007 at 15:00:45 BST
(User Info) http://world-films.org
Nice updates? thank's.

nice (none / 0) (#15)
by Felsefe (info@anarsist.org) on Sun Sep 30th, 2007 at 06:47:18 BST
(User Info) http://www.anarsist.org/
looks very good!

spider (none / 0) (#16)
by pron1ck on Wed Oct 10th, 2007 at 09:08:20 BST
(User Info) pron1ck
As i wanted loads of URLs to test some SVG validating experiments on i set out to write a spider. Am | Video izle | izle

Display: Sort:
Login

Make a new account

Username:
Password: