[fpc-devel] xmlwrite rejects valid CDATA xml (regression in 2.6.2)

Seth Grover sethdgrover at gmail.com
Mon Apr 15 21:18:22 CEST 2013


Given this XML file:

=============================
<?xml version="1.0"?>
<item>
    <description>
        <![CDATA[This is a description for a test [...] and will fail]]>
    </description>
</item>
=============================

WriteXMLFile in xmlwrite.pp throws an "Illegal character" exception on the
"]" character in CDSectSpecialCharCallback. However, this behavior is
incorrect. Only "]]>" marks the end of a CDATA section, any other
characters, including square brackets, should be allowed.

This seems to be a regression in 2.6.2, as it works in 2.6.0.

I did find http://mantis.freepascal.org/view.php?id=20780 and
http://svn.freepascal.org/cgi-bin/viewvc.cgi?revision=19792&view=revisionwhich
seem to be what introduced this bug.

I'll log a bug for it in Mantis, but I thought I'd also bring it up in this
to see if there should be any discussion about it.

Thanks guys, have a good one.

-SG

--
Seth Grover

ΜΟΛΩΝ ΛΑΒΕ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20130415/d00e15a9/attachment.html>


More information about the fpc-devel mailing list