Today 4.18

xiaoxiao2021-03-05  42

Today, I finally understand XML_SetCharacterDataHandler (p, char_hndl);

What is anything in voidchar_hndl (void * data, const char * txt, int txtlen): When the expat is processed, whenever you encounter a space, enter, '/ t' will call char_hndl (), and the TXT The string pointed to the pointer is no end tag '/ 0', TXT points to XML_PARSE (P, BUFF, LEN, DONE), and txtlen is used to illustrate the string length that calls char_hndl () at a time. Therefore, if you want to get the data in TXT correctly, you should pay attention to handle space, enter, '/ t', etc.

It is known from which the English level needs to be improved, because Clark Cooper is written at http://www.xml.com/pub/a/1999/09/expat/index.html?page=3#chardatahandler:

XML_SetCharacterDataHandler

XML_SetCharacterDataHandler (XML_Parser P,

XML_CharacterDataHandler Charhndl)

Typedef void

(* XML_CharacterDataHandler) (Void * UserData,

Const XML_CHAR * S,

INT LEN);

Set a text handler. The string your handler receives is NOT zero terminated. You have to use the length argument to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this .

It has been very clear.

Plan to write related functions of XML processing tomorrow.

转载请注明原文地址:https://www.9cbs.com/read-34582.html

New Post(0)