How should I parse strings in strings that I want to sort by XML?
I'm having difficulty using Java and JAXB to process strings in XML files that have line breaks. Data is retrieved from the database with the actual line feed characters.
Foo <LF> bar
Or an additional example:
Foo\r\n\r\nBar
Productivity:
Foo
 
 Bar
If I just bind this data in XML, I get the literal characters of the string in the output. This is obviously against XML standards, where characters must be encoded to 
 . Those. in the XML output file I should see:
Foo 
bar
But if I try to do it manually, I get my ampersand and get the encoding!
Foo &#xD;bar
This is pretty ironic, because the process, which apparently should first encode line breaks, and not, is an attempt at my attempts to encode it manually.
source share