[Expat-discuss] Parsing CDATA section
Bob Lee
crazybob at crazybob.org
Sun May 27 17:16:06 CEST 2007
CdataSectionHandler just tells you when the section starts and ends. I
assume you need to use CharacterDataHandler to get the actual text.
Bob
On 5/27/07, Ramprasad B <ramprasad.i82 at gmail.com> wrote:
>
> 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
More information about the Expat-discuss
mailing list