Re: Parsing CDATA section
"Ramprasad B" <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <[email protected]> |
On 5/26/07, Marco Forberg <[email protected]> wrote: Expat treats CDATA as any other text BUT calls the cdata start and end > handlers before and after it passes your text to the text handler. So the > the order of the calls would be the following: > > CDATA section start handler > Text handler <-- this is your CDATA > CDATA section end handler Here's my code: static void XMLCALL startcData(void *userData){ int *depthPtr = (int *)userData; /*I am unable to get cdata here. userData contains a single byte here*/ } static void XMLCALL endcData(void *userData){ ; } int main(){ XML_SetCdataSectionHandler(parser, startcData, endcData); } XML file: <A> <B> <C><![CDATA[Hello World]]></C> </B> </A> I see that when the CDATA section starts, the startcData fucntion is called. It's still not working ! BTW, which ptr points to CDATA section when the startcData is called ? Thanks ! - Ramprasad B