forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steven Noels <stev...@outerthought.org>
Subject wholesale document validation
Date Thu, 13 Jun 2002 07:45:59 GMT
Since the actual situation is that there exists no XML validation
facility in Forrest (the Ant validation task doesn't support entity
catalogs yet, and Cocoon validation has been non-functional since ages),
I went shopping for some easy to use validation tool. Finding a
light-weight catalog-enabled validating XML parser hasn't been easy, but
I think libxml2 fits the bill nicely, especially it's commandline
xmllint utility. It supports entity catalogs OOTB, so validating a full
directory of XML docs is as easy as:

========================================================================
stevenn@ELISABETH ~/projects/xml-forrest/src/documentation/content/xdocs
$ export 
SGML_CATALOG_FILES=~/projects/xml-forrest/src/resources/schema/catalog

stevenn@ELISABETH ~/projects/xml-forrest/src/documentation/content/xdocs
$ xmllint --valid --catalogs --noout *.xml


index.xml:39: validity error: No declaration for attribute align on
element p
     <p align="right"><fork href="http://xml.apache.org/cocoon"><img
src="skin/i
                     ^
index.xml:39: validity error: No declaration for attribute border on
element img
"><img src="skin/images/built-with-cocoon.gif" border="0" width="88"
height="31

       ^
index.xml:39: validity error: Element img doesn't carry attribute alt
<img src="skin/images/built-with-cocoon.gif" border="0" width="88"
height="31"/

       ^
index.xml:39: validity error: No declaration for attribute border on
element img
mg src="skin/images/centipede-logo-small.gif" border="0" width="138"
height="31

       ^
index.xml:39: validity error: Element img doesn't carry attribute alt
  src="skin/images/centipede-logo-small.gif" border="0" width="138"
height="31"/

       ^
tabs.xml:7: validity error: Not valid: root and DtD name do not match
'tabs' and 'book'
     xmlns:xlink="http://www.w3.org/1999/xlink">
========================================================================

which brings me to my next point: we *should* validate prior to 
committing ;-)

libxml2 should be readily available for linux users (it's part of gnome, 
really), and there exist cygwin packages and windows binaries, too

links:
  * http://xmlsoft.org/
  * http://www.fh-frankfurt.de/~igor/projects/libxml/
  * http://www.cygwin.com/ml/cygwin-announce/2002/msg00017.html

</Steven>


Mime
View raw message