So, something has come up with work on XML generation. So previously we were pretty much just using a Groovy script to string concat hand assemble XML (before my time!), but I'm changing it to using a JAXB @ResponseBody, so turns it nicely into XML, minimal/no whitespace, etc, etc.
Except, my co-worker is worried because we were using CDATA around everything, and so are other folks we query. I've put invalid XML entities into the contents (double quotes, less-than, ampersand, etc) and in the raw XML output I see those as &; entities. So it seems fine. His concern is just he recalls sometime in the last couple of years he made that change because one of the folks querying us said there was a problem because it didn't have a CDATA around it and was breaking their parser.
Personally I think it was because it had XML characters in it which broke it, and he's mis-remembering that even simple, correct text string would break it.
If I were to, https://stackoverflow.com/a/6822815/570291 shows how to easily do it with a simple XmlAdapter, which is what I'd do.
Except, my co-worker is worried because we were using CDATA around everything, and so are other folks we query. I've put invalid XML entities into the contents (double quotes, less-than, ampersand, etc) and in the raw XML output I see those as &; entities. So it seems fine. His concern is just he recalls sometime in the last couple of years he made that change because one of the folks querying us said there was a problem because it didn't have a CDATA around it and was breaking their parser.
Personally I think it was because it had XML characters in it which broke it, and he's mis-remembering that even simple, correct text string would break it.
If I were to, https://stackoverflow.com/a/6822815/570291 shows how to easily do it with a simple XmlAdapter, which is what I'd do.