Ensure xmlInitParser is called once, before anything else happens.

This commit is contained in:
jez_higgins 2005-10-03 08:48:19 +00:00
parent d7e2d7fb33
commit 5c455f543f

View file

@ -141,6 +141,11 @@ xmlParserInputPtr lwit_resolveEntity(void* user_data, const xmlChar* publicId, c
return p->SAXresolveEntity(publicId, systemId);
} // lwit_resolveEntity
class libxmlInitialiser
{
public:
libxmlInitialiser() { xmlInitParser(); }
};
static xmlSAXHandler saxHandler = {
0, // internalSubsetSAXFunc internalSubset;
@ -178,7 +183,11 @@ static xmlSAXHandler saxHandler = {
0 // serror;
};
xmlSAXHandler* lwit_SaxHandler() { return &saxHandler; }
xmlSAXHandler* lwit_SaxHandler()
{
static libxmlInitialiser init;
return &saxHandler;
}
void lwit_setFeature(xmlParserCtxtPtr context, const char* name, bool value)
{