XMLStreamWriter does not convert "\n" to "
" when writing attributes

1k Views Asked by At

I am trying to write an XML file using XMLStreamWriter. The problem is that I have an attribute value with "\r\n".

Since I am using an XML writer, I was expecting the writer to escape "\n" to 
 and "\r" to 
, but that does not happen. That causes the resulting file to have the attribute value splitted in multiple lines, and my application (based on EMF) ignores the new lines.

What I would like to do is to write the attribute's value with 
 and 
. How can I do that?

0

There are 0 best solutions below