Current version: 0.1
- Movable Type. I have only tested with version 2.51, although others may work.
- The Perl modules and OpenSP programs required by the W3C source code.
- A collection of DTDs and other files to validate against (from the W3C).
validatordirectory to your Movable Type
plugins/validator/config/validator.configto reflect your setup.
This plugin provides the
MTValidate container tag.
The contents of this tag should be a complete HTML, XHTML, SGML or XML
document, which will be replaced with the results of the validation.
There are also several attributes you can provide. Set their value to
“1” to enable, “0” to disable:
Verbose output (on by default): If this is disabled, the other options will be ignored.
Displays the HTML source of the document you validated and links error messages directly to lines in this output. Makes it easy to see what’s wrong. The source is always shown if there is an error.
Will generate an outline of your document from the H1 - H6 elements. For a properly formed document, this will be a nicely nested tree structure. The visualization of your document’s structure makes it easier to see where you’ve skipped a heading.
Shows you exactly how the SGML Parser read your document. Probably best used only by advanced users as it deals with low-level SGML constructs.
Suppress attributes from the parse tree to make it more readable.
The character set of the document to be validated. For example, utf-8 or iso-8859-1. If not specified, the validator will try to guess based on the HTML
METAelement or XML declaration.
The document type to apply to the document. Normally, this is extracted from the
DOCTYPEdeclaration in the document itself, but you can override it using this attribute. For example,
XHTML 1.0 Transitional
Here is an example that validates the title and body of an entry, based on the default templates from Movable Type 2.51:
<MTValidate> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title><$MTBlogName$>: <$MTEntryTitle$></title> </head> <body> <h3 class="title"><$MTEntryTitle$></h3> <$MTEntryBody$> <a name="more"></a> <$MTEntryMore$> </body> </html> </MTValidate>
For information on using Movable Type template tags like
MTValidate in entry previews, see the documentation for
Customizing the Validation Output
The text that appears in the output of the
tag is controlled by the templates in the
plugins/validator/templates directory. Edit these to
change the validation output.
- Initial release