@Override
protected XmlStreamWriter createXmlStreamWriter(Writer out) {
return super.createFormattingXmlStreamWriter(out);
}
};
MarkupParser parser = new MarkupParser();
parser.setDialect(new TextileDialect());
parser.setBuilder(builder);
builder.setBookTitle(bookTitle==null?name:bookTitle);
if (doctype != null) {
builder.setDoctype(doctype);
}
parser.parse(textile);
} finally {
try {
writer.close();
} catch (Exception e) {
throw new BuildException(String.format("Cannot write to file '%s': %s",docbookOutputFile,e.getMessage()),e);