I have this Enum defined: I have a model object that has a OutputFormatEnum variable called OutputFormat. When I set this variable to OutputFormatEnum.PDF, it is initially registered as “pdf” which is what it should be. When I then execute the following code: It sets the value of OutputFormat in streamTemplate to “PDF”, where it should be “pdf” (the value
Tag: xml-serialization
Java XML serialization error: Invalid UTF-16 Surrogate detected
I have an org.w3c.dom.Document and want to serialize it with this function, but I get an SAXException. How could I fix this? This results in the following error: Answer The Document contained invalid Unicode characters like http://www.fileformat.info/info/unicode/char/d835/index.htm I fixed it with the solution from removing invalid XML characters from a string in java