// this re-assigns all handlers except for the UnknownEncodingHandler protected void ReAssignHandlers(XMLParser *parser) { LibExpat.XMLSetElementDeclHandler(parser, elementDeclHandler); LibExpat.XMLSetAttlistDeclHandler(parser, attlistDeclHandler); LibExpat.XMLSetXmlDeclHandler(parser, xmlDeclHandler); LibExpat.XMLSetElementHandler(parser, startElementHandler, endElementHandler); LibExpat.XMLSetCharacterDataHandler(parser, characterDataHandler); LibExpat.XMLSetProcessingInstructionHandler(parser, processingInstructionHandler); LibExpat.XMLSetCommentHandler(parser, commentHandler); LibExpat.XMLSetCdataSectionHandler(parser, startCdataSectionHandler, endCdataSectionHandler); if (skipInternal) { LibExpat.XMLSetDefaultHandler(parser, defaultHandler); } else { LibExpat.XMLSetDefaultHandlerExpand(parser, defaultHandler); } LibExpat.XMLSetDoctypeDeclHandler(parser, startDoctypeDeclHandler, endDoctypeDeclHandler); LibExpat.XMLSetEntityDeclHandler(parser, entityDeclHandler); LibExpat.XMLSetNotationDeclHandler(parser, notationDeclHandler); LibExpat.XMLSetNamespaceDeclHandler(parser, startNamespaceDeclHandler, endNamespaceDeclHandler); LibExpat.XMLSetNotStandaloneHandler(parser, notStandaloneHandler); LibExpat.XMLSetSkippedEntityHandler(parser, skippedEntityHandler); // this is a private handler that always needs to be set LibExpat.XMLSetExternalEntityRefHandler(parser, externalEntityRefHandler); }
private void ConfigureParentParser(XMLParser *xmlParser) { if (namespaces) { LibExpat.XMLSetReturnNSTriplet(xmlParser, 1); } LibExpat.XMLSetUserData(xmlParser, (IntPtr)parserHandle); // this is a private handler that always needs to be set LibExpat.XMLSetExternalEntityRefHandler(xmlParser, externalEntityRefHandler); }