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

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

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


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.

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

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:51 UTC