From 686d6b6ab1b9345c1fbeed23696d5f74153a24b2 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 3 Jan 2000 11:08:02 +0000 Subject: - added xmlRemoveProp - changed the way Windows socket stuff get included - removed an indetermination xmLDecl/PI(xml...) - xmlNewNs wasn't checking for double definition - fixed a problem with dist-hook duplicates - fixed the loading of external entities APIs, now xmlLoadExternalEntity() is used everywhere - now the xhtml spec validates with the xhtml DTD. - error.c: fixed crashes in case of no input stream - added the xhtml spec and dtds to the validation tests and results Daniel --- SAX.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'SAX.c') diff --git a/SAX.c b/SAX.c index 19e0da36..35d80131 100644 --- a/SAX.c +++ b/SAX.c @@ -22,6 +22,7 @@ #include "entities.h" #include "xml-error.h" #include "debugXML.h" +#include "xmlIO.h" #include "SAX.h" /* #define DEBUG_SAX */ @@ -145,7 +146,7 @@ hasExternalSubset(void *ctx) * internalSubset: * @ctx: the user data (XML parser context) * - * Does this document has an internal subset + * Callback on internal subset declaration. */ void internalSubset(void *ctx, const xmlChar *name, @@ -226,11 +227,11 @@ internalSubset(void *ctx, const xmlChar *name, * @publicId: The public ID of the entity * @systemId: The system ID of the entity * - * Special entity resolver, better left to the parser, it has - * more context than the application layer. - * The default behaviour is to NOT resolve the entities, in that case - * the ENTITY_REF nodes are built in the structure (and the parameter - * values). + * The entity loader, to control the loading of external entities, + * the application can either: + * - override this resolveEntity() callback in the SAX block + * - or better use the xmlSetExternalEntityLoader() function to + * set up it's own entity resolution routine * * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. */ @@ -243,10 +244,8 @@ resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId); #endif - if (systemId != NULL) { - return(xmlNewInputFromFile(ctxt, (char *) systemId)); - } - return(NULL); + return(xmlLoadExternalEntity((const char *) systemId, + (const char *) publicId, ctxt)); } /** -- cgit v1.2.1