Abbey Workshop | ||||||||||
Ant provides a very convenient task for validating all the files in a directory or directory tree. You can use the xmlvalidate task to validate an XML file, or using a fileset, all the files in a directory or directory tree.
Here is an example build.xml file:
Download source for: build.xml
A few thoughts on the build file:
lenient is set to no so that the files will be validated. Setting the value to yes will only check the files for well formedness.classname and classpath are optional according to the documentation. However, I ran into some problems when these attributes were not set. See this how to.fileset allows you to validate all the files in a directory or a directory tree.xmlvalidate tag enable XML schema validation for the Xerces parser. Schema validation is not enabled by default.echo message on line 13 was added to display a message when things go well.
Copyright © Abbey Workshop 2006