On Tue, 30 Oct 2012, Giovanni Di Milia wrote:
> I repeat that I don't know why all the XML special characters are not
> escaped, but even this solution looks semantically wrong to me
Yes, it would not be the right solution in my eyes either.
It is my understanding that only `&' and `<' must be escaped in XML, so
encode_for_xml() does a priori good job... with the notable exception of
CDATA, where this escaping should not be done, and where one has to
beware of `]]>' and friends.
We did not really have any use cases for CDATA in our records so far,
which is why the escaping/unescaping behaviour for CDATA sections does
not work very well...
The proper CDATA fix for encode_for_xml() and friends would be to do the
above two-character escaping only when these characters are not
occurring within the CDATA section context. (plus beware of `]]>').
I think this should do.
Do you need CDATA support? Shall I ticketise this task? Will you take
care of solving the ticket?
Note that if you do need CDATA support in your installation, then we
should also update one of the Atlantis test records, so that we are sure
that CDATA support will remain solid in the future as well.
P.S. BTW, see also thread ``encode_for_xml and CDATA'' from April 2010.
(started by Benoit)
Best regards
--
Tibor Simko