Re: Feature request: validation by snippet

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">
<div>
  Foo
</div>


-- 
------------------------------------------------------------------
  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