You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Steven Noels <st...@outerthought.org> on 2002/06/13 09:45:59 UTC

wholesale document validation

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>


Re: wholesale document validation

Posted by Steven Noels <st...@outerthought.org>.
Stefan Bodewig wrote:

> I guess what you need (and what is missing for now) is support for
> external catalogs.

exactly

> And of course, Craeg knows far better than me - patch by next week
> will certainly be too late for Ant 1.5 BTW.

oh well, I guess we wouldn't be afraid of using a cvs version instead of 
  a release ;-)

anyway - validation is still badly needed

thanks,

</Steven>


Re: wholesale document validation

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 13 Jun 2002, Steven Noels <st...@outerthought.org> wrote:

> I thought this was only some basic pre-refactoring,

I'm not directly involved with this code, but the nested <xmlcatalog>
elements of <xmlvalidate> will be registered as EntityResolvers and it
will look up the entity in what you've specified as nested elements.

I guess what you need (and what is missing for now) is support for
external catalogs.

And of course, Craeg knows far better than me - patch by next week
will certainly be too late for Ant 1.5 BTW.

Stefan


Re: wholesale document validation

Posted by Steven Noels <st...@outerthought.org>.
Stefan Bodewig wrote:

> The one in Ant 1.5beta does (at least it should), I'd love to hear
> about any problems you encounter.


Stefan, I thought this was only some basic pre-refactoring, cfr: 
http://marc.theaimsgroup.com/?l=forrest-dev&m=102311181129503&w=2, but 
not the full thing yet?

</Steven>


Re: wholesale document validation

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 13 Jun 2002, Steven Noels <st...@outerthought.org> wrote:

> (the Ant validation task doesn't support entity catalogs yet, and
> Cocoon validation has been non-functional since ages)

The one in Ant 1.5beta does (at least it should), I'd love to hear
about any problems you encounter.

Stefan

Re: wholesale document validation

Posted by David Crossley <cr...@indexgeo.com.au>.
Steven Noels wrote:
> 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:
<snip/>

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

Yes, all developers should validate their xdocs. It will be nice
when we have something built in to Forrest/Cocoon as well as via
Ant. However, it is still good to be able to validate with
external tools too.

Thanks for the pointer to xmllint. I have been using a reliable
validating parser for ages .. onsgmls from the OpenSP which
is also readily available on Linux systems.
http://openjade.sourceforge.net/
--David