W3C home > Mailing lists > Public > www-validator@w3.org > March 2007

Re: Feature request: validation by snippet

From: Michael Adams <linux_mike@paradise.net.nz>
Date: Fri, 23 Mar 2007 23:53:15 +1200
To: www-validator@w3.org
Message-id: <20070323235315.7d831a94.linux_mike@paradise.net.nz>

On Thu, 22 Mar 2007 21:24:39 -0400
Stephanie Troeth wrote:

> 
> When you are creating templates using any kind of templating system
> that is part of a content management system, often you are only
> creating markup for a module that will eventually appear within a
> greater page.
> 
> Hence, if you just want to validate the chunk of code that applies to 
> what you are building, a validator for snippets is immensely useful.
> 

Not sure if you are using PHP or another system but how about just
setting up a wrapper that includes the relevant snippet and validate
that.

************
<!DOCTYPE ...as required...>
<html>
<head><title>Snippet tester</title></head>
<body>

<?php include ("snippet.php"); ?>

</body>
</html>
***********

You could improve this by entering the address of the file into a
posted variable for inclusion:

****
<?php $snippet_filname = $_POST['snippet']; 
include ($snippet_filename); ?>
****

Getting the file to call the validator itself once generated is beyond
my meagre PHP skills but is probably do-able.

-- 
Michael
Linux: The OS people choose without $200,000,000 of persuasion.
Received on Friday, 23 March 2007 11:52:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:24 GMT