phax / ph-commons

Java 11 Library with tons of utility classes required in all projects
Apache License 2.0
30 stars 18 forks source link

Invoice XML Format generate only a line #7

Closed miika3l closed 7 years ago

miika3l commented 7 years ago

Hi Philip, invoices generated with the JAXBWriterBuilder class are not formatted (the XML data isn't formatted with linefeeds and indentation). I think the property Marshaller.JAXB_FORMATTED_OUTPUT is not set up.

final ESuccess eSuccess = UBL20Writer.invoice ().write (aInvoice, new File ("target/dummy-invoice.xml"));

Updated: Sorry, it was my mistake. For fix, is necessary use line below:

final ESuccess eSuccess = UBL20Writer.invoice().setFormattedOutput(true).write(aInvoice, new File("target/dummy-invoice-with-ext.xml"));

regards!

phax commented 7 years ago

Exactly - Glad you solved it :)