From a94dee4c0d11287a0517ed0278f716b10c58d60a Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Wed, 18 Dec 2024 22:44:05 +0100 Subject: [PATCH] try to resolve internal and external subset with functions --- Source/Additions/GSXML.m | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 67d9f597f..774932163 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -2966,7 +2966,11 @@ hasInternalSubsetFunction(void *ctx) has = [HANDLER hasInternalSubset]; if (has < 0) { - has = TREEFUN(hasInternalSubset, (ctx)); +#if LIBXML_VERSION >= 20900 + has = xmlSAX2HasInternalSubset (ctx); +#else + has = xmlInternalSubset (ctxt); +#endif } return has; } @@ -2980,7 +2984,11 @@ hasExternalSubsetFunction(void *ctx) has = [HANDLER hasExternalSubset]; if (has < 0) { - has = TREEFUN(hasExternalSubset, (ctx)); +#if LIBXML_VERSION >= 20900 + has = xmlSAX2HasExternalSubset (ctx); +#else + has = xmlExternalSubset (ctx); +#endif } return has; } @@ -3694,6 +3702,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...) LIB->isStandalone = (void*) isStandaloneFunction; LIB->hasInternalSubset = (void*) hasInternalSubsetFunction; LIB->hasExternalSubset = (void*) hasExternalSubsetFunction; + LIB->resolveEntity = (void*) resolveEntityFunction; LIB->getEntity = (void*) getEntityIgnoreExternal; LIB->entityDecl = (void*) entityDeclFunction; LIB->notationDecl = (void*) notationDeclFunction; @@ -3712,7 +3721,6 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...) LIB->fatalError = (void*) fatalErrorFunction; LIB->getParameterEntity = (void*) getParameterEntityFunction; LIB->cdataBlock = (void*) cdataBlockFunction; - LIB->resolveEntity = (void*) resolveEntityFunction; #undef LIB return YES; } @@ -3814,6 +3822,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...) SETCB(isStandalone, isStandalone); SETCB(hasInternalSubset, hasInternalSubset); SETCB(hasExternalSubset, hasExternalSubset); + LIB->resolveEntity = resolveEntityFunction; SETCB(getEntity, getEntity:); if (LIB->getEntity != getEntityFunction) { @@ -3871,6 +3880,7 @@ fatalErrorFunction(void *ctx, const unsigned char *msg, ...) LIB->isStandalone = (void*)isStandaloneFunction; LIB->hasInternalSubset = (void*)hasInternalSubsetFunction; LIB->hasExternalSubset = (void*)hasExternalSubsetFunction; + LIB->resolveEntity = (void*)resolveEntityFunction; LIB->getEntity = (void*)getEntityFunction; LIB->entityDecl = (void*)entityDeclFunction; LIB->notationDecl = (void*)notationDeclFunction;