mDOMDocRef
mdom_load(const char* file_name, gboolean subst, mDOMEntityResolver entity_resolver)
{
- xmlSAXHandler sax;
xmlParserCtxtPtr ctxt;
mDOMDocRef doc;
xmlSubstituteEntitiesDefault(subst);
- sax = xmlDefaultSAXHandler;
- sax.getEntity = entity_resolver;
-
ctxt = xmlCreateFileParserCtxt(file_name);
if (ctxt == NULL) return NULL;
-
- ctxt->sax = &sax;
+ g_assert(ctxt->sax != NULL);
+ ctxt->sax->getEntity = entity_resolver;
xmlParseDocument(ctxt);
doc = ctxt->myDoc;
- ctxt->sax = NULL;
xmlFreeParserCtxt(ctxt);
return doc;