[Expat-bugs] [ expat-Bugs-1786964 ] 2.0.1: Documentation of the Userdata void * is wrong.

SourceForge.net noreply at sourceforge.net
Mon Sep 3 16:10:52 CEST 2007


Bugs item #1786964, was opened at 2007-09-03 05:09
Message generated for change (Comment added) made by kwaclaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1786964&group_id=10127

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: 2.0.1: Documentation of the Userdata void * is wrong.

Initial Comment:
In the documentation it says that the userdata void* in the handler functions are set with XML_SetUserData.

This is not correct...

The userdata is set correctly, but the void * in the handler functions are in fact the XML_Parser, which can then be used to get the userdata (using XML_GetUserData).

I strongly suggest that the documentation is corrected to fit this behaviour, and that the declaration of the handler functions are changed from

typedef void
(XMLCALL *XML_StartElementHandler)(void *userData,
                                   const XML_Char *name,
                                   const XML_Char **atts);

to

typedef void
(XMLCALL *XML_StartElementHandler)(XML_Parser parser,
                                   const XML_Char *name,
                                   const XML_Char **atts);

and likewise for the rest of the handler functions...

// Bent Bisballe Nyeng (deva HOS aasimon PRIK org)

----------------------------------------------------------------------

>Comment By: Karl Waclawek (kwaclaw)
Date: 2007-09-03 10:10

Message:
Logged In: YES 
user_id=290026
Originator: NO

The userData in the handlers are only set to the parser if you call
XML_UseParserAsHandlerArg(). The only handler which is different is the
externalEntityRefHandler which by default passes the parser.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1786964&group_id=10127


More information about the Expat-bugs mailing list