// create filters
out = new FileOutputStream(outfile);
XMLDocumentFilter[] filters = { new Writer(out) };
// create parser
XMLParserConfiguration parser = new HTMLConfiguration();
// parser settings
parser.setProperty("http://cyberneko.org/html/properties/filters", filters);
String infilename = infile.toString();
File insettings = new File(infilename+".settings");
if (insettings.exists()) {
BufferedReader settings = new BufferedReader(new FileReader(insettings));
String settingline;
while ((settingline = settings.readLine()) != null) {
StringTokenizer tokenizer = new StringTokenizer(settingline);
String type = tokenizer.nextToken();
String id = tokenizer.nextToken();
String value = tokenizer.nextToken();
if (type.equals("feature")) {
parser.setFeature(id, value.equals("true"));
}
else {
parser.setProperty(id, value);
}
}
settings.close();
}
// parse
parser.parse(new XMLInputSource(null, infilename, null));
}
catch (Exception e) {
log(" error parsing input file, "+infile);
throw new BuildException(e);
}