Operating System: All
If configuration file contains parameters with entities (e.g. %lt, the XML
serialization does not escape such characters resulting in invalid output.
Did you mean < instead of %lt;? If so, it would be a character entity. Would it be possible for you to
attach a config file showing the problem?
Yeah, the entity <. It is correcly decoded (thanks to jaxb) but when
serialized to XM it is not encoded back to <. It is very easy to reproduce:
simply add a param <param name="test" value="<" /> in any valid configuration
file and look the XML report.
BTW, the issue is the same for every element in the config file. The fact that
it is actually parsed with a real XML parser but serialized printing strings to
a file is very likely to lead to corruption of the output.
Morover, this is a slightly different issue, but having parameter names
serialized as element names may also leads to invalid XML (since parameters
names are not explicitely restricted to NMTOKEN).
Sure, this makes sense. I believe someone else reported this before. It is kind of a global change, so I
don't think I'll be able to get to it anytime soon. Hopefully, you can work around it.
This is not that much complicated to throw in a ContentHandler instead of a
StringBuffer (done this millions of times), and that could be backward
compatible (keeping the old method). If i have some time, i might give it a shot.
For the parameter name as element name, this is not big deal, it should simply
be checked by the schema.