Retain the `
` during xml marshalling

rekha3dhe

New Member
I am generating the xml by marshalling the xsd and I have xsl-fo to generate the pdf. I have a description field which has to be broken down to new lines.Something similar to what is in this thread Inserting a line break in a PDF generated from XSL FO using <xsl:value-of>This is my code to marshall \[code\]JAXBContext context = JAXBContext.newInstance(List.class); Marshaller m = context.createMarshaller(); m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); m.setProperty("com.sun.xml.bind.xmlDeclaration", Boolean.FALSE); m.marshal(OrderList, stream); StringWriter sw = new StringWriter(); m.marshal(OrderList, sw); String val = sw.toString(); System.out.println(val);\[/code\]When I marshall, generated xml doesn't retain \[code\]
\[/code\] instead it adds \[code\]&#xA;\[/code\] and the result is something like this\[code\]<description>REPAIR CAB DOOR&#xA;REPAIR &#xA;</description>\[/code\]. If I don't have \[code\]&#xA\[/code\] in the xml I can't create a line break in my pdf.
 
Back
Top