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

Re: Feature request: validation by snippet

From: Jirka Kosek <jirka@kosek.cz>
Date: Thu, 22 Mar 2007 11:54:20 +0100
Message-ID: <4602605C.7010803@kosek.cz>
To: Stephanie Troeth <steph@unadorned.org>
CC: www-validator@w3.org
Stephanie Troeth wrote:

> Working with some folks familiar with CMS issues, the point was raised
> that it would make it easier on developers to continually check if they
> are creating valid markup if validators allow validation by snippet
> rather than a full document. As a developer myself, I know my own team
> and I would find this very useful.

Maybe I'm living on a different planet, but why they do not use
validating editor? I can hardly imagine pasting text back and forth
between web-form of validator and editor or other web-form in CMS.

> Perhaps what is required for validation of snippets, is to automatically
> wrap the contents of the input with a Doctype (that the user chooses),
> dummy head content, <html> and <body> wrapper tags for this option?

It should be sufficent to add !DOCTYPE for root element of your snippet
as DTD can't specify which element is allowed as the only root element
(which is another big problem of DTDs). For example, the following
snippet should be validated without problems:

<!DOCTYPE div PUBLIC "-//W3C//DTD HTML 4.01//EN">

  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
 OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
 Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html

Received on Thursday, 22 March 2007 17:41:37 UTC

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