use of biblemulticonverter.schema.zefdic1.Dictionary in project BibleMultiConverter by schierlm.
the class ZefDicMyBible method doExport.
@Override
public void doExport(Bible bible, String... exportArgs) throws Exception {
File file = new File(exportArgs[0]);
String[] idfields = (exportArgs.length > 1 ? exportArgs[1] : "long,short").split(",");
Dictionary xmlbible = createXMLBible(bible, idfields);
final Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
JAXBContext ctx = JAXBContext.newInstance(ObjectFactory.class);
Marshaller m = ctx.createMarshaller();
m.marshal(xmlbible, doc);
doc.normalize();
maskWhitespaceNodes(doc.getDocumentElement());
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
transformer.transform(new DOMSource(doc), new StreamResult(file));
}
Aggregations