diff --git a/HTMLparser.c b/HTMLparser.c index ac14301d..801712bc 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -40,8 +40,6 @@ static int htmlOmittedDefaultValue = 1; -xmlChar * htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, - xmlChar end, xmlChar end2, xmlChar end3); static void htmlParseComment(htmlParserCtxtPtr ctxt); /************************************************************************ diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml index 1a7631c9..65a3bd06 100644 --- a/doc/libxml2-api.xml +++ b/doc/libxml2-api.xml @@ -117,42 +117,6 @@ DEPRECATED set of SAX version 1 interfaces used to build the DOM tree. Daniel Veillard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SAX2 parser interface used to build the DOM tree @@ -423,12 +387,10 @@ - - @@ -437,7 +399,6 @@ - @@ -730,8 +691,6 @@ - - @@ -783,7 +742,6 @@ - @@ -853,10 +811,7 @@ - - - @@ -864,9 +819,6 @@ - - - @@ -901,7 +853,6 @@ - @@ -909,7 +860,6 @@ - @@ -919,12 +869,9 @@ - - - @@ -1574,7 +1521,6 @@ - @@ -6796,26 +6742,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element. DEPRECATED: use xmlSAX2Attribute() - - - - - - - defined(LIBXML_LEGACY_ENABLED) - An attribute definition has been parsed DEPRECATED: use xmlSAX2AttributeDecl() - - - - - - - - - An attribute definition has been parsed. @@ -6834,14 +6760,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - called when a pcdata block has been parsed DEPRECATED: use xmlSAX2CDataBlock() - - - - - Called when a pcdata block has been parsed. @@ -6849,14 +6767,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - receiving some chars from the parser. DEPRECATED: use xmlSAX2Characters() - - - - - Receiving some chars from the parser. @@ -6864,35 +6774,12 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Check that the current element namespace is the same as the one read upon parsing. DEPRECATED - - - - - - defined(LIBXML_LEGACY_ENABLED) - A comment has been parsed. DEPRECATED: use xmlSAX2Comment() - - - - A comment has been parsed. - - defined(LIBXML_LEGACY_ENABLED) - An element definition has been parsed DEPRECATED: use xmlSAX2ElementDecl() - - - - - - An element definition has been parsed. @@ -6901,24 +6788,11 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - called when the document end has been detected. DEPRECATED: use xmlSAX2EndDocument() - - - Called when the document end has been detected. - - defined(LIBXML_LEGACY_ENABLED) - called when the end of an element has been detected. DEPRECATED: use xmlSAX2EndElement() - - - - SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element. @@ -6933,17 +6807,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - An entity definition has been parsed DEPRECATED: use xmlSAX2EntityDecl() - - - - - - - - An entity definition has been parsed. @@ -6961,15 +6824,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Callback on external subset declaration. DEPRECATED: use xmlSAX2ExternalSubset() - - - - - - Callback on external subset declaration. @@ -6985,87 +6839,23 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Provide the column number of the current parsing point. DEPRECATED: use xmlSAX2GetColumnNumber() - - - - - defined(LIBXML_LEGACY_ENABLED) - Get an entity by name DEPRECATED: use xmlSAX2GetEntity() - - - - Get an entity by name. - - defined(LIBXML_LEGACY_ENABLED) - Provide the line number of the current parsing point. DEPRECATED: use xmlSAX2GetLineNumber() - - - - - defined(LIBXML_LEGACY_ENABLED) - Get the current element namespace. DEPRECATED - - - - - defined(LIBXML_LEGACY_ENABLED) - Get a parameter entity by name DEPRECATED: use xmlSAX2GetParameterEntity() - - - - Get a parameter entity by name. - - defined(LIBXML_LEGACY_ENABLED) - Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN" DEPRECATED: use xmlSAX2GetPublicId() - - - - - defined(LIBXML_LEGACY_ENABLED) - Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd DEPRECATED: use xmlSAX2GetSystemId() - - - - - defined(LIBXML_LEGACY_ENABLED) - An old global namespace has been parsed. DEPRECATED - - - - - - - defined(LIBXML_LEGACY_ENABLED) - Does this document has an external subset DEPRECATED: use xmlSAX2HasExternalSubset() - - - Does this document has an external subset? - - defined(LIBXML_LEGACY_ENABLED) - Does this document has an internal subset DEPRECATED: use xmlSAX2HasInternalSubset() - - - Does this document has an internal subset. @@ -7536,14 +7326,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters DEPRECATED: use xmlSAX2IgnorableWhitespace() - - - - - Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters. @@ -7556,19 +7338,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Initialize the default HTML SAX version 1 handler DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks - - - - - defined(LIBXML_LEGACY_ENABLED) - Initialize the default XML SAX version 1 handler DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks - - - - Pops the top parser input from the input stack @@ -7580,15 +7349,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Callback on internal subset declaration. DEPRECATED: use xmlSAX2InternalSubset() - - - - - - Callback on internal subset declaration. @@ -7597,12 +7357,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Is this document tagged standalone ? DEPRECATED: use xmlSAX2IsStandalone() - - - Is this document tagged standalone? @@ -7627,14 +7381,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - A namespace has been parsed. DEPRECATED - - - - - DEPRECATED: Internal function, do not use. Pops the top element node from the node stack @@ -7646,15 +7392,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - What to do when a notation declaration has been parsed. DEPRECATED: use xmlSAX2NotationDecl() - - - - - - What to do when a notation declaration has been parsed. @@ -7663,14 +7400,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - A processing instruction has been parsed. DEPRECATED: use xmlSAX2ProcessingInstruction() - - - - - A processing instruction has been parsed. @@ -7678,27 +7407,12 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - called when an entity reference is detected. DEPRECATED: use xmlSAX2Reference() - - - - Called when an entity reference is detected. - - defined(LIBXML_LEGACY_ENABLED) - The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine DEPRECATED: use xmlSAX2ResolveEntity() - - - - - Callback: The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine @@ -7706,45 +7420,17 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case. DEPRECATED - - - - Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case. - - defined(LIBXML_LEGACY_ENABLED) - Set the current element namespace. DEPRECATED - - - - - - defined(LIBXML_LEGACY_ENABLED) - called when the document start being processed. DEPRECATED: use xmlSAX2StartDocument() - - - Called when the document start being processed. - - defined(LIBXML_LEGACY_ENABLED) - called when an opening tag has been processed. DEPRECATED: use xmlSAX2StartElement() - - - - - SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element. @@ -7765,16 +7451,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - What to do when an unparsed entity declaration is parsed DEPRECATED: use xmlSAX2UnparsedEntityDecl() - - - - - - - What to do when an unparsed entity declaration is parsed. @@ -8721,11 +8397,6 @@ crash if you try to modify the tree)'/> This function name is somewhat misleading. It does not clean up parser state, it cleans up memory allocated by the library itself. It is a cleanup function for the XML library. It tries to reclaim all related global memory allocated for the library processing. It doesn't deallocate any document related memory. One should call xmlCleanupParser() only when the process has finished using the library and all XML/HTML documents built with it. See also xmlInitParser() which has the opposite function of preparing the library for operations. WARNING: if your application is multithreaded or has plugin support calling this may crash the application if another thread or a plugin is still using libxml2. It's sometimes very hard to guess if libxml2 is in use in the application, some libraries or plugins may use it without notice. In case of doubt abstain from calling this function or do it just before calling exit() to avoid leak reports from valgrind ! - - defined(LIBXML_LEGACY_ENABLED) - Cleanup up the predefined entities table. Deprecated call - - DEPRECATED: This function is a no-op. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don't have call cleanup functions at all. @@ -9171,17 +8842,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - 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 ';' - - - - - - - - DEPRECATED: This function is a no-op. Call xmlInitParser to initialize the library. Initialize the default SAX2 handler @@ -9412,13 +9072,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered. - - - - Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated. @@ -9431,14 +9084,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Callback function used when one needs to be able to track back the provenance of a chunk of nodes inherited from an entity replacement. - - - - - External entity loaders types. @@ -9762,21 +9407,6 @@ crash if you try to modify the tree)'/> DEPRECATED: See xmlSetExternalEntityLoader. Get the default external entity resolver function for the application - - defined(LIBXML_LEGACY_ENABLED) - Read the current value of one feature of this parser instance - - - - - - - defined(LIBXML_LEGACY_ENABLED) - Copy at most *@len feature names into the @result array - - - - DEPRECATED @@ -9870,13 +9500,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point. - - - - Examines if the library has been compiled with a given feature. @@ -10230,11 +9853,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Set up the predefined entities. Deprecated call - - Callback used in the I/O Input API to close the resource @@ -10734,25 +10352,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - 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 - - - - - defined(LIBXML_LEGACY_ENABLED) - 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)? - - - - - defined(LIBXML_LEGACY_ENABLED) - 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 - - - - defined(LIBXML_HTTP_ENABLED) Get the authentication header of an HTTP context @@ -11020,14 +10619,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!! - - - - - Create a new input stream structure encapsulating the @input into a stream suitable for the parser. @@ -11767,12 +11358,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - xmlParseNamespace: parse specific PI '<?namespace ...' constructs. This is what the older xml-name Working Draft specified, a bunch of other stuff may still rely on it, so support is still here as if it was declared on the root of the Tree:-( TODO: remove from library To be removed at next drop of binary compatibility - - - DEPRECATED: Internal function, don't use. parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)* @@ -11808,12 +11393,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Parse and return a string between quotes or doublequotes TODO: Deprecated, to be removed at next drop of binary compatibility - - - DEPRECATED: Internal function, don't use. parse and handle entity references in content, depending on the SAX interface, this may end-up in a call to character() if this is a CharRef, a predefined entity, if there is no reference() callback. or if the parser was asked to switch to that mode. Always consumes '&'. [67] Reference ::= EntityRef | CharRef @@ -11913,12 +11492,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - TODO: Remove, now deprecated ... the test is done directly in the content parsing routines. [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&' Name ';' [ WFC: Entity Declared ] the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot. [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';' A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc - - - Create a buffered parser input for the progressive parsing for the input from a file descriptor The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on. @@ -12763,7 +12336,7 @@ crash if you try to modify the tree)'/> - called when the end of an element has been detected. + called when the end of an element has been detected. Used for HTML and SAX1. @@ -12908,7 +12481,7 @@ crash if you try to modify the tree)'/> - called when an opening tag has been processed. + Called when an opening tag has been processed. Used for HTML and SAX1. @@ -13158,12 +12731,6 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of xmlParserHandleReference [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)* - - - defined(LIBXML_SCHEMAS_ENABLED) Checks and computes the values of facets. @@ -13758,25 +13325,11 @@ crash if you try to modify the tree)'/> - - defined(LIBXML_LEGACY_ENABLED) - Set the function to call call back when a xml reference has been made - - - DEPRECATED: This is a global setting and not thread-safe. Use xmlCtxtSetResourceLoader or similar functions. Changes the default external entity resolver function for the application. - - defined(LIBXML_LEGACY_ENABLED) - Change the current value of one feature of this parser instance - - - - - DEPRECATED: See xmlSetStructuredErrorFunc for alternatives. Set the global "generic" handler and context for error messages. The generic error handler will only receive fragments of error messages which should be concatenated or printed to a stream. If handler is NULL, use the built-in default handler which prints to stderr. Since this is a global setting, it's a good idea to reset the error handler to its default value after collecting the errors you're interested in. For multi-threaded applications, this must be set separately for each thread. diff --git a/include/libxml/SAX.h b/include/libxml/SAX.h index 42e691f6..178005b5 100644 --- a/include/libxml/SAX.h +++ b/include/libxml/SAX.h @@ -8,191 +8,7 @@ * Author: Daniel Veillard */ - #ifndef __XML_SAX_H__ #define __XML_SAX_H__ -#include -#include - -#ifdef LIBXML_LEGACY_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif -XML_DEPRECATED -XMLPUBFUN const xmlChar * - getPublicId (void *ctx); -XML_DEPRECATED -XMLPUBFUN const xmlChar * - getSystemId (void *ctx); -XML_DEPRECATED -XMLPUBFUN void - setDocumentLocator (void *ctx, - xmlSAXLocatorPtr loc); - -XML_DEPRECATED -XMLPUBFUN int - getLineNumber (void *ctx); -XML_DEPRECATED -XMLPUBFUN int - getColumnNumber (void *ctx); - -XML_DEPRECATED -XMLPUBFUN int - isStandalone (void *ctx); -XML_DEPRECATED -XMLPUBFUN int - hasInternalSubset (void *ctx); -XML_DEPRECATED -XMLPUBFUN int - hasExternalSubset (void *ctx); - -XML_DEPRECATED -XMLPUBFUN void - internalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XML_DEPRECATED -XMLPUBFUN void - externalSubset (void *ctx, - const xmlChar *name, - const xmlChar *ExternalID, - const xmlChar *SystemID); -XML_DEPRECATED -XMLPUBFUN xmlEntityPtr - getEntity (void *ctx, - const xmlChar *name); -XML_DEPRECATED -XMLPUBFUN xmlEntityPtr - getParameterEntity (void *ctx, - const xmlChar *name); -XML_DEPRECATED -XMLPUBFUN xmlParserInputPtr - resolveEntity (void *ctx, - const xmlChar *publicId, - const xmlChar *systemId); - -XML_DEPRECATED -XMLPUBFUN void - entityDecl (void *ctx, - const xmlChar *name, - int type, - const xmlChar *publicId, - const xmlChar *systemId, - xmlChar *content); -XML_DEPRECATED -XMLPUBFUN void - attributeDecl (void *ctx, - const xmlChar *elem, - const xmlChar *fullname, - int type, - int def, - const xmlChar *defaultValue, - xmlEnumerationPtr tree); -XML_DEPRECATED -XMLPUBFUN void - elementDecl (void *ctx, - const xmlChar *name, - int type, - xmlElementContentPtr content); -XML_DEPRECATED -XMLPUBFUN void - notationDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId); -XML_DEPRECATED -XMLPUBFUN void - unparsedEntityDecl (void *ctx, - const xmlChar *name, - const xmlChar *publicId, - const xmlChar *systemId, - const xmlChar *notationName); - -XML_DEPRECATED -XMLPUBFUN void - startDocument (void *ctx); -XML_DEPRECATED -XMLPUBFUN void - endDocument (void *ctx); -XML_DEPRECATED -XMLPUBFUN void - attribute (void *ctx, - const xmlChar *fullname, - const xmlChar *value); -XML_DEPRECATED -XMLPUBFUN void - startElement (void *ctx, - const xmlChar *fullname, - const xmlChar **atts); -XML_DEPRECATED -XMLPUBFUN void - endElement (void *ctx, - const xmlChar *name); -XML_DEPRECATED -XMLPUBFUN void - reference (void *ctx, - const xmlChar *name); -XML_DEPRECATED -XMLPUBFUN void - characters (void *ctx, - const xmlChar *ch, - int len); -XML_DEPRECATED -XMLPUBFUN void - ignorableWhitespace (void *ctx, - const xmlChar *ch, - int len); -XML_DEPRECATED -XMLPUBFUN void - processingInstruction (void *ctx, - const xmlChar *target, - const xmlChar *data); -XML_DEPRECATED -XMLPUBFUN void - globalNamespace (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XML_DEPRECATED -XMLPUBFUN void - setNamespace (void *ctx, - const xmlChar *name); -XML_DEPRECATED -XMLPUBFUN xmlNsPtr - getNamespace (void *ctx); -XML_DEPRECATED -XMLPUBFUN int - checkNamespace (void *ctx, - xmlChar *nameSpace); -XML_DEPRECATED -XMLPUBFUN void - namespaceDecl (void *ctx, - const xmlChar *href, - const xmlChar *prefix); -XML_DEPRECATED -XMLPUBFUN void - comment (void *ctx, - const xmlChar *value); -XML_DEPRECATED -XMLPUBFUN void - cdataBlock (void *ctx, - const xmlChar *value, - int len); - -XML_DEPRECATED -XMLPUBFUN void - initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, - int warning); -XML_DEPRECATED -XMLPUBFUN void - inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); - -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_LEGACY_ENABLED */ - #endif /* __XML_SAX_H__ */ diff --git a/include/libxml/entities.h b/include/libxml/entities.h index 2d5e6b97..d17c36be 100644 --- a/include/libxml/entities.h +++ b/include/libxml/entities.h @@ -76,12 +76,6 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr; * External functions: */ -#ifdef LIBXML_LEGACY_ENABLED -XML_DEPRECATED -XMLPUBFUN void - xmlInitializePredefinedEntities (void); -#endif /* LIBXML_LEGACY_ENABLED */ - XMLPUBFUN xmlEntityPtr xmlNewEntity (xmlDocPtr doc, const xmlChar *name, @@ -125,12 +119,6 @@ XMLPUBFUN xmlEntityPtr XMLPUBFUN xmlEntityPtr xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name); -#ifdef LIBXML_LEGACY_ENABLED -XML_DEPRECATED -XMLPUBFUN const xmlChar * - xmlEncodeEntities (xmlDocPtr doc, - const xmlChar *input); -#endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlChar * xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input); @@ -151,11 +139,6 @@ XMLPUBFUN void xmlDumpEntityDecl (xmlBufferPtr buf, xmlEntityPtr ent); #endif /* LIBXML_OUTPUT_ENABLED */ -#ifdef LIBXML_LEGACY_ENABLED -XMLPUBFUN void - xmlCleanupPredefinedEntities(void); -#endif /* LIBXML_LEGACY_ENABLED */ - #ifdef __cplusplus } diff --git a/include/libxml/parser.h b/include/libxml/parser.h index eb6a5fe7..6cf2e0a5 100644 --- a/include/libxml/parser.h +++ b/include/libxml/parser.h @@ -1255,6 +1255,7 @@ XMLPUBFUN xmlParserCtxtPtr xmlCreateDocParserCtxt (const xmlChar *cur); #ifdef LIBXML_LEGACY_ENABLED +/** DOC_DISABLE */ /* * Reading/setting optional parsing features. */ @@ -1272,6 +1273,7 @@ XMLPUBFUN int xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name, void *value); +/** DOC_ENABLE */ #endif /* LIBXML_LEGACY_ENABLED */ #ifdef LIBXML_PUSH_ENABLED diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h index 88701b39..27c22696 100644 --- a/include/libxml/parserInternals.h +++ b/include/libxml/parserInternals.h @@ -629,66 +629,6 @@ XMLPUBFUN void xmlNextChar (xmlParserCtxtPtr ctxt); XML_DEPRECATED XMLPUBFUN void 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); - -XML_DEPRECATED -XMLPUBFUN void xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); - -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlParseQuotedString (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN void - xmlParseNamespace (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlScanName (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN void xmlParserHandleReference(xmlParserCtxtPtr ctxt); -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, - xmlChar **prefix); -/** - * Entities - */ -XML_DEPRECATED -XMLPUBFUN xmlChar * - xmlDecodeEntities (xmlParserCtxtPtr ctxt, - int len, - int what, - xmlChar end, - xmlChar end2, - xmlChar end3); -XML_DEPRECATED -XMLPUBFUN void - xmlHandleEntity (xmlParserCtxtPtr ctxt, - xmlEntityPtr entity); - -#endif /* LIBXML_LEGACY_ENABLED */ - #ifdef __cplusplus } #endif diff --git a/include/libxml/tree.h b/include/libxml/tree.h index 7ee8960a..781da6da 100644 --- a/include/libxml/tree.h +++ b/include/libxml/tree.h @@ -802,13 +802,6 @@ XMLPUBFUN xmlDtdPtr xmlGetIntSubset (const xmlDoc *doc); XMLPUBFUN void xmlFreeDtd (xmlDtdPtr cur); -#ifdef LIBXML_LEGACY_ENABLED -XML_DEPRECATED -XMLPUBFUN xmlNsPtr - xmlNewGlobalNs (xmlDocPtr doc, - const xmlChar *href, - const xmlChar *prefix); -#endif /* LIBXML_LEGACY_ENABLED */ XMLPUBFUN xmlNsPtr xmlNewNs (xmlNodePtr node, const xmlChar *href, diff --git a/legacy.c b/legacy.c index 20ce8b3e..14777e05 100644 --- a/legacy.c +++ b/legacy.c @@ -14,14 +14,7 @@ #include #include -#include -#include -#include -#include -#include -#include - -void xmlUpgradeOldNs(xmlDocPtr doc); +#include /************************************************************************ * * @@ -30,1417 +23,494 @@ void xmlUpgradeOldNs(xmlDocPtr doc); ************************************************************************/ #ifdef LIBXML_HTML_ENABLED -xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end, - xmlChar end2, xmlChar end3); +XMLPUBFUN xmlChar * +htmlDecodeEntities(void *ctxt, int len, xmlChar end, xmlChar end2, + xmlChar end3); -/** - * htmlDecodeEntities: - * @ctxt: the parser context - * @len: the len to decode (in bytes !), -1 for no size limit - * @end: an end marker xmlChar, 0 if none - * @end2: an end marker xmlChar, 0 if none - * @end3: an end marker xmlChar, 0 if none - * - * Substitute the HTML entities by their value - * - * DEPRECATED !!!! - * - * Returns A newly allocated string with the substitution done. The caller - * must deallocate it ! - */ xmlChar * -htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED, - xmlChar end2 ATTRIBUTE_UNUSED, - xmlChar end3 ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - fprintf(stderr, - "htmlDecodeEntities() deprecated function reached\n"); - deprecated = 1; - } +htmlDecodeEntities(void *ctxt ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED, + xmlChar end ATTRIBUTE_UNUSED, xmlChar end2 ATTRIBUTE_UNUSED, + xmlChar end3 ATTRIBUTE_UNUSED) { return (NULL); } #endif -/** - * xmlInitializePredefinedEntities: - * - * Set up the predefined entities. - * Deprecated call +/* + * entities.h */ + +XMLPUBFUN void +xmlInitializePredefinedEntities(void); + void -xmlInitializePredefinedEntities(void) -{ +xmlInitializePredefinedEntities(void) { } -/** - * xmlCleanupPredefinedEntities: - * - * Cleanup up the predefined entities table. - * Deprecated call - */ +XMLPUBFUN void +xmlCleanupPredefinedEntities(void); + void -xmlCleanupPredefinedEntities(void) -{ +xmlCleanupPredefinedEntities(void) { } -static const char* const 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", -}; +XMLPUBFUN const xmlChar * +xmlEncodeEntities(void *doc, const xmlChar *input); -/** - * xmlGetFeaturesList: - * @len: the length of the features name array (input/output) - * @result: an array of string to be filled with the features name. +const xmlChar * +xmlEncodeEntities(void *doc ATTRIBUTE_UNUSED, + const xmlChar *input ATTRIBUTE_UNUSED) { + return (NULL); +} + +/* + * parser.h * - * 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 + * Headers are public for now. */ + 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); +xmlGetFeaturesList(int *len, const char **result ATTRIBUTE_UNUSED) { + *len = 0; + return(0); } -/** - * 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); +xmlGetFeature(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + void *result ATTRIBUTE_UNUSED) { + return(-1); } -/** - * 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); +xmlSetFeature(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + void *value ATTRIBUTE_UNUSED) { + return(-1); } -/** - * 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 ! +/* + * parserInternals.h */ + +XMLPUBFUN xmlChar * +xmlDecodeEntities(void *ctxt, int len, int what, xmlChar end, xmlChar end2, + xmlChar end3); + xmlChar * -xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED, - xmlChar end ATTRIBUTE_UNUSED, +xmlDecodeEntities(void *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) { - fprintf(stderr, - "xmlDecodeEntities() deprecated function reached\n"); - deprecated = 1; - } + xmlChar end3 ATTRIBUTE_UNUSED) { 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 - */ +XMLPUBFUN xmlChar * +xmlNamespaceParseNCName(void *ctxt); xmlChar * -xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - fprintf(stderr, - "xmlNamespaceParseNCName() deprecated function reached\n"); - deprecated = 1; - } +xmlNamespaceParseNCName(void *ctxt ATTRIBUTE_UNUSED) { 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. - */ +XMLPUBFUN xmlChar * +xmlNamespaceParseQName(void *ctxt, xmlChar **prefix); xmlChar * -xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - xmlChar ** prefix ATTRIBUTE_UNUSED) -{ - - static int deprecated = 0; - - if (!deprecated) { - fprintf(stderr, - "xmlNamespaceParseQName() deprecated function reached\n"); - deprecated = 1; - } +xmlNamespaceParseQName(void *ctxt ATTRIBUTE_UNUSED, + xmlChar **prefix ATTRIBUTE_UNUSED) { 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 - */ +XMLPUBFUN xmlChar * +xmlNamespaceParseNSDef(void *ctxt); xmlChar * -xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - fprintf(stderr, - "xmlNamespaceParseNSDef() deprecated function reached\n"); - deprecated = 1; - } +xmlNamespaceParseNSDef(void *ctxt ATTRIBUTE_UNUSED) { 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. - */ +XMLPUBFUN xmlChar * +xmlParseQuotedString(void *ctxt); + xmlChar * -xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - fprintf(stderr, - "xmlParseQuotedString() deprecated function reached\n"); - deprecated = 1; - } +xmlParseQuotedString(void *ctxt ATTRIBUTE_UNUSED) { return (NULL); } -/** - * xmlParseNamespace: - * @ctxt: an XML parser context - * - * xmlParseNamespace: parse specific PI '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; +initxmlDefaultSAXHandler(void *hdlr ATTRIBUTE_UNUSED, + int warning ATTRIBUTE_UNUSED) { } -/** - * inithtmlDefaultSAXHandler: - * @hdlr: the SAX handler - * - * Initialize the default HTML SAX version 1 handler - * DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks - */ +XMLPUBFUN void +inithtmlDefaultSAXHandler(void *hdlr); + void -inithtmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr) -{ - if(hdlr->initialized == 1) - return; - - hdlr->internalSubset = xmlSAX2InternalSubset; - hdlr->externalSubset = NULL; - hdlr->isStandalone = NULL; - hdlr->hasInternalSubset = NULL; - hdlr->hasExternalSubset = NULL; - hdlr->resolveEntity = NULL; - hdlr->getEntity = xmlSAX2GetEntity; - hdlr->getParameterEntity = NULL; - hdlr->entityDecl = NULL; - hdlr->attributeDecl = NULL; - hdlr->elementDecl = NULL; - hdlr->notationDecl = NULL; - hdlr->unparsedEntityDecl = NULL; - hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator; - hdlr->startDocument = xmlSAX2StartDocument; - hdlr->endDocument = xmlSAX2EndDocument; - hdlr->startElement = xmlSAX2StartElement; - hdlr->endElement = xmlSAX2EndElement; - hdlr->reference = NULL; - hdlr->characters = xmlSAX2Characters; - hdlr->cdataBlock = xmlSAX2CDataBlock; - hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace; - hdlr->processingInstruction = xmlSAX2ProcessingInstruction; - hdlr->comment = xmlSAX2Comment; - hdlr->warning = xmlParserWarning; - hdlr->error = xmlParserError; - hdlr->fatalError = xmlParserError; - - hdlr->initialized = 1; +inithtmlDefaultSAXHandler(void *hdlr ATTRIBUTE_UNUSED) { } /* diff --git a/python/generator.py b/python/generator.py index c83cd6b4..530277a8 100755 --- a/python/generator.py +++ b/python/generator.py @@ -304,31 +304,20 @@ deprecated_funcs = { 'xmlCleanupCharEncodingHandlers': True, 'xmlCleanupGlobals': True, 'xmlDefaultSAXHandlerInit': True, - 'xmlDecodeEntities': True, 'xmlDictCleanup': True, - 'xmlEncodeEntities': True, 'xmlFileMatch': True, 'xmlGetCompressMode': True, - 'xmlHandleEntity': True, 'xmlInitCharEncodingHandlers': True, 'xmlInitGlobals': True, 'xmlInitializeDict': True, - 'xmlInitializePredefinedEntities': True, 'xmlIOFTPMatch': True, 'xmlIOHTTPMatch': True, 'xmlIsRef': True, 'xmlKeepBlanksDefault': True, 'xmlLineNumbersDefault': True, - 'xmlNamespaceParseNCName': True, - 'xmlNamespaceParseNSDef': True, - 'xmlNanoFTPCleanup': True, - 'xmlNanoFTPInit': True, - 'xmlNanoFTPProxy': True, - 'xmlNanoFTPScanProxy': True, 'xmlNanoHTTPCleanup': True, 'xmlNanoHTTPInit': True, 'xmlNanoHTTPScanProxy': True, - 'xmlNewGlobalNs': True, 'xmlNextChar': True, 'xmlNormalizeWindowsPath': True, 'xmlParseAttValue': True, @@ -349,14 +338,12 @@ deprecated_funcs = { 'xmlParseMarkupDecl': True, 'xmlParseMisc': True, 'xmlParseName': True, - 'xmlParseNamespace': True, 'xmlParseNmtoken': True, 'xmlParseNotationDecl': True, 'xmlParsePEReference': True, 'xmlParsePI': True, 'xmlParsePITarget': True, 'xmlParsePubidLiteral': True, - 'xmlParseQuotedString': True, 'xmlParseReference': True, 'xmlParseSDDecl': True, 'xmlParseStartTag': True, @@ -366,7 +353,6 @@ deprecated_funcs = { 'xmlParseVersionNum': True, 'xmlParseXMLDecl': True, 'xmlParserHandlePEReference': True, - 'xmlParserHandleReference': True, 'xmlParserSetLineNumbers': True, 'xmlParserSetLoadSubset': True, 'xmlParserSetPedantic': True, @@ -381,7 +367,6 @@ deprecated_funcs = { 'xmlRelaxNGInitTypes': True, 'xmlRemoveRef': True, 'xmlSAXDefaultVersion': True, - 'xmlScanName': True, 'xmlSchemaCleanupTypes': True, 'xmlSchemaInitTypes': True, 'xmlSetCompressMode': True, diff --git a/testapi.c b/testapi.c index fd0e82ce..d3ff3d48 100644 --- a/testapi.c +++ b/testapi.c @@ -9149,7 +9149,7 @@ static int test_entities(void) { int test_ret = 0; - if (quiet == 0) printf("Testing entities : 12 of 19 functions ...\n"); + if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n"); test_ret += test_xmlAddDocEntity(); test_ret += test_xmlAddDtdEntity(); test_ret += test_xmlAddEntity(); @@ -14724,7 +14724,7 @@ static int test_parser(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parser : 71 of 86 functions ...\n"); + if (quiet == 0) printf("Testing parser : 71 of 83 functions ...\n"); test_ret += test_xmlByteConsumed(); test_ret += test_xmlCleanupGlobals(); test_ret += test_xmlClearNodeInfoSeq(); @@ -15878,16 +15878,6 @@ test_xmlPushInput(void) { } -static int -test_xmlSetEntityReferenceFunc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - static int test_xmlSplitQName(void) { int test_ret = 0; @@ -16290,7 +16280,7 @@ static int test_parserInternals(void) { int test_ret = 0; - if (quiet == 0) printf("Testing parserInternals : 36 of 95 functions ...\n"); + if (quiet == 0) printf("Testing parserInternals : 36 of 85 functions ...\n"); test_ret += test_inputPop(); test_ret += test_inputPush(); test_ret += test_namePop(); @@ -16321,7 +16311,6 @@ test_parserInternals(void) { test_ret += test_xmlParserInputShrink(); test_ret += test_xmlPopInput(); test_ret += test_xmlPushInput(); - test_ret += test_xmlSetEntityReferenceFunc(); test_ret += test_xmlSplitQName(); test_ret += test_xmlStringCurrentChar(); test_ret += test_xmlStringDecodeEntities(); @@ -23929,7 +23918,7 @@ static int test_tree(void) { int test_ret = 0; - if (quiet == 0) printf("Testing tree : 146 of 173 functions ...\n"); + if (quiet == 0) printf("Testing tree : 146 of 172 functions ...\n"); test_ret += test_xmlAddChild(); test_ret += test_xmlAddChildList(); test_ret += test_xmlAddNextSibling();