JTidy ant task.
Parameters
Attribute |
Description |
Required |
srcfile |
source file |
Yes, unless a nested <fileset> element is used. |
destfile |
destination file for output |
With the srcfile attribute, either destfile or destdir
can be used. With nested <fileset> elements only destdir is allowed. |
destdir |
destination directory for output |
properties |
Path to a valid tidy properties file |
No |
flatten |
Ignore the directory structure of the source files, and copy all files into the directory specified by the
destdir attribute. |
No; defaults to false. |
failonerror |
boolean to control whether failure to execute should throw a BuildException or just print an error. If set to
true errors in input files which tidy is enable to fix will cause a failure. |
No; defaults to false. |
Nested elements
- Fileset : if you need to run tidy on more than one file, you can specify nested filesets.
- Parameter : you can specify any tidy configuration option directly using a nested
parameter element.
Setup
Adds the following typedef to setup the JTidy task in your build.xml:
<taskdef name="tidy" classname="org.w3c.tidy.ant.JTidyTask"/>
This will work if JTidy jar is copied to ant lib directory. If you need to reference the jar elsewhere on the
filesystem you can add a nested classpath element:
<taskdef name="tidy" classname="org.w3c.tidy.ant.JTidyTask">
<classpath>
<pathelement location="${lib.dir}/jtidy.jar"/>
</classpath>
</taskdef>
Examples
<tidy destdir="out" properties="/path/to/tidy.properties">
<fileset dir="inputdir" />
<parameter name="drop-font-tags" value="true" />
</tidy>
author: Fabrizio Giustina version: $Revision: 1.8 $ ($Author: fgiust $) |