MarkupValidator/Feedback

From W3C Wiki
< MarkupValidator
Revision as of 12:48, 27 September 2005 by (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


W3C MarkUp Validator Feedback

Please collect links to feedback on the MarkupValidator here. Please add proper titles to URI-only links.

Usability

Planning

New Features

  • provide a "try your valid content with the ..... MIME-type"-link (so basically providing a sort of proxy, cause webservers sometimes serve content with wrong MIME-type, SVG content being an example)
    • Here's some PHP-code that serves valid SVG with the image/svg+xml MIME-type, otherwise giving the validator result:
<?php
if ($url!=""){
	$error=1;
	$reportURL="http://validator.w3.org/check?uri=".urlencode($url);
	$feedback=file_get_contents($reportURL);
	$valid_svg='2 class="valid">This Page Is Valid SVG 1.1!</';
	if (substr_count($feedback,$valid_svg)==1){
		if (substr_count($feedback,"Warning")==0){
			if (substr_count($feedback,"Error")==0){
				header("Content-type: image/svg+xml");
				echo(file_get_contents($url));
				$error=0;
			}
		}
	}
	if ($error!=0) header("Location: $reportURL"); /* When the non-perfect W3C-validator doesn't like it: "no SVG for you!" */
}else{
	header("Content-type: text/html");
	echo('
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>SVG MIME proxy</title>
		<style type="text/css">
			body{
				text-align:center;
			}
		</style>
	</head>
	<body>
		<h3>your URL?</h3>
		<form method="GET" action="">
			<input type="text" name="url" value="http://" size="50"><br>
			<input type="submit" value="go serve this as image/svg+xml">
		</form>
	</body>
</html>
');
}
?>
 which is running at http://svgopen.steltenpower.com/2004/svgproxy.php, also callable through bookmarklet: javascript:location.href=("http://svgopen.steltenpower.com/2004/svgproxy.php?url="+escape(location.href));
  • provide a "make the URL end with .svg to force IE to recognize it as such"-link
    • PHP-code
<?php
if ($url!=""){
	$len=strlen($url);
	if (substr($url,($len-4))!=".svg"){
		if (substr_count($url,"?")>0) $url.="&";
		else $url.="?";
		$url.="IEloves=.svg";
	}
	$proxyURL="http://svgopen.steltenpower.com/2004/svgproxy.php?url=".urlencode($url);
	header("Location: $proxyURL");
}else{
	header("Content-type: text/html");
	echo('
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>SVG in IE</title>
		<style type="text/css">
			body{
				text-align:center;
			}
		</style>
	</head>
	<body>
		<h3>your URL?</h3>
		<form method="GET" action="">
			<input type="text" name="url" value="http://" size="50"><br>
			<br>
			<input type="submit" value="go make IE recognize this as SVG">
		</form>
	</body>
</html>
');
}
?>
 which is running at http://svgopen.steltenpower.com/2004/SVGinIE.php, also callable through bookmarklet: javascript:location.href=("http://svgopen.steltenpower.com/2004/SVGinIE.php?url="+escape(location.href));
  • provide a "try your valid SVG content in a webstarted Squiggle"-link in case of SVG content
    • A webstarted Squiggle is now available at [1], also callable through bookmarklet: javascript:location.href=("http://arc.mcc.id.au/batik-nightly/webstart/squiggle.pl?uri="+escape(location.href));
  • provide a "try your valid SVG content as PNG, PDF, etc"-link in case of SVG content
  • ...