void RS_XML(initParser)(XML_Parser parser, RS_XMLParserData *parserData) { XML_SetUserData(parser, parserData); XML_SetElementHandler(parser, RS_XML(startElement), RS_XML(endElement)); XML_SetCommentHandler(parser, RS_XML(commentHandler)); XML_SetExternalEntityRefHandler(parser, RS_XML(externalEntityHandler)); XML_SetUnparsedEntityDeclHandler(parser, RS_XML(entityDeclarationHandler)); XML_SetCharacterDataHandler(parser, RS_XML(textHandler)); XML_SetProcessingInstructionHandler(parser, RS_XML(processingInstructionHandler)); XML_SetCdataSectionHandler(parser, RS_XML(startCdataSectionHandler), RS_XML(endCdataSectionHandler)); XML_SetBase(parser, parserData->fileName); XML_SetNotStandaloneHandler(parser, RS_XML(notStandAloneHandler)); }
static int lxp_make_parser (lua_State *L) { XML_Parser p; int bufferCharData = (lua_type(L, 3) != LUA_TBOOLEAN) || (lua_toboolean(L, 3) != 0); char sep = *luaL_optstring(L, 2, ""); lxp_userdata *xpu = createlxp(L); xpu->bufferCharData = bufferCharData; p = xpu->parser = (sep == '\0') ? XML_ParserCreate(NULL) : XML_ParserCreateNS(NULL, sep); if (!p) luaL_error(L, "XML_ParserCreate failed"); luaL_checktype(L, 1, LUA_TTABLE); checkcallbacks(L); lua_pushvalue(L, 1); xpu->tableref = luaL_ref(L, LUA_REGISTRYINDEX); XML_SetUserData(p, xpu); if (hasfield(L, StartCdataKey) || hasfield(L, EndCdataKey)) XML_SetCdataSectionHandler(p, f_StartCdata, f_EndCdataKey); if (hasfield(L, CharDataKey)) XML_SetCharacterDataHandler(p, f_CharData); if (hasfield(L, CommentKey)) XML_SetCommentHandler(p, f_Comment); if (hasfield(L, DefaultKey)) XML_SetDefaultHandler(p, f_Default); if (hasfield(L, DefaultExpandKey)) XML_SetDefaultHandlerExpand(p, f_DefaultExpand); if (hasfield(L, StartElementKey) || hasfield(L, EndElementKey)) XML_SetElementHandler(p, f_StartElement, f_EndElement); if (hasfield(L, ExternalEntityKey)) XML_SetExternalEntityRefHandler(p, f_ExternaEntity); if (hasfield(L, StartNamespaceDeclKey) || hasfield(L, EndNamespaceDeclKey)) XML_SetNamespaceDeclHandler(p, f_StartNamespaceDecl, f_EndNamespaceDecl); if (hasfield(L, NotationDeclKey)) XML_SetNotationDeclHandler(p, f_NotationDecl); if (hasfield(L, NotStandaloneKey)) XML_SetNotStandaloneHandler(p, f_NotStandalone); if (hasfield(L, ProcessingInstructionKey)) XML_SetProcessingInstructionHandler(p, f_ProcessingInstruction); if (hasfield(L, UnparsedEntityDeclKey)) XML_SetUnparsedEntityDeclHandler(p, f_UnparsedEntityDecl); if (hasfield(L, StartDoctypeDeclKey)) XML_SetStartDoctypeDeclHandler(p, f_StartDoctypeDecl); if (hasfield(L, XmlDeclKey)) XML_SetXmlDeclHandler(p, f_XmlDecl); return 1; }
void _Expat_XML_SetNotStandaloneHandler(struct ExpatIFace * Self, XML_Parser parser, XML_NotStandaloneHandler handler) { XML_SetNotStandaloneHandler(parser, handler); }
void bmx_expat_XML_SetNotStandaloneHandler(XML_Parser parser) { XML_SetNotStandaloneHandler(parser, bmx_expat_NotStandaloneHandler); }