diff --git a/android/native/jni/Android.mk b/android/native/jni/Android.mk index 52fd61a903..5aed71432d 100644 --- a/android/native/jni/Android.mk +++ b/android/native/jni/Android.mk @@ -35,11 +35,9 @@ LOCAL_LIBXML_SRC_FILES = $(LIBXML_PATH)/c14n.c \ $(LIBXML_PATH)/error.c \ $(LIBXML_PATH)/globals.c \ $(LIBXML_PATH)/hash.c \ - $(LIBXML_PATH)/legacy.c \ $(LIBXML_PATH)/list.c \ $(LIBXML_PATH)/parser.c \ $(LIBXML_PATH)/parserInternals.c \ - $(LIBXML_PATH)/SAX.c \ $(LIBXML_PATH)/SAX2.c \ $(LIBXML_PATH)/threads.c \ $(LIBXML_PATH)/tree.c \ diff --git a/android/native/libxml2/SAX.c b/android/native/libxml2/SAX.c deleted file mode 100644 index 04fbab9713..0000000000 --- a/android/native/libxml2/SAX.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * SAX.c : Old SAX v1 handlers to build a tree. - * Deprecated except for compatibility - * - * See Copyright for the status of this software. - * - * Daniel Veillard - */ - - -#define IN_LIBXML -#include "libxml.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef LIBXML_LEGACY_ENABLED -#ifdef LIBXML_SAX1_ENABLED -/** - * initxmlDefaultSAXHandler: - * @hdlr: the SAX handler - * @warning: flag if non-zero sets the handler warning procedure - * - * Initialize the default XML SAX version 1 handler - * DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks - */ -void -initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning) -{ - - if(hdlr->initialized == 1) - return; - - hdlr->internalSubset = xmlSAX2InternalSubset; - hdlr->externalSubset = xmlSAX2ExternalSubset; - hdlr->isStandalone = xmlSAX2IsStandalone; - hdlr->hasInternalSubset = xmlSAX2HasInternalSubset; - hdlr->hasExternalSubset = xmlSAX2HasExternalSubset; - hdlr->resolveEntity = xmlSAX2ResolveEntity; - hdlr->getEntity = xmlSAX2GetEntity; - hdlr->getParameterEntity = xmlSAX2GetParameterEntity; - hdlr->entityDecl = xmlSAX2EntityDecl; - hdlr->attributeDecl = xmlSAX2AttributeDecl; - hdlr->elementDecl = xmlSAX2ElementDecl; - hdlr->notationDecl = xmlSAX2NotationDecl; - hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl; - hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; - hdlr->startDocument = xmlSAX2StartDocument; - hdlr->endDocument = xmlSAX2EndDocument; - hdlr->startElement = xmlSAX2StartElement; - hdlr->endElement = xmlSAX2EndElement; - hdlr->reference = xmlSAX2Reference; - hdlr->characters = xmlSAX2Characters; - hdlr->cdataBlock = xmlSAX2CDataBlock; - hdlr->ignorableWhitespace = xmlSAX2Characters; - hdlr->processingInstruction = xmlSAX2ProcessingInstruction; - if (warning == 0) - hdlr->warning = NULL; - else - hdlr->warning = xmlParserWarning; - hdlr->error = xmlParserError; - hdlr->fatalError = xmlParserError; - - hdlr->initialized = 1; -} - -#endif /* LIBXML_SAX1_ENABLED */ - -#define bottom_SAX -#include "elfgcchack.h" -#endif /* LIBXML_LEGACY_ENABLED */ diff --git a/android/native/libxml2/SAX2.c b/android/native/libxml2/SAX2.c index 33557316f4..10dfdc5766 100644 --- a/android/native/libxml2/SAX2.c +++ b/android/native/libxml2/SAX2.c @@ -1037,7 +1037,7 @@ xmlSAX2EndDocument(void *ctx) } } -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_WRITER_ENABLED) /** * xmlSAX2AttributeInternal: * @ctx: the user data (XML parser context) @@ -1775,7 +1775,7 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) #endif nodePop(ctxt); } -#endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLE */ +#endif /* LIBXML_HTML_ENABLE */ /* * xmlSAX2TextNode: @@ -2743,31 +2743,6 @@ xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len) static int xmlSAX2DefaultVersionValue = 2; -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlSAXDefaultVersion: - * @version: the version, 1 or 2 - * - * Set the default version of SAX used globally by the library. - * By default, during initialization the default is set to 2. - * Note that it is generally a better coding style to use - * xmlSAXVersion() to set up the version explicitly for a given - * parsing context. - * - * Returns the previous value in case of success and -1 in case of error. - */ -int -xmlSAXDefaultVersion(int version) -{ - int ret = xmlSAX2DefaultVersionValue; - - if ((version != 1) && (version != 2)) - return(-1); - xmlSAX2DefaultVersionValue = version; - return(ret); -} -#endif /* LIBXML_SAX1_ENABLED */ - /** * xmlSAXVersion: * @hdlr: the SAX handler @@ -2788,12 +2763,6 @@ xmlSAXVersion(xmlSAXHandler *hdlr, int version) hdlr->endElementNs = xmlSAX2EndElementNs; hdlr->serror = NULL; hdlr->initialized = XML_SAX2_MAGIC; -#ifdef LIBXML_SAX1_ENABLED - } else if (version == 1) { - hdlr->startElement = xmlSAX2StartElement; - hdlr->endElement = xmlSAX2EndElement; - hdlr->initialized = 1; -#endif /* LIBXML_SAX1_ENABLED */ } else return(-1); hdlr->internalSubset = xmlSAX2InternalSubset; @@ -2853,9 +2822,6 @@ xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning) void xmlDefaultSAXHandlerInit(void) { -#ifdef LIBXML_SAX1_ENABLED - xmlSAXVersion((xmlSAXHandlerPtr) &xmlDefaultSAXHandler, 1); -#endif /* LIBXML_SAX1_ENABLED */ } #define bottom_SAX2 diff --git a/android/native/libxml2/elfgcchack.h b/android/native/libxml2/elfgcchack.h index 8a3c172c77..f372e62626 100644 --- a/android/native/libxml2/elfgcchack.h +++ b/android/native/libxml2/elfgcchack.h @@ -1007,17 +1007,6 @@ extern __typeof (xmlCleanupParser) xmlCleanupParser__internal_alias __attribute( #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlCleanupPredefinedEntities -extern __typeof (xmlCleanupPredefinedEntities) xmlCleanupPredefinedEntities __attribute((alias("xmlCleanupPredefinedEntities__internal_alias"))); -#else -#ifndef xmlCleanupPredefinedEntities -extern __typeof (xmlCleanupPredefinedEntities) xmlCleanupPredefinedEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlCleanupPredefinedEntities xmlCleanupPredefinedEntities__internal_alias -#endif -#endif -#endif #ifdef bottom_threads #undef xmlCleanupThreads @@ -1525,17 +1514,6 @@ extern __typeof (xmlDOMWrapRemoveNode) xmlDOMWrapRemoveNode__internal_alias __at #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlDecodeEntities -extern __typeof (xmlDecodeEntities) xmlDecodeEntities __attribute((alias("xmlDecodeEntities__internal_alias"))); -#else -#ifndef xmlDecodeEntities -extern __typeof (xmlDecodeEntities) xmlDecodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlDecodeEntities xmlDecodeEntities__internal_alias -#endif -#endif -#endif #ifdef bottom_SAX2 #undef xmlDefaultSAXHandlerInit @@ -1899,18 +1877,6 @@ extern __typeof (xmlElemDump) xmlElemDump__internal_alias __attribute((visibilit #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlEncodeEntities -extern __typeof (xmlEncodeEntities) xmlEncodeEntities __attribute((alias("xmlEncodeEntities__internal_alias"))); -#else -#ifndef xmlEncodeEntities -extern __typeof (xmlEncodeEntities) xmlEncodeEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlEncodeEntities xmlEncodeEntities__internal_alias -#endif -#endif -#endif - #ifdef bottom_entities #undef xmlEncodeEntitiesReentrant extern __typeof (xmlEncodeEntitiesReentrant) xmlEncodeEntitiesReentrant __attribute((alias("xmlEncodeEntitiesReentrant__internal_alias"))); @@ -2669,30 +2635,6 @@ extern __typeof (xmlGetExternalEntityLoader) xmlGetExternalEntityLoader__interna #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlGetFeature -extern __typeof (xmlGetFeature) xmlGetFeature __attribute((alias("xmlGetFeature__internal_alias"))); -#else -#ifndef xmlGetFeature -extern __typeof (xmlGetFeature) xmlGetFeature__internal_alias __attribute((visibility("hidden"))); -#define xmlGetFeature xmlGetFeature__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlGetFeaturesList -extern __typeof (xmlGetFeaturesList) xmlGetFeaturesList __attribute((alias("xmlGetFeaturesList__internal_alias"))); -#else -#ifndef xmlGetFeaturesList -extern __typeof (xmlGetFeaturesList) xmlGetFeaturesList__internal_alias __attribute((visibility("hidden"))); -#define xmlGetFeaturesList xmlGetFeaturesList__internal_alias -#endif -#endif -#endif - #ifdef bottom_threads #undef xmlGetGlobalState extern __typeof (xmlGetGlobalState) xmlGetGlobalState __attribute((alias("xmlGetGlobalState__internal_alias"))); @@ -2857,18 +2799,6 @@ extern __typeof (xmlGetUTF8Char) xmlGetUTF8Char__internal_alias __attribute((vis #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlHandleEntity -extern __typeof (xmlHandleEntity) xmlHandleEntity __attribute((alias("xmlHandleEntity__internal_alias"))); -#else -#ifndef xmlHandleEntity -extern __typeof (xmlHandleEntity) xmlHandleEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlHandleEntity xmlHandleEntity__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlHasFeature extern __typeof (xmlHasFeature) xmlHasFeature __attribute((alias("xmlHasFeature__internal_alias"))); @@ -3231,17 +3161,6 @@ extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState__internal_al #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlInitializePredefinedEntities -extern __typeof (xmlInitializePredefinedEntities) xmlInitializePredefinedEntities __attribute((alias("xmlInitializePredefinedEntities__internal_alias"))); -#else -#ifndef xmlInitializePredefinedEntities -extern __typeof (xmlInitializePredefinedEntities) xmlInitializePredefinedEntities__internal_alias __attribute((visibility("hidden"))); -#define xmlInitializePredefinedEntities xmlInitializePredefinedEntities__internal_alias -#endif -#endif -#endif #ifdef bottom_chvalid #undef xmlIsBaseChar @@ -3923,42 +3842,6 @@ extern __typeof (xmlMutexUnlock) xmlMutexUnlock__internal_alias __attribute((vis #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseNCName -extern __typeof (xmlNamespaceParseNCName) xmlNamespaceParseNCName __attribute((alias("xmlNamespaceParseNCName__internal_alias"))); -#else -#ifndef xmlNamespaceParseNCName -extern __typeof (xmlNamespaceParseNCName) xmlNamespaceParseNCName__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseNCName xmlNamespaceParseNCName__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseNSDef -extern __typeof (xmlNamespaceParseNSDef) xmlNamespaceParseNSDef __attribute((alias("xmlNamespaceParseNSDef__internal_alias"))); -#else -#ifndef xmlNamespaceParseNSDef -extern __typeof (xmlNamespaceParseNSDef) xmlNamespaceParseNSDef__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseNSDef xmlNamespaceParseNSDef__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNamespaceParseQName -extern __typeof (xmlNamespaceParseQName) xmlNamespaceParseQName __attribute((alias("xmlNamespaceParseQName__internal_alias"))); -#else -#ifndef xmlNamespaceParseQName -extern __typeof (xmlNamespaceParseQName) xmlNamespaceParseQName__internal_alias __attribute((visibility("hidden"))); -#define xmlNamespaceParseQName xmlNamespaceParseQName__internal_alias -#endif -#endif -#endif - #if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) #ifdef bottom_xmlregexp #undef xmlNewAutomata @@ -4177,18 +4060,6 @@ extern __typeof (xmlNewEntityInputStream) xmlNewEntityInputStream__internal_alia #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlNewGlobalNs -extern __typeof (xmlNewGlobalNs) xmlNewGlobalNs __attribute((alias("xmlNewGlobalNs__internal_alias"))); -#else -#ifndef xmlNewGlobalNs -extern __typeof (xmlNewGlobalNs) xmlNewGlobalNs__internal_alias __attribute((visibility("hidden"))); -#define xmlNewGlobalNs xmlNewGlobalNs__internal_alias -#endif -#endif -#endif - #ifdef bottom_parserInternals #undef xmlNewIOInputStream extern __typeof (xmlNewIOInputStream) xmlNewIOInputStream __attribute((alias("xmlNewIOInputStream__internal_alias"))); @@ -4869,17 +4740,6 @@ extern __typeof (xmlParseAttValue) xmlParseAttValue__internal_alias __attribute( #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseAttribute -extern __typeof (xmlParseAttribute) xmlParseAttribute __attribute((alias("xmlParseAttribute__internal_alias"))); -#else -#ifndef xmlParseAttribute -extern __typeof (xmlParseAttribute) xmlParseAttribute__internal_alias __attribute((visibility("hidden"))); -#define xmlParseAttribute xmlParseAttribute__internal_alias -#endif -#endif -#endif #ifdef bottom_parser #undef xmlParseAttributeListDecl @@ -4901,30 +4761,6 @@ extern __typeof (xmlParseAttributeType) xmlParseAttributeType__internal_alias __ #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseBalancedChunkMemory -extern __typeof (xmlParseBalancedChunkMemory) xmlParseBalancedChunkMemory __attribute((alias("xmlParseBalancedChunkMemory__internal_alias"))); -#else -#ifndef xmlParseBalancedChunkMemory -extern __typeof (xmlParseBalancedChunkMemory) xmlParseBalancedChunkMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlParseBalancedChunkMemory xmlParseBalancedChunkMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseBalancedChunkMemoryRecover -extern __typeof (xmlParseBalancedChunkMemoryRecover) xmlParseBalancedChunkMemoryRecover __attribute((alias("xmlParseBalancedChunkMemoryRecover__internal_alias"))); -#else -#ifndef xmlParseBalancedChunkMemoryRecover -extern __typeof (xmlParseBalancedChunkMemoryRecover) xmlParseBalancedChunkMemoryRecover__internal_alias __attribute((visibility("hidden"))); -#define xmlParseBalancedChunkMemoryRecover xmlParseBalancedChunkMemoryRecover__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseCDSect extern __typeof (xmlParseCDSect) xmlParseCDSect __attribute((alias("xmlParseCDSect__internal_alias"))); @@ -5029,18 +4865,6 @@ extern __typeof (xmlParseDefaultDecl) xmlParseDefaultDecl__internal_alias __attr #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseDoc -extern __typeof (xmlParseDoc) xmlParseDoc __attribute((alias("xmlParseDoc__internal_alias"))); -#else -#ifndef xmlParseDoc -extern __typeof (xmlParseDoc) xmlParseDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlParseDoc xmlParseDoc__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseDocTypeDecl extern __typeof (xmlParseDocTypeDecl) xmlParseDocTypeDecl __attribute((alias("xmlParseDocTypeDecl__internal_alias"))); @@ -5131,30 +4955,6 @@ extern __typeof (xmlParseEncodingDecl) xmlParseEncodingDecl__internal_alias __at #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseEndTag -extern __typeof (xmlParseEndTag) xmlParseEndTag __attribute((alias("xmlParseEndTag__internal_alias"))); -#else -#ifndef xmlParseEndTag -extern __typeof (xmlParseEndTag) xmlParseEndTag__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEndTag xmlParseEndTag__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseEntity -extern __typeof (xmlParseEntity) xmlParseEntity __attribute((alias("xmlParseEntity__internal_alias"))); -#else -#ifndef xmlParseEntity -extern __typeof (xmlParseEntity) xmlParseEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlParseEntity xmlParseEntity__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseEntityDecl extern __typeof (xmlParseEntityDecl) xmlParseEntityDecl __attribute((alias("xmlParseEntityDecl__internal_alias"))); @@ -5215,18 +5015,6 @@ extern __typeof (xmlParseExtParsedEnt) xmlParseExtParsedEnt__internal_alias __at #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseExternalEntity -extern __typeof (xmlParseExternalEntity) xmlParseExternalEntity __attribute((alias("xmlParseExternalEntity__internal_alias"))); -#else -#ifndef xmlParseExternalEntity -extern __typeof (xmlParseExternalEntity) xmlParseExternalEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlParseExternalEntity xmlParseExternalEntity__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseExternalID extern __typeof (xmlParseExternalID) xmlParseExternalID __attribute((alias("xmlParseExternalID__internal_alias"))); @@ -5247,18 +5035,6 @@ extern __typeof (xmlParseExternalSubset) xmlParseExternalSubset__internal_alias #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseFile -extern __typeof (xmlParseFile) xmlParseFile __attribute((alias("xmlParseFile__internal_alias"))); -#else -#ifndef xmlParseFile -extern __typeof (xmlParseFile) xmlParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlParseFile xmlParseFile__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseInNodeContext extern __typeof (xmlParseInNodeContext) xmlParseInNodeContext __attribute((alias("xmlParseInNodeContext__internal_alias"))); @@ -5279,18 +5055,6 @@ extern __typeof (xmlParseMarkupDecl) xmlParseMarkupDecl__internal_alias __attrib #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseMemory -extern __typeof (xmlParseMemory) xmlParseMemory __attribute((alias("xmlParseMemory__internal_alias"))); -#else -#ifndef xmlParseMemory -extern __typeof (xmlParseMemory) xmlParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlParseMemory xmlParseMemory__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseMisc extern __typeof (xmlParseMisc) xmlParseMisc __attribute((alias("xmlParseMisc__internal_alias"))); @@ -5311,18 +5075,6 @@ extern __typeof (xmlParseName) xmlParseName__internal_alias __attribute((visibil #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParseNamespace -extern __typeof (xmlParseNamespace) xmlParseNamespace __attribute((alias("xmlParseNamespace__internal_alias"))); -#else -#ifndef xmlParseNamespace -extern __typeof (xmlParseNamespace) xmlParseNamespace__internal_alias __attribute((visibility("hidden"))); -#define xmlParseNamespace xmlParseNamespace__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseNmtoken extern __typeof (xmlParseNmtoken) xmlParseNmtoken __attribute((alias("xmlParseNmtoken__internal_alias"))); @@ -5393,18 +5145,6 @@ extern __typeof (xmlParsePubidLiteral) xmlParsePubidLiteral__internal_alias __at #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParseQuotedString -extern __typeof (xmlParseQuotedString) xmlParseQuotedString __attribute((alias("xmlParseQuotedString__internal_alias"))); -#else -#ifndef xmlParseQuotedString -extern __typeof (xmlParseQuotedString) xmlParseQuotedString__internal_alias __attribute((visibility("hidden"))); -#define xmlParseQuotedString xmlParseQuotedString__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseReference extern __typeof (xmlParseReference) xmlParseReference __attribute((alias("xmlParseReference__internal_alias"))); @@ -5425,18 +5165,6 @@ extern __typeof (xmlParseSDDecl) xmlParseSDDecl__internal_alias __attribute((vis #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlParseStartTag -extern __typeof (xmlParseStartTag) xmlParseStartTag __attribute((alias("xmlParseStartTag__internal_alias"))); -#else -#ifndef xmlParseStartTag -extern __typeof (xmlParseStartTag) xmlParseStartTag__internal_alias __attribute((visibility("hidden"))); -#define xmlParseStartTag xmlParseStartTag__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlParseSystemLiteral extern __typeof (xmlParseSystemLiteral) xmlParseSystemLiteral __attribute((alias("xmlParseSystemLiteral__internal_alias"))); @@ -5577,18 +5305,6 @@ extern __typeof (xmlParserHandlePEReference) xmlParserHandlePEReference__interna #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlParserHandleReference -extern __typeof (xmlParserHandleReference) xmlParserHandleReference __attribute((alias("xmlParserHandleReference__internal_alias"))); -#else -#ifndef xmlParserHandleReference -extern __typeof (xmlParserHandleReference) xmlParserHandleReference__internal_alias __attribute((visibility("hidden"))); -#define xmlParserHandleReference xmlParserHandleReference__internal_alias -#endif -#endif -#endif - #ifdef bottom_xmlIO #undef xmlParserInputBufferCreateFd extern __typeof (xmlParserInputBufferCreateFd) xmlParserInputBufferCreateFd __attribute((alias("xmlParserInputBufferCreateFd__internal_alias"))); @@ -6077,42 +5793,6 @@ extern __typeof (xmlReconciliateNs) xmlReconciliateNs__internal_alias __attribut #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverDoc -extern __typeof (xmlRecoverDoc) xmlRecoverDoc __attribute((alias("xmlRecoverDoc__internal_alias"))); -#else -#ifndef xmlRecoverDoc -extern __typeof (xmlRecoverDoc) xmlRecoverDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverDoc xmlRecoverDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverFile -extern __typeof (xmlRecoverFile) xmlRecoverFile __attribute((alias("xmlRecoverFile__internal_alias"))); -#else -#ifndef xmlRecoverFile -extern __typeof (xmlRecoverFile) xmlRecoverFile__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverFile xmlRecoverFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlRecoverMemory -extern __typeof (xmlRecoverMemory) xmlRecoverMemory __attribute((alias("xmlRecoverMemory__internal_alias"))); -#else -#ifndef xmlRecoverMemory -extern __typeof (xmlRecoverMemory) xmlRecoverMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlRecoverMemory xmlRecoverMemory__internal_alias -#endif -#endif -#endif - #if defined(LIBXML_REGEXP_ENABLED) #ifdef bottom_xmlregexp #undef xmlRegExecErrInfo @@ -6431,7 +6111,7 @@ extern __typeof (xmlSAX2EndDocument) xmlSAX2EndDocument__internal_alias __attrib #endif #endif -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_WRITER_ENABLED) #ifdef bottom_SAX2 #undef xmlSAX2EndElement extern __typeof (xmlSAX2EndElement) xmlSAX2EndElement __attribute((alias("xmlSAX2EndElement__internal_alias"))); @@ -6653,7 +6333,7 @@ extern __typeof (xmlSAX2StartDocument) xmlSAX2StartDocument__internal_alias __at #endif #endif -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_WRITER_ENABLED) #ifdef bottom_SAX2 #undef xmlSAX2StartElement extern __typeof (xmlSAX2StartElement) xmlSAX2StartElement __attribute((alias("xmlSAX2StartElement__internal_alias"))); @@ -6685,18 +6365,6 @@ extern __typeof (xmlSAX2UnparsedEntityDecl) xmlSAX2UnparsedEntityDecl__internal_ #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_SAX2 -#undef xmlSAXDefaultVersion -extern __typeof (xmlSAXDefaultVersion) xmlSAXDefaultVersion __attribute((alias("xmlSAXDefaultVersion__internal_alias"))); -#else -#ifndef xmlSAXDefaultVersion -extern __typeof (xmlSAXDefaultVersion) xmlSAXDefaultVersion__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXDefaultVersion xmlSAXDefaultVersion__internal_alias -#endif -#endif -#endif - #if defined(LIBXML_VALID_ENABLED) #ifdef bottom_parser #undef xmlSAXParseDTD @@ -6709,102 +6377,6 @@ extern __typeof (xmlSAXParseDTD) xmlSAXParseDTD__internal_alias __attribute((vis #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseDoc -extern __typeof (xmlSAXParseDoc) xmlSAXParseDoc __attribute((alias("xmlSAXParseDoc__internal_alias"))); -#else -#ifndef xmlSAXParseDoc -extern __typeof (xmlSAXParseDoc) xmlSAXParseDoc__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseDoc xmlSAXParseDoc__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseEntity -extern __typeof (xmlSAXParseEntity) xmlSAXParseEntity __attribute((alias("xmlSAXParseEntity__internal_alias"))); -#else -#ifndef xmlSAXParseEntity -extern __typeof (xmlSAXParseEntity) xmlSAXParseEntity__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseEntity xmlSAXParseEntity__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseFile -extern __typeof (xmlSAXParseFile) xmlSAXParseFile __attribute((alias("xmlSAXParseFile__internal_alias"))); -#else -#ifndef xmlSAXParseFile -extern __typeof (xmlSAXParseFile) xmlSAXParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseFile xmlSAXParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseFileWithData -extern __typeof (xmlSAXParseFileWithData) xmlSAXParseFileWithData __attribute((alias("xmlSAXParseFileWithData__internal_alias"))); -#else -#ifndef xmlSAXParseFileWithData -extern __typeof (xmlSAXParseFileWithData) xmlSAXParseFileWithData__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseFileWithData xmlSAXParseFileWithData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseMemory -extern __typeof (xmlSAXParseMemory) xmlSAXParseMemory __attribute((alias("xmlSAXParseMemory__internal_alias"))); -#else -#ifndef xmlSAXParseMemory -extern __typeof (xmlSAXParseMemory) xmlSAXParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseMemory xmlSAXParseMemory__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXParseMemoryWithData -extern __typeof (xmlSAXParseMemoryWithData) xmlSAXParseMemoryWithData __attribute((alias("xmlSAXParseMemoryWithData__internal_alias"))); -#else -#ifndef xmlSAXParseMemoryWithData -extern __typeof (xmlSAXParseMemoryWithData) xmlSAXParseMemoryWithData__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXParseMemoryWithData xmlSAXParseMemoryWithData__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXUserParseFile -extern __typeof (xmlSAXUserParseFile) xmlSAXUserParseFile __attribute((alias("xmlSAXUserParseFile__internal_alias"))); -#else -#ifndef xmlSAXUserParseFile -extern __typeof (xmlSAXUserParseFile) xmlSAXUserParseFile__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXUserParseFile xmlSAXUserParseFile__internal_alias -#endif -#endif -#endif - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSAXUserParseMemory -extern __typeof (xmlSAXUserParseMemory) xmlSAXUserParseMemory __attribute((alias("xmlSAXUserParseMemory__internal_alias"))); -#else -#ifndef xmlSAXUserParseMemory -extern __typeof (xmlSAXUserParseMemory) xmlSAXUserParseMemory__internal_alias __attribute((visibility("hidden"))); -#define xmlSAXUserParseMemory xmlSAXUserParseMemory__internal_alias -#endif -#endif -#endif - #ifdef bottom_SAX2 #undef xmlSAXVersion extern __typeof (xmlSAXVersion) xmlSAXVersion __attribute((alias("xmlSAXVersion__internal_alias"))); @@ -7017,18 +6589,6 @@ extern __typeof (xmlSaveUri) xmlSaveUri__internal_alias __attribute((visibility( #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlScanName -extern __typeof (xmlScanName) xmlScanName __attribute((alias("xmlScanName__internal_alias"))); -#else -#ifndef xmlScanName -extern __typeof (xmlScanName) xmlScanName__internal_alias __attribute((visibility("hidden"))); -#define xmlScanName xmlScanName__internal_alias -#endif -#endif -#endif - #ifdef bottom_tree #undef xmlSearchNs extern __typeof (xmlSearchNs) xmlSearchNs __attribute((alias("xmlSearchNs__internal_alias"))); @@ -7079,18 +6639,6 @@ extern __typeof (xmlSetDocCompressMode) xmlSetDocCompressMode__internal_alias __ #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_parser -#undef xmlSetEntityReferenceFunc -extern __typeof (xmlSetEntityReferenceFunc) xmlSetEntityReferenceFunc __attribute((alias("xmlSetEntityReferenceFunc__internal_alias"))); -#else -#ifndef xmlSetEntityReferenceFunc -extern __typeof (xmlSetEntityReferenceFunc) xmlSetEntityReferenceFunc__internal_alias __attribute((visibility("hidden"))); -#define xmlSetEntityReferenceFunc xmlSetEntityReferenceFunc__internal_alias -#endif -#endif -#endif - #ifdef bottom_xmlIO #undef xmlSetExternalEntityLoader extern __typeof (xmlSetExternalEntityLoader) xmlSetExternalEntityLoader __attribute((alias("xmlSetExternalEntityLoader__internal_alias"))); @@ -7101,17 +6649,6 @@ extern __typeof (xmlSetExternalEntityLoader) xmlSetExternalEntityLoader__interna #endif #endif -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef bottom_legacy -#undef xmlSetFeature -extern __typeof (xmlSetFeature) xmlSetFeature __attribute((alias("xmlSetFeature__internal_alias"))); -#else -#ifndef xmlSetFeature -extern __typeof (xmlSetFeature) xmlSetFeature__internal_alias __attribute((visibility("hidden"))); -#define xmlSetFeature xmlSetFeature__internal_alias -#endif -#endif -#endif #ifdef bottom_error #undef xmlSetGenericErrorFunc @@ -7187,18 +6724,6 @@ extern __typeof (xmlSetTreeDoc) xmlSetTreeDoc__internal_alias __attribute((visib #endif #endif -#if defined(LIBXML_SAX1_ENABLED) -#ifdef bottom_parser -#undef xmlSetupParserForBuffer -extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer __attribute((alias("xmlSetupParserForBuffer__internal_alias"))); -#else -#ifndef xmlSetupParserForBuffer -extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer__internal_alias __attribute((visibility("hidden"))); -#define xmlSetupParserForBuffer xmlSetupParserForBuffer__internal_alias -#endif -#endif -#endif - #ifdef bottom_parser #undef xmlSkipBlankChars extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars __attribute((alias("xmlSkipBlankChars__internal_alias"))); @@ -11685,7 +11210,7 @@ extern __typeof (xmlValidateElementDecl) xmlValidateElementDecl__internal_alias #endif #endif -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) #ifdef bottom_tree #undef xmlValidateNCName extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias"))); diff --git a/android/native/libxml2/globals.c b/android/native/libxml2/globals.c index 1154c03c50..111993a2c2 100644 --- a/android/native/libxml2/globals.c +++ b/android/native/libxml2/globals.c @@ -356,44 +356,6 @@ static const char *xmlTreeIndentStringThrDef = " "; int xmlSaveNoEmptyTags = 0; static int xmlSaveNoEmptyTagsThrDef = 0; -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlDefaultSAXHandler: - * - * Default SAX version1 handler for XML, builds the DOM tree - */ -xmlSAXHandlerV1 xmlDefaultSAXHandler = { - xmlSAX2InternalSubset, - xmlSAX2IsStandalone, - xmlSAX2HasInternalSubset, - xmlSAX2HasExternalSubset, - xmlSAX2ResolveEntity, - xmlSAX2GetEntity, - xmlSAX2EntityDecl, - xmlSAX2NotationDecl, - xmlSAX2AttributeDecl, - xmlSAX2ElementDecl, - xmlSAX2UnparsedEntityDecl, - xmlSAX2SetDocumentLocator, - xmlSAX2StartDocument, - xmlSAX2EndDocument, - xmlSAX2StartElement, - xmlSAX2EndElement, - xmlSAX2Reference, - xmlSAX2Characters, - xmlSAX2Characters, - xmlSAX2ProcessingInstruction, - xmlSAX2Comment, - xmlParserWarning, - xmlParserError, - xmlParserError, - xmlSAX2GetParameterEntity, - xmlSAX2CDataBlock, - xmlSAX2ExternalSubset, - 0, -}; -#endif /* LIBXML_SAX1_ENABLED */ - /** * xmlDefaultSAXLocator: * @@ -433,9 +395,6 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs) gs->oldXMLWDcompatibility = 0; gs->xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef; gs->xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef; -#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_LEGACY_ENABLED) - initxmlDefaultSAXHandler(&gs->xmlDefaultSAXHandler, 1); -#endif /* LIBXML_SAX1_ENABLED */ gs->xmlDefaultSAXLocator.getPublicId = xmlSAX2GetPublicId; gs->xmlDefaultSAXLocator.getSystemId = xmlSAX2GetSystemId; gs->xmlDefaultSAXLocator.getLineNumber = xmlSAX2GetLineNumber; @@ -717,17 +676,6 @@ int xmlThrDefDefaultBufferSize(int v) { return ret; } -#ifdef LIBXML_SAX1_ENABLED -#undef xmlDefaultSAXHandler -xmlSAXHandlerV1 * -__xmlDefaultSAXHandler(void) { - if (IS_MAIN_THREAD) - return (&xmlDefaultSAXHandler); - else - return (&xmlGetGlobalState()->xmlDefaultSAXHandler); -} -#endif /* LIBXML_SAX1_ENABLED */ - #undef xmlDefaultSAXLocator xmlSAXLocator * __xmlDefaultSAXLocator(void) { diff --git a/android/native/libxml2/legacy.c b/android/native/libxml2/legacy.c deleted file mode 100644 index ea6cf97b4e..0000000000 --- a/android/native/libxml2/legacy.c +++ /dev/null @@ -1,1307 +0,0 @@ -/* - * legacy.c: set of deprecated routines, not to be used anymore but - * kept purely for ABI compatibility - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#define IN_LIBXML -#include "libxml.h" - -#ifdef LIBXML_LEGACY_ENABLED -#include - -#include -#include -#include -#include -#include - -void xmlUpgradeOldNs(xmlDocPtr doc); - -/************************************************************************ - * * - * Deprecated functions kept for compatibility * - * * - ************************************************************************/ - -/** - * xmlInitializePredefinedEntities: - * - * Set up the predefined entities. - * Deprecated call - */ -void -xmlInitializePredefinedEntities(void) -{ -} - -/** - * xmlCleanupPredefinedEntities: - * - * Cleanup up the predefined entities table. - * Deprecated call - */ -void -xmlCleanupPredefinedEntities(void) -{ -} - -static const char *xmlFeaturesList[] = { - "validate", - "load subset", - "keep blanks", - "disable SAX", - "fetch external entities", - "substitute entities", - "gather line info", - "user data", - "is html", - "is standalone", - "stop parser", - "document", - "is well formed", - "is valid", - "SAX block", - "SAX function internalSubset", - "SAX function isStandalone", - "SAX function hasInternalSubset", - "SAX function hasExternalSubset", - "SAX function resolveEntity", - "SAX function getEntity", - "SAX function entityDecl", - "SAX function notationDecl", - "SAX function attributeDecl", - "SAX function elementDecl", - "SAX function unparsedEntityDecl", - "SAX function setDocumentLocator", - "SAX function startDocument", - "SAX function endDocument", - "SAX function startElement", - "SAX function endElement", - "SAX function reference", - "SAX function characters", - "SAX function ignorableWhitespace", - "SAX function processingInstruction", - "SAX function comment", - "SAX function warning", - "SAX function error", - "SAX function fatalError", - "SAX function getParameterEntity", - "SAX function cdataBlock", - "SAX function externalSubset", -}; - -/** - * xmlGetFeaturesList: - * @len: the length of the features name array (input/output) - * @result: an array of string to be filled with the features name. - * - * Copy at most *@len feature names into the @result array - * - * Returns -1 in case or error, or the total number of features, - * len is updated with the number of strings copied, - * strings must not be deallocated - */ -int -xmlGetFeaturesList(int *len, const char **result) -{ - int ret, i; - - ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]); - if ((len == NULL) || (result == NULL)) - return (ret); - if ((*len < 0) || (*len >= 1000)) - return (-1); - if (*len > ret) - *len = ret; - for (i = 0; i < *len; i++) - result[i] = xmlFeaturesList[i]; - return (ret); -} - -/** - * xmlGetFeature: - * @ctxt: an XML/HTML parser context - * @name: the feature name - * @result: location to store the result - * - * Read the current value of one feature of this parser instance - * - * Returns -1 in case or error, 0 otherwise - */ -int -xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result) -{ - if ((ctxt == NULL) || (name == NULL) || (result == NULL)) - return (-1); - - if (!strcmp(name, "validate")) { - *((int *) result) = ctxt->validate; - } else if (!strcmp(name, "keep blanks")) { - *((int *) result) = ctxt->keepBlanks; - } else if (!strcmp(name, "disable SAX")) { - *((int *) result) = ctxt->disableSAX; - } else if (!strcmp(name, "fetch external entities")) { - *((int *) result) = ctxt->loadsubset; - } else if (!strcmp(name, "substitute entities")) { - *((int *) result) = ctxt->replaceEntities; - } else if (!strcmp(name, "gather line info")) { - *((int *) result) = ctxt->record_info; - } else if (!strcmp(name, "user data")) { - *((void **) result) = ctxt->userData; - } else if (!strcmp(name, "is html")) { - *((int *) result) = ctxt->html; - } else if (!strcmp(name, "is standalone")) { - *((int *) result) = ctxt->standalone; - } else if (!strcmp(name, "document")) { - *((xmlDocPtr *) result) = ctxt->myDoc; - } else if (!strcmp(name, "is well formed")) { - *((int *) result) = ctxt->wellFormed; - } else if (!strcmp(name, "is valid")) { - *((int *) result) = ctxt->valid; - } else if (!strcmp(name, "SAX block")) { - *((xmlSAXHandlerPtr *) result) = ctxt->sax; - } else if (!strcmp(name, "SAX function internalSubset")) { - *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset; - } else if (!strcmp(name, "SAX function isStandalone")) { - *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone; - } else if (!strcmp(name, "SAX function hasInternalSubset")) { - *((hasInternalSubsetSAXFunc *) result) = - ctxt->sax->hasInternalSubset; - } else if (!strcmp(name, "SAX function hasExternalSubset")) { - *((hasExternalSubsetSAXFunc *) result) = - ctxt->sax->hasExternalSubset; - } else if (!strcmp(name, "SAX function resolveEntity")) { - *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity; - } else if (!strcmp(name, "SAX function getEntity")) { - *((getEntitySAXFunc *) result) = ctxt->sax->getEntity; - } else if (!strcmp(name, "SAX function entityDecl")) { - *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl; - } else if (!strcmp(name, "SAX function notationDecl")) { - *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl; - } else if (!strcmp(name, "SAX function attributeDecl")) { - *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl; - } else if (!strcmp(name, "SAX function elementDecl")) { - *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl; - } else if (!strcmp(name, "SAX function unparsedEntityDecl")) { - *((unparsedEntityDeclSAXFunc *) result) = - ctxt->sax->unparsedEntityDecl; - } else if (!strcmp(name, "SAX function setDocumentLocator")) { - *((setDocumentLocatorSAXFunc *) result) = - ctxt->sax->setDocumentLocator; - } else if (!strcmp(name, "SAX function startDocument")) { - *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument; - } else if (!strcmp(name, "SAX function endDocument")) { - *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument; - } else if (!strcmp(name, "SAX function startElement")) { - *((startElementSAXFunc *) result) = ctxt->sax->startElement; - } else if (!strcmp(name, "SAX function endElement")) { - *((endElementSAXFunc *) result) = ctxt->sax->endElement; - } else if (!strcmp(name, "SAX function reference")) { - *((referenceSAXFunc *) result) = ctxt->sax->reference; - } else if (!strcmp(name, "SAX function characters")) { - *((charactersSAXFunc *) result) = ctxt->sax->characters; - } else if (!strcmp(name, "SAX function ignorableWhitespace")) { - *((ignorableWhitespaceSAXFunc *) result) = - ctxt->sax->ignorableWhitespace; - } else if (!strcmp(name, "SAX function processingInstruction")) { - *((processingInstructionSAXFunc *) result) = - ctxt->sax->processingInstruction; - } else if (!strcmp(name, "SAX function comment")) { - *((commentSAXFunc *) result) = ctxt->sax->comment; - } else if (!strcmp(name, "SAX function warning")) { - *((warningSAXFunc *) result) = ctxt->sax->warning; - } else if (!strcmp(name, "SAX function error")) { - *((errorSAXFunc *) result) = ctxt->sax->error; - } else if (!strcmp(name, "SAX function fatalError")) { - *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError; - } else if (!strcmp(name, "SAX function getParameterEntity")) { - *((getParameterEntitySAXFunc *) result) = - ctxt->sax->getParameterEntity; - } else if (!strcmp(name, "SAX function cdataBlock")) { - *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock; - } else if (!strcmp(name, "SAX function externalSubset")) { - *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset; - } else { - return (-1); - } - return (0); -} - -/** - * xmlSetFeature: - * @ctxt: an XML/HTML parser context - * @name: the feature name - * @value: pointer to the location of the new value - * - * Change the current value of one feature of this parser instance - * - * Returns -1 in case or error, 0 otherwise - */ -int -xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value) -{ - if ((ctxt == NULL) || (name == NULL) || (value == NULL)) - return (-1); - - if (!strcmp(name, "validate")) { - int newvalidate = *((int *) value); - - if ((!ctxt->validate) && (newvalidate != 0)) { - if (ctxt->vctxt.warning == NULL) - ctxt->vctxt.warning = xmlParserValidityWarning; - if (ctxt->vctxt.error == NULL) - ctxt->vctxt.error = xmlParserValidityError; - ctxt->vctxt.nodeMax = 0; - } - ctxt->validate = newvalidate; - } else if (!strcmp(name, "keep blanks")) { - ctxt->keepBlanks = *((int *) value); - } else if (!strcmp(name, "disable SAX")) { - ctxt->disableSAX = *((int *) value); - } else if (!strcmp(name, "fetch external entities")) { - ctxt->loadsubset = *((int *) value); - } else if (!strcmp(name, "substitute entities")) { - ctxt->replaceEntities = *((int *) value); - } else if (!strcmp(name, "gather line info")) { - ctxt->record_info = *((int *) value); - } else if (!strcmp(name, "user data")) { - ctxt->userData = *((void **) value); - } else if (!strcmp(name, "is html")) { - ctxt->html = *((int *) value); - } else if (!strcmp(name, "is standalone")) { - ctxt->standalone = *((int *) value); - } else if (!strcmp(name, "document")) { - ctxt->myDoc = *((xmlDocPtr *) value); - } else if (!strcmp(name, "is well formed")) { - ctxt->wellFormed = *((int *) value); - } else if (!strcmp(name, "is valid")) { - ctxt->valid = *((int *) value); - } else if (!strcmp(name, "SAX block")) { - ctxt->sax = *((xmlSAXHandlerPtr *) value); - } else if (!strcmp(name, "SAX function internalSubset")) { - ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value); - } else if (!strcmp(name, "SAX function isStandalone")) { - ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value); - } else if (!strcmp(name, "SAX function hasInternalSubset")) { - ctxt->sax->hasInternalSubset = - *((hasInternalSubsetSAXFunc *) value); - } else if (!strcmp(name, "SAX function hasExternalSubset")) { - ctxt->sax->hasExternalSubset = - *((hasExternalSubsetSAXFunc *) value); - } else if (!strcmp(name, "SAX function resolveEntity")) { - ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value); - } else if (!strcmp(name, "SAX function getEntity")) { - ctxt->sax->getEntity = *((getEntitySAXFunc *) value); - } else if (!strcmp(name, "SAX function entityDecl")) { - ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value); - } else if (!strcmp(name, "SAX function notationDecl")) { - ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value); - } else if (!strcmp(name, "SAX function attributeDecl")) { - ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value); - } else if (!strcmp(name, "SAX function elementDecl")) { - ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value); - } else if (!strcmp(name, "SAX function unparsedEntityDecl")) { - ctxt->sax->unparsedEntityDecl = - *((unparsedEntityDeclSAXFunc *) value); - } else if (!strcmp(name, "SAX function setDocumentLocator")) { - ctxt->sax->setDocumentLocator = - *((setDocumentLocatorSAXFunc *) value); - } else if (!strcmp(name, "SAX function startDocument")) { - ctxt->sax->startDocument = *((startDocumentSAXFunc *) value); - } else if (!strcmp(name, "SAX function endDocument")) { - ctxt->sax->endDocument = *((endDocumentSAXFunc *) value); - } else if (!strcmp(name, "SAX function startElement")) { - ctxt->sax->startElement = *((startElementSAXFunc *) value); - } else if (!strcmp(name, "SAX function endElement")) { - ctxt->sax->endElement = *((endElementSAXFunc *) value); - } else if (!strcmp(name, "SAX function reference")) { - ctxt->sax->reference = *((referenceSAXFunc *) value); - } else if (!strcmp(name, "SAX function characters")) { - ctxt->sax->characters = *((charactersSAXFunc *) value); - } else if (!strcmp(name, "SAX function ignorableWhitespace")) { - ctxt->sax->ignorableWhitespace = - *((ignorableWhitespaceSAXFunc *) value); - } else if (!strcmp(name, "SAX function processingInstruction")) { - ctxt->sax->processingInstruction = - *((processingInstructionSAXFunc *) value); - } else if (!strcmp(name, "SAX function comment")) { - ctxt->sax->comment = *((commentSAXFunc *) value); - } else if (!strcmp(name, "SAX function warning")) { - ctxt->sax->warning = *((warningSAXFunc *) value); - } else if (!strcmp(name, "SAX function error")) { - ctxt->sax->error = *((errorSAXFunc *) value); - } else if (!strcmp(name, "SAX function fatalError")) { - ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value); - } else if (!strcmp(name, "SAX function getParameterEntity")) { - ctxt->sax->getParameterEntity = - *((getParameterEntitySAXFunc *) value); - } else if (!strcmp(name, "SAX function cdataBlock")) { - ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value); - } else if (!strcmp(name, "SAX function externalSubset")) { - ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value); - } else { - return (-1); - } - return (0); -} - -/** - * xmlDecodeEntities: - * @ctxt: the parser context - * @len: the len to decode (in bytes !), -1 for no size limit - * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF - * @end: an end marker xmlChar, 0 if none - * @end2: an end marker xmlChar, 0 if none - * @end3: an end marker xmlChar, 0 if none - * - * This function is deprecated, we now always process entities content - * through xmlStringDecodeEntities - * - * TODO: remove it in next major release. - * - * [67] Reference ::= EntityRef | CharRef - * - * [69] PEReference ::= '%' Name ';' - * - * Returns A newly allocated string with the substitution done. The caller - * must deallocate it ! - */ -xmlChar * -xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED, - xmlChar end ATTRIBUTE_UNUSED, - xmlChar end2 ATTRIBUTE_UNUSED, - xmlChar end3 ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "xmlDecodeEntities() deprecated function reached\n"); - deprecated = 1; - } - return (NULL); -} - -/** - * xmlNamespaceParseNCName: - * @ctxt: an XML parser context - * - * parse an XML namespace name. - * - * TODO: this seems not in use anymore, the namespace handling is done on - * top of the SAX interfaces, i.e. not on raw input. - * - * [NS 3] NCName ::= (Letter | '_') (NCNameChar)* - * - * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | - * CombiningChar | Extender - * - * Returns the namespace name or NULL - */ - -xmlChar * -xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "xmlNamespaceParseNCName() deprecated function reached\n"); - deprecated = 1; - } - return (NULL); -} - -/** - * xmlNamespaceParseQName: - * @ctxt: an XML parser context - * @prefix: a xmlChar ** - * - * TODO: this seems not in use anymore, the namespace handling is done on - * top of the SAX interfaces, i.e. not on raw input. - * - * parse an XML qualified name - * - * [NS 5] QName ::= (Prefix ':')? LocalPart - * - * [NS 6] Prefix ::= NCName - * - * [NS 7] LocalPart ::= NCName - * - * Returns the local part, and prefix is updated - * to get the Prefix if any. - */ - -xmlChar * -xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - xmlChar ** prefix ATTRIBUTE_UNUSED) -{ - - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "xmlNamespaceParseQName() deprecated function reached\n"); - deprecated = 1; - } - return (NULL); -} - -/** - * xmlNamespaceParseNSDef: - * @ctxt: an XML parser context - * - * parse a namespace prefix declaration - * - * TODO: this seems not in use anymore, the namespace handling is done on - * top of the SAX interfaces, i.e. not on raw input. - * - * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral - * - * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)? - * - * Returns the namespace name - */ - -xmlChar * -xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "xmlNamespaceParseNSDef() deprecated function reached\n"); - deprecated = 1; - } - return (NULL); -} - -/** - * xmlParseQuotedString: - * @ctxt: an XML parser context - * - * Parse and return a string between quotes or doublequotes - * - * TODO: Deprecated, to be removed at next drop of binary compatibility - * - * Returns the string parser or NULL. - */ -xmlChar * -xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "xmlParseQuotedString() deprecated function reached\n"); - deprecated = 1; - } - return (NULL); -} - -/** - * xmlParseNamespace: - * @ctxt: an XML parser context - * - * xmlParseNamespace: parse specific PI ' #include -#ifdef LIBXML_LEGACY_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif -XMLPUBFUN const xmlChar * XMLCALL - getPublicId (void *ctx); -XMLPUBFUN const xmlChar * XMLCALL - getSystemId (void *ctx); -XMLPUBFUN void XMLCALL - setDocumentLocator (void *ctx, - xmlSAXLocatorPtr loc); - -XMLPUBFUN int XMLCALL - getLineNumber (void *ctx); -XMLPUBFUN int XMLCALL - getColumnNumber (void *ctx); - -XMLPUBFUN int XMLCALL - isStandalone (void *ctx); -XMLPUBFUN int XMLCALL - hasInternalSubset (void *ctx); -XMLPUBFUN int XMLCALL - hasExternalSubset (void *ctx); - -XMLPUBFUN void XMLCALL - internalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN void XMLCALL - externalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XMLPUBFUN xmlEntityPtr XMLCALL - getEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlEntityPtr XMLCALL - getParameterEntity (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlParserInputPtr XMLCALL - resolveEntity (void *ctx, - const xmlChar *publicId, - const xmlChar *systemId); - -XMLPUBFUN void XMLCALL - entityDecl (void *ctx, - const xmlChar *name, - int type, - const xmlChar *publicId, - const xmlChar *systemId, - xmlChar *content); -XMLPUBFUN void XMLCALL - attributeDecl (void *ctx, - const xmlChar *elem, - const xmlChar *fullname, - int type, - int def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -XMLPUBFUN void XMLCALL - elementDecl (void *ctx, - const xmlChar *name, - int type, - xmlElementContentPtr content); -XMLPUBFUN void XMLCALL - notationDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId); -XMLPUBFUN void XMLCALL - unparsedEntityDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId, - const xmlChar *notationName); - -XMLPUBFUN void XMLCALL - startDocument (void *ctx); -XMLPUBFUN void XMLCALL - endDocument (void *ctx); -XMLPUBFUN void XMLCALL - attribute (void *ctx, - const xmlChar *fullname, - const xmlChar *value); -XMLPUBFUN void XMLCALL - startElement (void *ctx, - const xmlChar *fullname, - const xmlChar **atts); -XMLPUBFUN void XMLCALL - endElement (void *ctx, - const xmlChar *name); -XMLPUBFUN void XMLCALL - reference (void *ctx, - const xmlChar *name); -XMLPUBFUN void XMLCALL - characters (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - ignorableWhitespace (void *ctx, - const xmlChar *ch, - int len); -XMLPUBFUN void XMLCALL - processingInstruction (void *ctx, - const xmlChar *target, - const xmlChar *data); -XMLPUBFUN void XMLCALL - globalNamespace (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - setNamespace (void *ctx, - const xmlChar *name); -XMLPUBFUN xmlNsPtr XMLCALL - getNamespace (void *ctx); -XMLPUBFUN int XMLCALL - checkNamespace (void *ctx, - xmlChar *nameSpace); -XMLPUBFUN void XMLCALL - namespaceDecl (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XMLPUBFUN void XMLCALL - comment (void *ctx, - const xmlChar *value); -XMLPUBFUN void XMLCALL - cdataBlock (void *ctx, - const xmlChar *value, - int len); - -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL - initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, - int warning); -#endif /* LIBXML_SAX1_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_LEGACY_ENABLED */ #endif /* __XML_SAX_H__ */ diff --git a/android/native/libxml2/libxml/SAX2.h b/android/native/libxml2/libxml/SAX2.h index d8a7f28a8c..d22fea5571 100644 --- a/android/native/libxml2/libxml/SAX2.h +++ b/android/native/libxml2/libxml/SAX2.h @@ -98,7 +98,7 @@ XMLPUBFUN void XMLCALL xmlSAX2StartDocument (void *ctx); XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx); -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_WRITER_ENABLED) XMLPUBFUN void XMLCALL xmlSAX2StartElement (void *ctx, const xmlChar *fullname, @@ -106,7 +106,7 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL xmlSAX2EndElement (void *ctx, const xmlChar *name); -#endif /* LIBXML_SAX1_ENABLED */ +#endif /* */ XMLPUBFUN void XMLCALL xmlSAX2StartElementNs (void *ctx, const xmlChar *localname, @@ -145,10 +145,6 @@ XMLPUBFUN void XMLCALL const xmlChar *value, int len); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlSAXDefaultVersion (int version); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN int XMLCALL xmlSAXVersion (xmlSAXHandler *hdlr, diff --git a/android/native/libxml2/libxml/entities.h b/android/native/libxml2/libxml/entities.h index cefb97f780..bbe5874258 100644 --- a/android/native/libxml2/libxml/entities.h +++ b/android/native/libxml2/libxml/entities.h @@ -73,10 +73,6 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr; * External functions: */ -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL - xmlInitializePredefinedEntities (void); -#endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlEntityPtr XMLCALL xmlNewEntity (xmlDocPtr doc, @@ -110,11 +106,6 @@ XMLPUBFUN xmlEntityPtr XMLCALL XMLPUBFUN xmlEntityPtr XMLCALL xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name); -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN const xmlChar * XMLCALL - xmlEncodeEntities (xmlDocPtr doc, - const xmlChar *input); -#endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlChar * XMLCALL xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input); @@ -137,10 +128,6 @@ XMLPUBFUN void XMLCALL xmlDumpEntityDecl (xmlBufferPtr buf, xmlEntityPtr ent); #endif /* LIBXML_OUTPUT_ENABLED */ -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void XMLCALL - xmlCleanupPredefinedEntities(void); -#endif /* LIBXML_LEGACY_ENABLED */ #ifdef __cplusplus diff --git a/android/native/libxml2/libxml/parser.h b/android/native/libxml2/libxml/parser.h index 54f16608b3..de3f9c33ac 100644 --- a/android/native/libxml2/libxml/parser.h +++ b/android/native/libxml2/libxml/parser.h @@ -834,15 +834,6 @@ XMLPUBFUN int XMLCALL /* * Basic parsing Interfaces */ -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseFile (const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseMemory (const char *buffer, - int size); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN int XMLCALL xmlSubstituteEntitiesDefault(int val); XMLPUBFUN int XMLCALL @@ -854,18 +845,6 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlLineNumbersDefault (int val); -#ifdef LIBXML_SAX1_ENABLED -/* - * Recovery mode - */ -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverDoc (const xmlChar *cur); -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverMemory (const char *buffer, - int size); -XMLPUBFUN xmlDocPtr XMLCALL - xmlRecoverFile (const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ /* * Less common routines and SAX interfaces @@ -874,46 +853,6 @@ XMLPUBFUN int XMLCALL xmlParseDocument (xmlParserCtxtPtr ctxt); XMLPUBFUN int XMLCALL xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlSAXUserParseFile (xmlSAXHandlerPtr sax, - void *user_data, - const char *filename); -XMLPUBFUN int XMLCALL - xmlSAXUserParseMemory (xmlSAXHandlerPtr sax, - void *user_data, - const char *buffer, - int size); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseDoc (xmlSAXHandlerPtr sax, - const xmlChar *cur, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseMemory (xmlSAXHandlerPtr sax, - const char *buffer, - int size, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax, - const char *buffer, - int size, - int recovery, - void *data); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseFile (xmlSAXHandlerPtr sax, - const char *filename, - int recovery); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseFileWithData (xmlSAXHandlerPtr sax, - const char *filename, - int recovery, - void *data); -XMLPUBFUN xmlDocPtr XMLCALL - xmlSAXParseEntity (xmlSAXHandlerPtr sax, - const char *filename); -XMLPUBFUN xmlDocPtr XMLCALL - xmlParseEntity (const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ #ifdef LIBXML_VALID_ENABLED XMLPUBFUN xmlDtdPtr XMLCALL @@ -928,39 +867,12 @@ XMLPUBFUN xmlDtdPtr XMLCALL xmlParserInputBufferPtr input, xmlCharEncoding enc); #endif /* LIBXML_VALID_ENABLE */ -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlParseBalancedChunkMemory(xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *string, - xmlNodePtr *lst); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN xmlParserErrors XMLCALL xmlParseInNodeContext (xmlNodePtr node, const char *data, int datalen, int options, xmlNodePtr *lst); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN int XMLCALL - xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *string, - xmlNodePtr *lst, - int recover); -XMLPUBFUN int XMLCALL - xmlParseExternalEntity (xmlDocPtr doc, - xmlSAXHandlerPtr sax, - void *user_data, - int depth, - const xmlChar *URL, - const xmlChar *ID, - xmlNodePtr *lst); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN int XMLCALL xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL, @@ -978,31 +890,9 @@ XMLPUBFUN void XMLCALL xmlClearParserCtxt (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlFreeParserCtxt (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN void XMLCALL - xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt, - const xmlChar* buffer, - const char *filename); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN xmlParserCtxtPtr XMLCALL xmlCreateDocParserCtxt (const xmlChar *cur); -#ifdef LIBXML_LEGACY_ENABLED -/* - * Reading/setting optional parsing features. - */ -XMLPUBFUN int XMLCALL - xmlGetFeaturesList (int *len, - const char **result); -XMLPUBFUN int XMLCALL - xmlGetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *result); -XMLPUBFUN int XMLCALL - xmlSetFeature (xmlParserCtxtPtr ctxt, - const char *name, - void *value); -#endif /* LIBXML_LEGACY_ENABLED */ #ifdef LIBXML_PUSH_ENABLED /* diff --git a/android/native/libxml2/libxml/parserInternals.h b/android/native/libxml2/libxml/parserInternals.h index 7172548c79..f11e8e443f 100644 --- a/android/native/libxml2/libxml/parserInternals.h +++ b/android/native/libxml2/libxml/parserInternals.h @@ -425,15 +425,6 @@ XMLPUBFUN void XMLCALL xmlParsePEReference (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt); -#ifdef LIBXML_SAX1_ENABLED -XMLPUBFUN const xmlChar * XMLCALL - xmlParseAttribute (xmlParserCtxtPtr ctxt, - xmlChar **value); -XMLPUBFUN const xmlChar * XMLCALL - xmlParseStartTag (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseEndTag (xmlParserCtxtPtr ctxt); -#endif /* LIBXML_SAX1_ENABLED */ XMLPUBFUN void XMLCALL xmlParseCDSect (xmlParserCtxtPtr ctxt); XMLPUBFUN void XMLCALL @@ -541,51 +532,6 @@ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in); * Specific function to keep track of entities references * and used by the XSLT debugger. */ -#ifdef LIBXML_LEGACY_ENABLED -/** - * xmlEntityReferenceFunc: - * @ent: the entity - * @firstNode: the fist node in the chunk - * @lastNode: the last nod in the chunk - * - * Callback function used when one needs to be able to track back the - * provenance of a chunk of nodes inherited from an entity replacement. - */ -typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, - xmlNodePtr firstNode, - xmlNodePtr lastNode); - -XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); - -XMLPUBFUN xmlChar * XMLCALL - xmlParseQuotedString (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL - xmlParseNamespace (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlScanName (xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); -XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); -XMLPUBFUN xmlChar * XMLCALL - xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, - xmlChar **prefix); -/** - * Entities - */ -XMLPUBFUN xmlChar * XMLCALL - xmlDecodeEntities (xmlParserCtxtPtr ctxt, - int len, - int what, - xmlChar end, - xmlChar end2, - xmlChar end3); -XMLPUBFUN void XMLCALL - xmlHandleEntity (xmlParserCtxtPtr ctxt, - xmlEntityPtr entity); - -#endif /* LIBXML_LEGACY_ENABLED */ #ifdef IN_LIBXML /* diff --git a/android/native/libxml2/libxml/tree.h b/android/native/libxml2/libxml/tree.h index 5ef53abd33..ad8f679521 100644 --- a/android/native/libxml2/libxml/tree.h +++ b/android/native/libxml2/libxml/tree.h @@ -613,7 +613,7 @@ struct _xmlDOMWrapCtxt { /* * Some helper functions */ -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) XMLPUBFUN int XMLCALL xmlValidateNCName (const xmlChar *value, int space); @@ -714,12 +714,6 @@ XMLPUBFUN xmlDtdPtr XMLCALL xmlGetIntSubset (xmlDocPtr doc); XMLPUBFUN void XMLCALL xmlFreeDtd (xmlDtdPtr cur); -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN xmlNsPtr XMLCALL - xmlNewGlobalNs (xmlDocPtr doc, - const xmlChar *href, - const xmlChar *prefix); -#endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlNsPtr XMLCALL xmlNewNs (xmlNodePtr node, const xmlChar *href, diff --git a/android/native/libxml2/libxml/xmlversion.h b/android/native/libxml2/libxml/xmlversion.h index 415d3b117d..676901deb6 100644 --- a/android/native/libxml2/libxml/xmlversion.h +++ b/android/native/libxml2/libxml/xmlversion.h @@ -142,15 +142,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_WRITER_ENABLED #endif -/** - * LIBXML_SAX1_ENABLED: - * - * Whether the older SAX1 interface is configured in - */ -#if 1 -#define LIBXML_SAX1_ENABLED -#endif - /** * LIBXML_VALID_ENABLED: * @@ -160,15 +151,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_VALID_ENABLED #endif -/** - * LIBXML_LEGACY_ENABLED: - * - * Whether the deprecated APIs are compiled in for compatibility - */ -#if 0 -#define LIBXML_LEGACY_ENABLED -#endif - /** * LIBXML_C14N_ENABLED: * diff --git a/android/native/libxml2/parser.c b/android/native/libxml2/parser.c index 474265836a..7c9f7c7a50 100644 --- a/android/native/libxml2/parser.c +++ b/android/native/libxml2/parser.c @@ -211,11 +211,6 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, static int xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encoding); -#ifdef LIBXML_LEGACY_ENABLED -static void -xmlAddEntityReference(xmlEntityPtr ent, xmlNodePtr firstNode, - xmlNodePtr lastNode); -#endif /* LIBXML_LEGACY_ENABLED */ static xmlParserErrors xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt, @@ -804,11 +799,7 @@ xmlHasFeature(xmlFeature feature) return(0); #endif case XML_WITH_SAX1: -#ifdef LIBXML_SAX1_ENABLED - return(1); -#else return(0); -#endif case XML_WITH_FTP: return(0); case XML_WITH_HTTP: @@ -822,11 +813,7 @@ xmlHasFeature(xmlFeature feature) case XML_WITH_HTML: return(0); case XML_WITH_LEGACY: -#ifdef LIBXML_LEGACY_ENABLED - return(1); -#else return(0); -#endif case XML_WITH_C14N: #ifdef LIBXML_C14N_ENABLED return(1); @@ -940,13 +927,7 @@ xmlHasFeature(xmlFeature feature) static void xmlDetectSAX2(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; -#ifdef LIBXML_SAX1_ENABLED - if ((ctxt->sax) && (ctxt->sax->initialized == XML_SAX2_MAGIC) && - ((ctxt->sax->startElementNs != NULL) || - (ctxt->sax->endElementNs != NULL))) ctxt->sax2 = 1; -#else ctxt->sax2 = 1; -#endif /* LIBXML_SAX1_ENABLED */ ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3); ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5); @@ -6870,10 +6851,6 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { list = list->next; } list = ent->children; -#ifdef LIBXML_LEGACY_ENABLED - if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) - xmlAddEntityReference(ent, list, NULL); -#endif /* LIBXML_LEGACY_ENABLED */ } } else { ent->owner = 1; @@ -7031,10 +7008,6 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { } cur = cur->next; } -#ifdef LIBXML_LEGACY_ENABLED - if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) - xmlAddEntityReference(ent, firstChild, nw); -#endif /* LIBXML_LEGACY_ENABLED */ } else if (list == NULL) { xmlNodePtr nw = NULL, cur, next, last, firstChild = NULL; @@ -7068,10 +7041,6 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { } if (ent->owner == 0) ent->owner = 1; -#ifdef LIBXML_LEGACY_ENABLED - if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) - xmlAddEntityReference(ent, firstChild, nw); -#endif /* LIBXML_LEGACY_ENABLED */ } else { const xmlChar *nbktext; @@ -7933,340 +7902,6 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) { NEXT; } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlParseAttribute: - * @ctxt: an XML parser context - * @value: a xmlChar ** used to store the value of the attribute - * - * parse an attribute - * - * [41] Attribute ::= Name Eq AttValue - * - * [ WFC: No External Entity References ] - * Attribute values cannot contain direct or indirect entity references - * to external entities. - * - * [ WFC: No < in Attribute Values ] - * The replacement text of any entity referred to directly or indirectly in - * an attribute value (other than "<") must not contain a <. - * - * [ VC: Attribute Value Type ] - * The attribute must have been declared; the value must be of the type - * declared for it. - * - * [25] Eq ::= S? '=' S? - * - * With namespace: - * - * [NS 11] Attribute ::= QName Eq AttValue - * - * Also the case QName == xmlns:??? is handled independently as a namespace - * definition. - * - * Returns the attribute name, and the value in *value. - */ - -const xmlChar * -xmlParseAttribute(xmlParserCtxtPtr ctxt, xmlChar **value) { - const xmlChar *name; - xmlChar *val; - - *value = NULL; - GROW; - name = xmlParseName(ctxt); - if (name == NULL) { - xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, - "error parsing attribute name\n"); - return(NULL); - } - - /* - * read the value - */ - SKIP_BLANKS; - if (RAW == '=') { - NEXT; - SKIP_BLANKS; - val = xmlParseAttValue(ctxt); - ctxt->instate = XML_PARSER_CONTENT; - } else { - xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE, - "Specification mandate value for attribute %s\n", name); - return(NULL); - } - - /* - * Check that xml:lang conforms to the specification - * No more registered as an error, just generate a warning now - * since this was deprecated in XML second edition - */ - if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) { - if (!xmlCheckLanguageID(val)) { - xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE, - "Malformed value for xml:lang : %s\n", - val, NULL); - } - } - - /* - * Check that xml:space conforms to the specification - */ - if (xmlStrEqual(name, BAD_CAST "xml:space")) { - if (xmlStrEqual(val, BAD_CAST "default")) - *(ctxt->space) = 0; - else if (xmlStrEqual(val, BAD_CAST "preserve")) - *(ctxt->space) = 1; - else { - xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE, -"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n", - val, NULL); - } - } - - *value = val; - return(name); -} - -/** - * xmlParseStartTag: - * @ctxt: an XML parser context - * - * parse a start of tag either for rule element or - * EmptyElement. In both case we don't parse the tag closing chars. - * - * [40] STag ::= '<' Name (S Attribute)* S? '>' - * - * [ WFC: Unique Att Spec ] - * No attribute name may appear more than once in the same start-tag or - * empty-element tag. - * - * [44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' - * - * [ WFC: Unique Att Spec ] - * No attribute name may appear more than once in the same start-tag or - * empty-element tag. - * - * With namespace: - * - * [NS 8] STag ::= '<' QName (S Attribute)* S? '>' - * - * [NS 10] EmptyElement ::= '<' QName (S Attribute)* S? '/>' - * - * Returns the element name parsed - */ - -const xmlChar * -xmlParseStartTag(xmlParserCtxtPtr ctxt) { - const xmlChar *name; - const xmlChar *attname; - xmlChar *attvalue; - const xmlChar **atts = ctxt->atts; - int nbatts = 0; - int maxatts = ctxt->maxatts; - int i; - - if (RAW != '<') return(NULL); - NEXT1; - - name = xmlParseName(ctxt); - if (name == NULL) { - xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED, - "xmlParseStartTag: invalid element name\n"); - return(NULL); - } - - /* - * Now parse the attributes, it ends up with the ending - * - * (S Attribute)* S? - */ - SKIP_BLANKS; - GROW; - - while ((RAW != '>') && - ((RAW != '/') || (NXT(1) != '>')) && - (IS_BYTE_CHAR(RAW))) { - const xmlChar *q = CUR_PTR; - unsigned int cons = ctxt->input->consumed; - - attname = xmlParseAttribute(ctxt, &attvalue); - if ((attname != NULL) && (attvalue != NULL)) { - /* - * [ WFC: Unique Att Spec ] - * No attribute name may appear more than once in the same - * start-tag or empty-element tag. - */ - for (i = 0; i < nbatts;i += 2) { - if (xmlStrEqual(atts[i], attname)) { - xmlErrAttributeDup(ctxt, NULL, attname); - xmlFree(attvalue); - goto failed; - } - } - /* - * Add the pair to atts - */ - if (atts == NULL) { - maxatts = 22; /* allow for 10 attrs by default */ - atts = (const xmlChar **) - xmlMalloc(maxatts * sizeof(xmlChar *)); - if (atts == NULL) { - xmlErrMemory(ctxt, NULL); - if (attvalue != NULL) - xmlFree(attvalue); - goto failed; - } - ctxt->atts = atts; - ctxt->maxatts = maxatts; - } else if (nbatts + 4 > maxatts) { - const xmlChar **n; - - maxatts *= 2; - n = (const xmlChar **) xmlRealloc((void *) atts, - maxatts * sizeof(const xmlChar *)); - if (n == NULL) { - xmlErrMemory(ctxt, NULL); - if (attvalue != NULL) - xmlFree(attvalue); - goto failed; - } - atts = n; - ctxt->atts = atts; - ctxt->maxatts = maxatts; - } - atts[nbatts++] = attname; - atts[nbatts++] = attvalue; - atts[nbatts] = NULL; - atts[nbatts + 1] = NULL; - } else { - if (attvalue != NULL) - xmlFree(attvalue); - } - -failed: - - GROW - if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>')))) - break; - if (!IS_BLANK_CH(RAW)) { - xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, - "attributes construct error\n"); - } - SKIP_BLANKS; - if ((cons == ctxt->input->consumed) && (q == CUR_PTR) && - (attname == NULL) && (attvalue == NULL)) { - xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR, - "xmlParseStartTag: problem parsing attributes\n"); - break; - } - SHRINK; - GROW; - } - - /* - * SAX: Start of Element ! - */ - if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) && - (!ctxt->disableSAX)) { - if (nbatts > 0) - ctxt->sax->startElement(ctxt->userData, name, atts); - else - ctxt->sax->startElement(ctxt->userData, name, NULL); - } - - if (atts != NULL) { - /* Free only the content strings */ - for (i = 1;i < nbatts;i+=2) - if (atts[i] != NULL) - xmlFree((xmlChar *) atts[i]); - } - return(name); -} - -/** - * xmlParseEndTag1: - * @ctxt: an XML parser context - * @line: line of the start tag - * @nsNr: number of namespaces on the start tag - * - * parse an end of tag - * - * [42] ETag ::= '' - * - * With namespace - * - * [NS 9] ETag ::= '' - */ - -static void -xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) { - const xmlChar *name; - - GROW; - if ((RAW != '<') || (NXT(1) != '/')) { - xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED, - "xmlParseEndTag: 'name); - - /* - * We should definitely be at the ending "S? '>'" part - */ - GROW; - SKIP_BLANKS; - if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) { - xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL); - } else - NEXT1; - - /* - * [ WFC: Element Type Match ] - * The Name in an element's end-tag must match the element type in the - * start-tag. - * - */ - if (name != (xmlChar*)1) { - if (name == NULL) name = BAD_CAST "unparseable"; - xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH, - "Opening and ending tag mismatch: %s line %d and %s\n", - ctxt->name, line, name); - } - - /* - * SAX: End of Tag - */ - if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) && - (!ctxt->disableSAX)) - ctxt->sax->endElement(ctxt->userData, ctxt->name); - - namePop(ctxt); - spacePop(ctxt); - return; -} - -/** - * xmlParseEndTag: - * @ctxt: an XML parser context - * - * parse an end of tag - * - * [42] ETag ::= '' - * - * With namespace - * - * [NS 9] ETag ::= '' - */ - -void -xmlParseEndTag(xmlParserCtxtPtr ctxt) { - xmlParseEndTag1(ctxt, 0); -} -#endif /* LIBXML_SAX1_ENABLED */ - /************************************************************************ * * * SAX 2 specific operations * @@ -9468,14 +9103,7 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { spacePush(ctxt, *ctxt->space); line = ctxt->input->line; -#ifdef LIBXML_SAX1_ENABLED - if (ctxt->sax2) -#endif /* LIBXML_SAX1_ENABLED */ name = xmlParseStartTag2(ctxt, &prefix, &URI, &tlen); -#ifdef LIBXML_SAX1_ENABLED - else - name = xmlParseStartTag(ctxt); -#endif /* LIBXML_SAX1_ENABLED */ if (ctxt->instate == XML_PARSER_EOF) return; if (name == NULL) { @@ -9505,12 +9133,6 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) && (!ctxt->disableSAX)) ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI); -#ifdef LIBXML_SAX1_ENABLED - } else { - if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) && - (!ctxt->disableSAX)) - ctxt->sax->endElement(ctxt->userData, name); -#endif /* LIBXML_SAX1_ENABLED */ } namePop(ctxt); spacePop(ctxt); @@ -9581,10 +9203,6 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { xmlParseEndTag2(ctxt, prefix, URI, line, ctxt->nsNr - nsNr, tlen); namePop(ctxt); } -#ifdef LIBXML_SAX1_ENABLED - else - xmlParseEndTag1(ctxt, line); -#endif /* LIBXML_SAX1_ENABLED */ /* * Capture end position and add node @@ -10856,14 +10474,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { spacePush(ctxt, -1); else spacePush(ctxt, *ctxt->space); -#ifdef LIBXML_SAX1_ENABLED - if (ctxt->sax2) -#endif /* LIBXML_SAX1_ENABLED */ name = xmlParseStartTag2(ctxt, &prefix, &URI, &tlen); -#ifdef LIBXML_SAX1_ENABLED - else - name = xmlParseStartTag(ctxt); -#endif /* LIBXML_SAX1_ENABLED */ if (ctxt->instate == XML_PARSER_EOF) goto done; if (name == NULL) { @@ -10898,13 +10509,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { prefix, URI); if (ctxt->nsNr - nsNr > 0) nsPop(ctxt, ctxt->nsNr - nsNr); -#ifdef LIBXML_SAX1_ENABLED - } else { - if ((ctxt->sax != NULL) && - (ctxt->sax->endElement != NULL) && - (!ctxt->disableSAX)) - ctxt->sax->endElement(ctxt->userData, name); -#endif /* LIBXML_SAX1_ENABLED */ } spacePop(ctxt); if (ctxt->nameNr == 0) { @@ -10925,10 +10529,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { } if (ctxt->sax2) nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr); -#ifdef LIBXML_SAX1_ENABLED - else - namePush(ctxt, name); -#endif /* LIBXML_SAX1_ENABLED */ ctxt->instate = XML_PARSER_CONTENT; break; @@ -11048,10 +10648,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { (int) (long) ctxt->pushTab[ctxt->nameNr * 3 - 1], 0); nameNsPop(ctxt); } -#ifdef LIBXML_SAX1_ENABLED - else - xmlParseEndTag1(ctxt, 0); -#endif /* LIBXML_SAX1_ENABLED */ if (ctxt->instate == XML_PARSER_EOF) { /* Nothing */ } else if (ctxt->nameNr == 0) { @@ -11739,9 +11335,6 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data, return(NULL); } if (sax != NULL) { -#ifdef LIBXML_SAX1_ENABLED - if (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler) -#endif /* LIBXML_SAX1_ENABLED */ xmlFree(ctxt->sax); ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler)); if (ctxt->sax == NULL) { @@ -11871,9 +11464,6 @@ xmlCreateIOParserCtxt(xmlSAXHandlerPtr sax, void *user_data, return(NULL); } if (sax != NULL) { -#ifdef LIBXML_SAX1_ENABLED - if (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler) -#endif /* LIBXML_SAX1_ENABLED */ xmlFree(ctxt->sax); ctxt->sax = (xmlSAXHandlerPtr) xmlMalloc(sizeof(xmlSAXHandler)); if (ctxt->sax == NULL) { @@ -12588,62 +12178,6 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt, return(ret); } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlParseExternalEntity: - * @doc: the document the chunk pertains to - * @sax: the SAX handler bloc (possibly NULL) - * @user_data: The user data returned on SAX callbacks (possibly NULL) - * @depth: Used for loop detection, use 0 - * @URL: the URL for the entity to load - * @ID: the System ID for the entity to load - * @lst: the return value for the set of parsed nodes - * - * Parse an external general entity - * An external general parsed entity is well-formed if it matches the - * production labeled extParsedEnt. - * - * [78] extParsedEnt ::= TextDecl? content - * - * Returns 0 if the entity is well formed, -1 in case of args problem and - * the parser error code otherwise - */ - -int -xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data, - int depth, const xmlChar *URL, const xmlChar *ID, xmlNodePtr *lst) { - return(xmlParseExternalEntityPrivate(doc, NULL, sax, user_data, depth, URL, - ID, lst)); -} - -/** - * xmlParseBalancedChunkMemory: - * @doc: the document the chunk pertains to - * @sax: the SAX handler bloc (possibly NULL) - * @user_data: The user data returned on SAX callbacks (possibly NULL) - * @depth: Used for loop detection, use 0 - * @string: the input string in UTF8 or ISO-Latin (zero terminated) - * @lst: the return value for the set of parsed nodes - * - * Parse a well-balanced chunk of an XML document - * called by the parser - * The allowed sequence for the Well Balanced Chunk is the one defined by - * the content production in the XML grammar: - * - * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* - * - * Returns 0 if the chunk is well balanced, -1 in case of args problem and - * the parser error code otherwise - */ - -int -xmlParseBalancedChunkMemory(xmlDocPtr doc, xmlSAXHandlerPtr sax, - void *user_data, int depth, const xmlChar *string, xmlNodePtr *lst) { - return xmlParseBalancedChunkMemoryRecover( doc, sax, user_data, - depth, string, lst, 0 ); -} -#endif /* LIBXML_SAX1_ENABLED */ - /** * xmlParseBalancedChunkMemoryInternal: * @oldctxt: the existing parsing context @@ -13049,238 +12583,6 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, #endif } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlParseBalancedChunkMemoryRecover: - * @doc: the document the chunk pertains to - * @sax: the SAX handler bloc (possibly NULL) - * @user_data: The user data returned on SAX callbacks (possibly NULL) - * @depth: Used for loop detection, use 0 - * @string: the input string in UTF8 or ISO-Latin (zero terminated) - * @lst: the return value for the set of parsed nodes - * @recover: return nodes even if the data is broken (use 0) - * - * - * Parse a well-balanced chunk of an XML document - * called by the parser - * The allowed sequence for the Well Balanced Chunk is the one defined by - * the content production in the XML grammar: - * - * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* - * - * Returns 0 if the chunk is well balanced, -1 in case of args problem and - * the parser error code otherwise - * - * In case recover is set to 1, the nodelist will not be empty even if - * the parsed chunk is not well balanced, assuming the parsing succeeded to - * some extent. - */ -int -xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, - void *user_data, int depth, const xmlChar *string, xmlNodePtr *lst, - int recover) { - xmlParserCtxtPtr ctxt; - xmlDocPtr newDoc; - xmlSAXHandlerPtr oldsax = NULL; - xmlNodePtr content, newRoot; - int size; - int ret = 0; - - if (depth > 40) { - return(XML_ERR_ENTITY_LOOP); - } - - - if (lst != NULL) - *lst = NULL; - if (string == NULL) - return(-1); - - size = xmlStrlen(string); - - ctxt = xmlCreateMemoryParserCtxt((char *) string, size); - if (ctxt == NULL) return(-1); - ctxt->userData = ctxt; - if (sax != NULL) { - oldsax = ctxt->sax; - ctxt->sax = sax; - if (user_data != NULL) - ctxt->userData = user_data; - } - newDoc = xmlNewDoc(BAD_CAST "1.0"); - if (newDoc == NULL) { - xmlFreeParserCtxt(ctxt); - return(-1); - } - newDoc->properties = XML_DOC_INTERNAL; - if ((doc != NULL) && (doc->dict != NULL)) { - xmlDictFree(ctxt->dict); - ctxt->dict = doc->dict; - xmlDictReference(ctxt->dict); - ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3); - ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5); - ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36); - ctxt->dictNames = 1; - } else { - xmlCtxtUseOptionsInternal(ctxt, XML_PARSE_NODICT, NULL); - } - if (doc != NULL) { - newDoc->intSubset = doc->intSubset; - newDoc->extSubset = doc->extSubset; - } - newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL); - if (newRoot == NULL) { - if (sax != NULL) - ctxt->sax = oldsax; - xmlFreeParserCtxt(ctxt); - newDoc->intSubset = NULL; - newDoc->extSubset = NULL; - xmlFreeDoc(newDoc); - return(-1); - } - xmlAddChild((xmlNodePtr) newDoc, newRoot); - nodePush(ctxt, newRoot); - if (doc == NULL) { - ctxt->myDoc = newDoc; - } else { - ctxt->myDoc = newDoc; - newDoc->children->doc = doc; - /* Ensure that doc has XML spec namespace */ - xmlSearchNsByHref(doc, (xmlNodePtr)doc, XML_XML_NAMESPACE); - newDoc->oldNs = doc->oldNs; - } - ctxt->instate = XML_PARSER_CONTENT; - ctxt->depth = depth; - - /* - * Doing validity checking on chunk doesn't make sense - */ - ctxt->validate = 0; - ctxt->loadsubset = 0; - xmlDetectSAX2(ctxt); - - if ( doc != NULL ){ - content = doc->children; - doc->children = NULL; - xmlParseContent(ctxt); - doc->children = content; - } - else { - xmlParseContent(ctxt); - } - if ((RAW == '<') && (NXT(1) == '/')) { - xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); - } else if (RAW != 0) { - xmlFatalErr(ctxt, XML_ERR_EXTRA_CONTENT, NULL); - } - if (ctxt->node != newDoc->children) { - xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); - } - - if (!ctxt->wellFormed) { - if (ctxt->errNo == 0) - ret = 1; - else - ret = ctxt->errNo; - } else { - ret = 0; - } - - if ((lst != NULL) && ((ret == 0) || (recover == 1))) { - xmlNodePtr cur; - - /* - * Return the newly created nodeset after unlinking it from - * they pseudo parent. - */ - cur = newDoc->children->children; - *lst = cur; - while (cur != NULL) { - xmlSetTreeDoc(cur, doc); - cur->parent = NULL; - cur = cur->next; - } - newDoc->children->children = NULL; - } - - if (sax != NULL) - ctxt->sax = oldsax; - xmlFreeParserCtxt(ctxt); - newDoc->intSubset = NULL; - newDoc->extSubset = NULL; - newDoc->oldNs = NULL; - xmlFreeDoc(newDoc); - - return(ret); -} - -/** - * xmlSAXParseEntity: - * @sax: the SAX handler block - * @filename: the filename - * - * parse an XML external entity out of context and build a tree. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * [78] extParsedEnt ::= TextDecl? content - * - * This correspond to a "Well Balanced" chunk - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlSAXParseEntity(xmlSAXHandlerPtr sax, const char *filename) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt; - - ctxt = xmlCreateFileParserCtxt(filename); - if (ctxt == NULL) { - return(NULL); - } - if (sax != NULL) { - if (ctxt->sax != NULL) - xmlFree(ctxt->sax); - ctxt->sax = sax; - ctxt->userData = NULL; - } - - xmlParseExtParsedEnt(ctxt); - - if (ctxt->wellFormed) - ret = ctxt->myDoc; - else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - if (sax != NULL) - ctxt->sax = NULL; - xmlFreeParserCtxt(ctxt); - - return(ret); -} - -/** - * xmlParseEntity: - * @filename: the filename - * - * parse an XML external entity out of context and build a tree. - * - * [78] extParsedEnt ::= TextDecl? content - * - * This correspond to a "Well Balanced" chunk - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlParseEntity(const char *filename) { - return(xmlSAXParseEntity(NULL, filename)); -} -#endif /* LIBXML_SAX1_ENABLED */ - /** * xmlCreateEntityParserCtxtInternal: * @URL: the entity URL @@ -13430,231 +12732,6 @@ xmlCreateFileParserCtxt(const char *filename) return(xmlCreateURLParserCtxt(filename, 0)); } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlSAXParseFileWithData: - * @sax: the SAX handler block - * @filename: the filename - * @recovery: work in recovery mode, i.e. tries to read no Well Formed - * documents - * @data: the userdata - * - * parse an XML file and build a tree. Automatic support for ZLIB/Compress - * compressed document is provided by default if found at compile-time. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * User data (void *) is stored within the parser context in the - * context's _private member, so it is available nearly everywhere in libxml - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename, - int recovery, void *data) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt; - - xmlInitParser(); - - ctxt = xmlCreateFileParserCtxt(filename); - if (ctxt == NULL) { - return(NULL); - } - if (sax != NULL) { - if (ctxt->sax != NULL) - xmlFree(ctxt->sax); - ctxt->sax = sax; - } - xmlDetectSAX2(ctxt); - if (data!=NULL) { - ctxt->_private = data; - } - - if (ctxt->directory == NULL) - ctxt->directory = xmlParserGetDirectory(filename); - - ctxt->recovery = recovery; - - xmlParseDocument(ctxt); - - if ((ctxt->wellFormed) || recovery) { - ret = ctxt->myDoc; - if (ret != NULL) { - if (ctxt->input->buf->compressed > 0) - ret->compression = 9; - else - ret->compression = ctxt->input->buf->compressed; - } - } - else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - if (sax != NULL) - ctxt->sax = NULL; - xmlFreeParserCtxt(ctxt); - - return(ret); -} - -/** - * xmlSAXParseFile: - * @sax: the SAX handler block - * @filename: the filename - * @recovery: work in recovery mode, i.e. tries to read no Well Formed - * documents - * - * parse an XML file and build a tree. Automatic support for ZLIB/Compress - * compressed document is provided by default if found at compile-time. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlSAXParseFile(xmlSAXHandlerPtr sax, const char *filename, - int recovery) { - return(xmlSAXParseFileWithData(sax,filename,recovery,NULL)); -} - -/** - * xmlRecoverDoc: - * @cur: a pointer to an array of xmlChar - * - * parse an XML in-memory document and build a tree. - * In the case the document is not Well Formed, a attempt to build a - * tree is tried anyway - * - * Returns the resulting document tree or NULL in case of failure - */ - -xmlDocPtr -xmlRecoverDoc(const xmlChar *cur) { - return(xmlSAXParseDoc(NULL, cur, 1)); -} - -/** - * xmlParseFile: - * @filename: the filename - * - * parse an XML file and build a tree. Automatic support for ZLIB/Compress - * compressed document is provided by default if found at compile-time. - * - * Returns the resulting document tree if the file was wellformed, - * NULL otherwise. - */ - -xmlDocPtr -xmlParseFile(const char *filename) { - return(xmlSAXParseFile(NULL, filename, 0)); -} - -/** - * xmlRecoverFile: - * @filename: the filename - * - * parse an XML file and build a tree. Automatic support for ZLIB/Compress - * compressed document is provided by default if found at compile-time. - * In the case the document is not Well Formed, it attempts to build - * a tree anyway - * - * Returns the resulting document tree or NULL in case of failure - */ - -xmlDocPtr -xmlRecoverFile(const char *filename) { - return(xmlSAXParseFile(NULL, filename, 1)); -} - - -/** - * xmlSetupParserForBuffer: - * @ctxt: an XML parser context - * @buffer: a xmlChar * buffer - * @filename: a file name - * - * Setup the parser context to parse a new buffer; Clears any prior - * contents from the parser context. The buffer parameter must not be - * NULL, but the filename parameter can be - */ -void -xmlSetupParserForBuffer(xmlParserCtxtPtr ctxt, const xmlChar* buffer, - const char* filename) -{ - xmlParserInputPtr input; - - if ((ctxt == NULL) || (buffer == NULL)) - return; - - input = xmlNewInputStream(ctxt); - if (input == NULL) { - xmlErrMemory(NULL, "parsing new buffer: out of memory\n"); - xmlClearParserCtxt(ctxt); - return; - } - - xmlClearParserCtxt(ctxt); - if (filename != NULL) - input->filename = (char *) xmlCanonicPath((const xmlChar *)filename); - input->base = buffer; - input->cur = buffer; - input->end = &buffer[xmlStrlen(buffer)]; - inputPush(ctxt, input); -} - -/** - * xmlSAXUserParseFile: - * @sax: a SAX handler - * @user_data: The user data returned on SAX callbacks - * @filename: a file name - * - * parse an XML file and call the given SAX handler routines. - * Automatic support for ZLIB/Compress compressed document is provided - * - * Returns 0 in case of success or a error number otherwise - */ -int -xmlSAXUserParseFile(xmlSAXHandlerPtr sax, void *user_data, - const char *filename) { - int ret = 0; - xmlParserCtxtPtr ctxt; - - ctxt = xmlCreateFileParserCtxt(filename); - if (ctxt == NULL) return -1; - if (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler) - xmlFree(ctxt->sax); - ctxt->sax = sax; - xmlDetectSAX2(ctxt); - - if (user_data != NULL) - ctxt->userData = user_data; - - xmlParseDocument(ctxt); - - if (ctxt->wellFormed) - ret = 0; - else { - if (ctxt->errNo != 0) - ret = ctxt->errNo; - else - ret = -1; - } - if (sax != NULL) - ctxt->sax = NULL; - if (ctxt->myDoc != NULL) { - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - xmlFreeParserCtxt(ctxt); - - return ret; -} -#endif /* LIBXML_SAX1_ENABLED */ - /************************************************************************ * * * Front ends when parsing from memory * @@ -13709,164 +12786,6 @@ xmlCreateMemoryParserCtxt(const char *buffer, int size) { return(ctxt); } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlSAXParseMemoryWithData: - * @sax: the SAX handler block - * @buffer: an pointer to a char array - * @size: the size of the array - * @recovery: work in recovery mode, i.e. tries to read no Well Formed - * documents - * @data: the userdata - * - * parse an XML in-memory block and use the given SAX function block - * to handle the parsing callback. If sax is NULL, fallback to the default - * DOM tree building routines. - * - * User data (void *) is stored within the parser context in the - * context's _private member, so it is available nearly everywhere in libxml - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlSAXParseMemoryWithData(xmlSAXHandlerPtr sax, const char *buffer, - int size, int recovery, void *data) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt; - - xmlInitParser(); - - ctxt = xmlCreateMemoryParserCtxt(buffer, size); - if (ctxt == NULL) return(NULL); - if (sax != NULL) { - if (ctxt->sax != NULL) - xmlFree(ctxt->sax); - ctxt->sax = sax; - } - xmlDetectSAX2(ctxt); - if (data!=NULL) { - ctxt->_private=data; - } - - ctxt->recovery = recovery; - - xmlParseDocument(ctxt); - - if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc; - else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - if (sax != NULL) - ctxt->sax = NULL; - xmlFreeParserCtxt(ctxt); - - return(ret); -} - -/** - * xmlSAXParseMemory: - * @sax: the SAX handler block - * @buffer: an pointer to a char array - * @size: the size of the array - * @recovery: work in recovery mode, i.e. tries to read not Well Formed - * documents - * - * parse an XML in-memory block and use the given SAX function block - * to handle the parsing callback. If sax is NULL, fallback to the default - * DOM tree building routines. - * - * Returns the resulting document tree - */ -xmlDocPtr -xmlSAXParseMemory(xmlSAXHandlerPtr sax, const char *buffer, - int size, int recovery) { - return xmlSAXParseMemoryWithData(sax, buffer, size, recovery, NULL); -} - -/** - * xmlParseMemory: - * @buffer: an pointer to a char array - * @size: the size of the array - * - * parse an XML in-memory block and build a tree. - * - * Returns the resulting document tree - */ - -xmlDocPtr xmlParseMemory(const char *buffer, int size) { - return(xmlSAXParseMemory(NULL, buffer, size, 0)); -} - -/** - * xmlRecoverMemory: - * @buffer: an pointer to a char array - * @size: the size of the array - * - * parse an XML in-memory block and build a tree. - * In the case the document is not Well Formed, an attempt to - * build a tree is tried anyway - * - * Returns the resulting document tree or NULL in case of error - */ - -xmlDocPtr xmlRecoverMemory(const char *buffer, int size) { - return(xmlSAXParseMemory(NULL, buffer, size, 1)); -} - -/** - * xmlSAXUserParseMemory: - * @sax: a SAX handler - * @user_data: The user data returned on SAX callbacks - * @buffer: an in-memory XML document input - * @size: the length of the XML document in bytes - * - * A better SAX parsing routine. - * parse an XML in-memory buffer and call the given SAX handler routines. - * - * Returns 0 in case of success or a error number otherwise - */ -int xmlSAXUserParseMemory(xmlSAXHandlerPtr sax, void *user_data, - const char *buffer, int size) { - int ret = 0; - xmlParserCtxtPtr ctxt; - - xmlInitParser(); - - ctxt = xmlCreateMemoryParserCtxt(buffer, size); - if (ctxt == NULL) return -1; - if (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler) - xmlFree(ctxt->sax); - ctxt->sax = sax; - xmlDetectSAX2(ctxt); - - if (user_data != NULL) - ctxt->userData = user_data; - - xmlParseDocument(ctxt); - - if (ctxt->wellFormed) - ret = 0; - else { - if (ctxt->errNo != 0) - ret = ctxt->errNo; - else - ret = -1; - } - if (sax != NULL) - ctxt->sax = NULL; - if (ctxt->myDoc != NULL) { - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - xmlFreeParserCtxt(ctxt); - - return ret; -} -#endif /* LIBXML_SAX1_ENABLED */ - /** * xmlCreateDocParserCtxt: * @cur: a pointer to an array of xmlChar @@ -13885,109 +12804,6 @@ xmlCreateDocParserCtxt(const xmlChar *cur) { return(xmlCreateMemoryParserCtxt((const char *)cur, len)); } -#ifdef LIBXML_SAX1_ENABLED -/** - * xmlSAXParseDoc: - * @sax: the SAX handler block - * @cur: a pointer to an array of xmlChar - * @recovery: work in recovery mode, i.e. tries to read no Well Formed - * documents - * - * parse an XML in-memory document and build a tree. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlSAXParseDoc(xmlSAXHandlerPtr sax, const xmlChar *cur, int recovery) { - xmlDocPtr ret; - xmlParserCtxtPtr ctxt; - xmlSAXHandlerPtr oldsax = NULL; - - if (cur == NULL) return(NULL); - - - ctxt = xmlCreateDocParserCtxt(cur); - if (ctxt == NULL) return(NULL); - if (sax != NULL) { - oldsax = ctxt->sax; - ctxt->sax = sax; - ctxt->userData = NULL; - } - xmlDetectSAX2(ctxt); - - xmlParseDocument(ctxt); - if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc; - else { - ret = NULL; - xmlFreeDoc(ctxt->myDoc); - ctxt->myDoc = NULL; - } - if (sax != NULL) - ctxt->sax = oldsax; - xmlFreeParserCtxt(ctxt); - - return(ret); -} - -/** - * xmlParseDoc: - * @cur: a pointer to an array of xmlChar - * - * parse an XML in-memory document and build a tree. - * - * Returns the resulting document tree - */ - -xmlDocPtr -xmlParseDoc(const xmlChar *cur) { - return(xmlSAXParseDoc(NULL, cur, 0)); -} -#endif /* LIBXML_SAX1_ENABLED */ - -#ifdef LIBXML_LEGACY_ENABLED -/************************************************************************ - * * - * Specific function to keep track of entities references * - * and used by the XSLT debugger * - * * - ************************************************************************/ - -static xmlEntityReferenceFunc xmlEntityRefFunc = NULL; - -/** - * xmlAddEntityReference: - * @ent : A valid entity - * @firstNode : A valid first node for children of entity - * @lastNode : A valid last node of children entity - * - * Notify of a reference to an entity of type XML_EXTERNAL_GENERAL_PARSED_ENTITY - */ -static void -xmlAddEntityReference(xmlEntityPtr ent, xmlNodePtr firstNode, - xmlNodePtr lastNode) -{ - if (xmlEntityRefFunc != NULL) { - (*xmlEntityRefFunc) (ent, firstNode, lastNode); - } -} - - -/** - * xmlSetEntityReferenceFunc: - * @func: A valid function - * - * Set the function to call call back when a xml reference has been made - */ -void -xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func) -{ - xmlEntityRefFunc = func; -} -#endif /* LIBXML_LEGACY_ENABLED */ - /************************************************************************ * * * Miscellaneous * @@ -14373,17 +13189,6 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi ctxt->sax->fatalError = NULL; options -= XML_PARSE_NOERROR; } -#ifdef LIBXML_SAX1_ENABLED - if (options & XML_PARSE_SAX1) { - ctxt->sax->startElement = xmlSAX2StartElement; - ctxt->sax->endElement = xmlSAX2EndElement; - ctxt->sax->startElementNs = NULL; - ctxt->sax->endElementNs = NULL; - ctxt->sax->initialized = 1; - options -= XML_PARSE_SAX1; - ctxt->options |= XML_PARSE_SAX1; - } -#endif /* LIBXML_SAX1_ENABLED */ if (options & XML_PARSE_NODICT) { ctxt->dictNames = 0; options -= XML_PARSE_NODICT; diff --git a/android/native/libxml2/parserInternals.c b/android/native/libxml2/parserInternals.c index a3b2a52e1b..c8d1e2b949 100644 --- a/android/native/libxml2/parserInternals.c +++ b/android/native/libxml2/parserInternals.c @@ -1785,13 +1785,8 @@ xmlFreeParserCtxt(xmlParserCtxtPtr ctxt) if (ctxt->encoding != NULL) xmlFree((char *) ctxt->encoding); if (ctxt->extSubURI != NULL) xmlFree((char *) ctxt->extSubURI); if (ctxt->extSubSystem != NULL) xmlFree((char *) ctxt->extSubSystem); -#ifdef LIBXML_SAX1_ENABLED - if ((ctxt->sax != NULL) && - (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler)) -#else if (ctxt->sax != NULL) -#endif /* LIBXML_SAX1_ENABLED */ - xmlFree(ctxt->sax); + xmlFree(ctxt->sax); if (ctxt->directory != NULL) xmlFree((char *) ctxt->directory); if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab); if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts); diff --git a/android/native/libxml2/tree.c b/android/native/libxml2/tree.c index 2f76f8c8e1..0649e7ec14 100644 --- a/android/native/libxml2/tree.c +++ b/android/native/libxml2/tree.c @@ -343,7 +343,7 @@ xmlSplitQName3(const xmlChar *name, int *len) { #define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l) -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) /** * xmlValidateNCName: * @value: the value to check diff --git a/android/native/libxml2/xmllint.c b/android/native/libxml2/xmllint.c index 9664627c42..6516ba6265 100644 --- a/android/native/libxml2/xmllint.c +++ b/android/native/libxml2/xmllint.c @@ -154,9 +154,6 @@ static int walker = 0; #endif /* LIBXML_READER_ENABLED */ static int chkregister = 0; static int nbregister = 0; -#ifdef LIBXML_SAX1_ENABLED -static int sax1 = 0; -#endif /* LIBXML_SAX1_ENABLED */ static int options = XML_PARSE_COMPACT; static int sax = 0; static int oldxml10 = 0; @@ -1546,10 +1543,6 @@ testSAX(const char *filename) { if (noout) { handler = emptySAXHandler; -#ifdef LIBXML_SAX1_ENABLED - } else if (sax1) { - handler = debugSAXHandler; -#endif } else { handler = debugSAX2Handler; } @@ -1913,11 +1906,6 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { if (rectxt != NULL) doc = xmlCtxtReadFile(rectxt, filename, NULL, options); else { -#ifdef LIBXML_SAX1_ENABLED - if (sax1) - doc = xmlParseFile(filename); - else -#endif /* LIBXML_SAX1_ENABLED */ doc = xmlReadFile(filename, NULL, options); } } @@ -2381,9 +2369,6 @@ static void usage(const char *name) { printf("\t--walker : create a reader and walk though the resulting doc\n"); #endif /* LIBXML_READER_ENABLED */ printf("\t--chkregister : verify the node registration code\n"); -#ifdef LIBXML_SAX1_ENABLED - printf("\t--sax1: use the old SAX1 interfaces for processing\n"); -#endif printf("\t--sax: do not build a tree but work just at the SAX level\n"); printf("\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n"); @@ -2635,13 +2620,6 @@ main(int argc, char **argv) { noout++; } #endif /* LIBXML_READER_ENABLED */ -#ifdef LIBXML_SAX1_ENABLED - else if ((!strcmp(argv[i], "-sax1")) || - (!strcmp(argv[i], "--sax1"))) { - sax1++; - options |= XML_PARSE_SAX1; - } -#endif /* LIBXML_SAX1_ENABLED */ else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax"))) { sax++; @@ -2675,12 +2653,6 @@ main(int argc, char **argv) { } -#ifdef LIBXML_SAX1_ENABLED - if (sax1) - xmlSAXDefaultVersion(1); - else - xmlSAXDefaultVersion(2); -#endif /* LIBXML_SAX1_ENABLED */ if (chkregister) { xmlRegisterNodeDefault(registerNode); diff --git a/android/native/libxml2/xmlreader.c b/android/native/libxml2/xmlreader.c index 9f0a713da3..989cd73802 100644 --- a/android/native/libxml2/xmlreader.c +++ b/android/native/libxml2/xmlreader.c @@ -1916,19 +1916,10 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) { ret->sax->startElement = xmlTextReaderStartElement; ret->endElement = ret->sax->endElement; ret->sax->endElement = xmlTextReaderEndElement; -#ifdef LIBXML_SAX1_ENABLED - if (ret->sax->initialized == XML_SAX2_MAGIC) { -#endif /* LIBXML_SAX1_ENABLED */ ret->startElementNs = ret->sax->startElementNs; ret->sax->startElementNs = xmlTextReaderStartElementNs; ret->endElementNs = ret->sax->endElementNs; ret->sax->endElementNs = xmlTextReaderEndElementNs; -#ifdef LIBXML_SAX1_ENABLED - } else { - ret->startElementNs = NULL; - ret->endElementNs = NULL; - } -#endif /* LIBXML_SAX1_ENABLED */ ret->characters = ret->sax->characters; ret->sax->characters = xmlTextReaderCharacters; ret->sax->ignorableWhitespace = xmlTextReaderCharacters; @@ -4198,19 +4189,10 @@ xmlTextReaderSetup(xmlTextReaderPtr reader, reader->sax->startElement = xmlTextReaderStartElement; reader->endElement = reader->sax->endElement; reader->sax->endElement = xmlTextReaderEndElement; -#ifdef LIBXML_SAX1_ENABLED - if (reader->sax->initialized == XML_SAX2_MAGIC) { -#endif /* LIBXML_SAX1_ENABLED */ - reader->startElementNs = reader->sax->startElementNs; - reader->sax->startElementNs = xmlTextReaderStartElementNs; - reader->endElementNs = reader->sax->endElementNs; - reader->sax->endElementNs = xmlTextReaderEndElementNs; -#ifdef LIBXML_SAX1_ENABLED - } else { - reader->startElementNs = NULL; - reader->endElementNs = NULL; - } -#endif /* LIBXML_SAX1_ENABLED */ + reader->startElementNs = reader->sax->startElementNs; + reader->sax->startElementNs = xmlTextReaderStartElementNs; + reader->endElementNs = reader->sax->endElementNs; + reader->sax->endElementNs = xmlTextReaderEndElementNs; reader->characters = reader->sax->characters; reader->sax->characters = xmlTextReaderCharacters; reader->sax->ignorableWhitespace = xmlTextReaderCharacters;