Hello !

 

I would like to improve the code below

 

 

2 questions :

- java says to me that input.getParser() & input.getInputSource() are deprecated

what is necessary to use in the place ?

 

- to gain memory, are my files well closed?

 

-------

 

XSLTInputHandler input = new XSLTInputHandler(new File(xml),new File(xsl));

ByteArrayOutputStream out = new ByteArrayOutputStream();

Driver driver = new Driver();

driver.setLogger(loggerFop);

driver.setRenderer(Driver.RENDER_PDF);

driver.setOutputStream(out);

driver.render(input.getParser(),input.getInputSource());

byte[] content = out.toByteArray();

FileOutputStream fos = new FileOutputStream(pdf);

fos.write(content);

Reply via email to