[Expat-discuss] A bug in expat? CharacterData callback
beni lerner
beni_ler@hotmail.com
Wed, 29 Nov 2000 11:05:10 +0200
Hi everybody,
I understood that when calling XML_parse I give the parser an xml buffer
which should be parsed, and the parser uses my callback
functions to give me the elements it found and the attributes and data of
the elements. If I understood right, the parser gives me pointers to the
same buffer I entered (that why they are const pointers).
But when it finds a NEWLINE character, it does this:
file: xmlparse.c
function: doContent
line: 1376
case XML_TOK_DATA_NEWLINE:
if (characterDataHandler)
{
XML_Char c = 0xA;
characterDataHandler(handlerArg, &c, 1);
}
else if (defaultHandler)
reportDefault(parser, enc, s, next);
break;
This means that it gives me a pointer to a local character c, which is
filled by 0xA. The memory of this character may be overridden by other
variables! Is this correct?
Please helllp me!!!
Thanks.
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com