need to validate site before makes it live

Anderson Lizardo andersonlizardo at
Thu Oct 23 20:36:47 PDT 2003

Gerard Beekmans wrote:
> Can't we include some validation test that runs
> before it makes the site live? As shown with my stumbling today it
> was some elusive thing that took me a while to figure out.
> Since we use xhtml how about using a program like xmllint (no idea if
> it'l work though)

Yes, it works. I know two commands that we can use:

xmllint --valid --noout file.html
onsgmls -sc /usr/share/sgml/OpenSP-1.5/xml.soc file.html

Both do the same thing. One advantage of the last one is that, if you 
have a well-configured Docbook installation (I don't know the details, 
but you can "force" OpenSP to use local DTDs instead of on-line ones), 
it will not download the XHTML DTD from W3C, but use the local DTD. 
xmllint will download the DTD for every file you check. To check all 
files, I suggest something like this:

find $HTMLDIR -name "*.html" -exec \
onsgmls -sc /usr/share/sgml/OpenSP-1.5/xml.soc '{}' ';'

If a syntax error is found, It will be printed and fcron will catch it.

Anderson Lizardo

More information about the website mailing list