When I marshal Java objects into XML, some extra characters are added after the closing of the root tag.
Here is how I save the resulting java objects after unmarshaling from XML into a file:
The extra characters are padded after closing tag of the root tag.Code:public void saveStifBinConv(ConversionSet cs, String xmlfilename) { FileOutputStream os = null; try { os = new FileOutputStream(xmlfilename); this.marshaller.marshal(cs, new StreamResult(os)); } catch (IOException e) { log.fatal("IOException when marshalling STIF Bin Conversion XML file"); throw new WmrFatalException(e); } finally { if (os != null) { try { os.close(); } catch (IOException e) { log.fatal("IOException when closing FileOutputStream"); throw new WmrFatalException(e); } } } }
The characters added are some of the characters from the XML. Example:I use Spring OXM's `Jaxb2Marshaller` and JAXB 2.Code:tractor-to-type><bin-code>239</bin-code><allowed>YES</allowed></extractor-to></extractor-mapping><extractor-mapping><e
Thanks![]()


Reply With Quote
