Re: Site validation

Martin Salo wrote:


What do you think about an idea to develop a validator that validates
whole sites, not only pages. It could search for links in pages and when
a link is in the same domain (a subsection of the page) it validates it.
It should be limited (to about 200 pages or so) to avoid abuse.



Sounds reasonable, although for my websites I like to use offline tools:
(a) so they run quickly (b) so the don't clog up my webserver and (c) so
they don't clutter the access logs.

I do validation using Ant (ant.apache.org), with the Apache commons
resolver added.  The Ant buildfile looks something like this:


<><?xml version="1.0"?></>
<><project name="Website Validation" default="xhtml.validate"
basedir="."></><>  

  <xmlcatalog id="commonDTDs"></>
<></>
<>    <catalogpath></>
<></>      <pathelement path="xmlcatalog.xml"/>
    </catalogpath>
  </xmlcatalog>


  <target name="xhtml.validate" description="=== Validates all XHTML
files against their DTD ===">
      <xmlvalidate failonerror="no" warn="yes">
        <xmlcatalog refid="commonDTDs"/>
        <fileset dir="htdocs" includes="**/*.html"/>
        <attribute name=" http://xml.org/sax/features/validation
<http://xml.org/sax/features/validation> " value="true"/>
      </xmlvalidate>
  </target>


</project>

Rick :-)


You might prefer failonerror="yes".
There is an additional catalog file as follows (edit the local URIs to
point to the right place on your disk where you have local copies of the
W3C DTDs) :



<?xml version="1.0"?>
<!DOCTYPE catalog  PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog
V1.0//EN"
     "
http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd
<http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd> ">


<catalog xmlns="urn:oasis:names:tc:entity:xmlns: xml:catalog
<xml:catalog> " prefer="public">


  <public
     publicId="-//W3C//DTD XHTML 1.0 Strict//EN"
     uri="../whr-root/htdocs/dtd/w3c/xhtml1/xhtml1-strict.dtd"/>
  <public
     publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
     uri="../whr-root/htdocs/dtd/w3c/xhtml1/xhtml1-transitional.dtd"/>
  <public
     publicId="-//W3C//DTD XHTML 1.1//EN"
     uri="../whr-root/htdocs/dtd/w3c/xhtml11/xhtml11-flat.dtd"/>
  <public
     publicId="-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
     uri="../whr-root/htdocs/dtd/w3c/xhtml11/xhtml11-model-1.mod"/>


</catalog>



-- 

Visit our website at www.roke.co.uk

Registered Office: Roke Manor Research Ltd, Siemens House, Oldbury, Bracknell,
Berkshire. RG12 8FZ

The information contained in this e-mail and any attachments is confidential to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.

Received on Tuesday, 20 April 2004 12:06:33 UTC