More Software posts
March 22, 2005
ant, xmlvalidate and foreach
As part of the build process I've been trying to validate some xml files against an xml schema using the xmlvalidate ant task. The problem is that the xmlvalidate task won't validate more than one file at a time, as bug 32791 shows. Unfortunately ant doesn't provide any built in looping constructs so I downloaded the ant-contrib project from sourceforge and was able to use the foreach task it provides with no problems.
<foreach target="validateOneFile" param="file_to_validate"
inheritall="true">
<path>
<fileset dir="${standard.xml.dir}/gui/forms/">
<include name="*.xml"/>
</fileset>
</path>
</foreach>
Posted by Alex at March 22, 2005 08:33 AMComments
Post a comment