// 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); }
/// <summary>Handler for unhandled events.</summary> /// <remarks>Will optionally skip internal entities.</remarks> public void SetDefaultHandler(XMLDefaultHandler value, bool skipInternal) { CheckNotDisposed(); defaultHandler = value; this.skipInternal = skipInternal; if (skipInternal) { LibExpat.XMLSetDefaultHandler(entityContext.XmlParser, value); } else { LibExpat.XMLSetDefaultHandlerExpand(entityContext.XmlParser, value); } }