simplexml icon indicating copy to clipboard operation
simplexml copied to clipboard

Percent (%) character is not escaped

Open romikk opened this issue 9 years ago • 1 comments

In some xml parsers percentage sign is a reserved character, e.g.: https://technet.microsoft.com/en-us/library/ms145315(v=sql.90).aspx

However Simple XML does not escape it when serializing text fields and currently there is no way to control escaping of characters. If I add a custom StringConverter that would replace % with &****#37; that would only result in **&**amp;#37; , i.e. it will be escaped again. Unfortunately all of the escaping is hardcoded in org.simpleframework.xml.stream.Formatter and there is no way to change it.

romikk avatar Dec 03 '15 11:12 romikk

Thanks, ill make sure to fix it. I've been meaning to do a new release for a while now, just need to get round to it.

ngallagher avatar Dec 05 '15 11:12 ngallagher