navinseshadri / iksemel

Automatically exported from code.google.com/p/iksemel
GNU Lesser General Public License v2.1
0 stars 0 forks source link

CDATA improperly parsed #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a document with the following data

   <data><![CDATA[[TEST]]]></data>

What is the expected output? What do you see instead?

Expected is that Character data of the data node is "[TEST]"

The datahook returns "[TEST" instead. 

What version of the product are you using? On what operating system?

N/A

Please provide any additional information below.

This should fix the problem:

            case C_SECT_CDATA_E2:
                if ('>' == c) {
                    old = pos + 1;
                    prs->context = C_CDATA;
                } else {
                    old = pos;
                    if (']' == c)
                    {
                        prs->context = C_SECT_CDATA_E2;
                        if (prs->cdataHook) {
                            err = (ikserror)prs->cdataHook (prs->user_data, "]", 1);
                            if (IKS_OK != err) return err;
                        }

                    }
                    else
                    {
                        prs->context = C_SECT_CDATA_C;
                        if (prs->cdataHook) {
                            err = (ikserror)prs->cdataHook (prs->user_data, "]]", 2);
                            if (IKS_OK != err) return err;
                        }
                    }
                }
                break;

Original issue reported on code.google.com by oscarvdb...@gmail.com on 23 Mar 2010 at 4:27

GoogleCodeExporter commented 9 years ago
Thanks for the fix. I've applied your patch to the trunk.

Original comment by meduke...@gmail.com on 7 Oct 2011 at 9:27

GoogleCodeExporter commented 9 years ago
yw

Original comment by oscarvdb...@gmail.com on 7 Oct 2011 at 9:47