blob: 86362bf50d1f30feee896c7e8cb1d583d0e5cd3d [file] [log] [blame]
Daniel Veillard8940fd52003-09-29 09:07:08 +00001/*
2 * legacy.c: set of deprecated routines, not to be used anymore but
3 * kept purely for ABI compatibility
4 *
5 * See Copyright for the status of this software.
6 *
7 * daniel@veillard.com
8 */
9
10#define IN_LIBXML
11#include "libxml.h"
12
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000013#ifdef LIBXML_LEGACY_ENABLED
14#include <string.h>
15
Daniel Veillard8940fd52003-09-29 09:07:08 +000016#include <libxml/tree.h>
17#include <libxml/entities.h>
18#include <libxml/SAX.h>
19#include <libxml/parserInternals.h>
Daniel Veillardf403d292003-10-05 13:51:35 +000020#include <libxml/HTMLparser.h>
Daniel Veillard8940fd52003-09-29 09:07:08 +000021
Daniel Veillard8940fd52003-09-29 09:07:08 +000022void xmlUpgradeOldNs(xmlDocPtr doc);
23
24/************************************************************************
25 * *
26 * Deprecated functions kept for compatibility *
27 * *
28 ************************************************************************/
29
Daniel Veillard7a5e0dd2004-09-17 08:45:25 +000030#ifdef LIBXML_HTML_ENABLED
Daniel Veillardf403d292003-10-05 13:51:35 +000031xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end,
32 xmlChar end2, xmlChar end3);
33
34/**
35 * htmlDecodeEntities:
36 * @ctxt: the parser context
37 * @len: the len to decode (in bytes !), -1 for no size limit
38 * @end: an end marker xmlChar, 0 if none
39 * @end2: an end marker xmlChar, 0 if none
40 * @end3: an end marker xmlChar, 0 if none
41 *
42 * Substitute the HTML entities by their value
43 *
44 * DEPRECATED !!!!
45 *
46 * Returns A newly allocated string with the substitution done. The caller
47 * must deallocate it !
48 */
49xmlChar *
50htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
51 int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,
52 xmlChar end2 ATTRIBUTE_UNUSED,
53 xmlChar end3 ATTRIBUTE_UNUSED)
54{
55 static int deprecated = 0;
56
57 if (!deprecated) {
58 xmlGenericError(xmlGenericErrorContext,
59 "htmlDecodeEntities() deprecated function reached\n");
60 deprecated = 1;
61 }
62 return (NULL);
63}
Daniel Veillard7a5e0dd2004-09-17 08:45:25 +000064#endif
Daniel Veillardf403d292003-10-05 13:51:35 +000065
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000066/**
67 * xmlInitializePredefinedEntities:
68 *
69 * Set up the predefined entities.
70 * Deprecated call
71 */
Daniel Veillardf403d292003-10-05 13:51:35 +000072void
73xmlInitializePredefinedEntities(void)
74{
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000075}
76
77/**
78 * xmlCleanupPredefinedEntities:
79 *
80 * Cleanup up the predefined entities table.
81 * Deprecated call
82 */
Daniel Veillardf403d292003-10-05 13:51:35 +000083void
84xmlCleanupPredefinedEntities(void)
85{
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000086}
87
Daniel Veillard73b013f2003-09-30 12:36:01 +000088static const char *xmlFeaturesList[] = {
89 "validate",
90 "load subset",
91 "keep blanks",
92 "disable SAX",
93 "fetch external entities",
94 "substitute entities",
95 "gather line info",
96 "user data",
97 "is html",
98 "is standalone",
99 "stop parser",
100 "document",
101 "is well formed",
102 "is valid",
103 "SAX block",
104 "SAX function internalSubset",
105 "SAX function isStandalone",
106 "SAX function hasInternalSubset",
107 "SAX function hasExternalSubset",
108 "SAX function resolveEntity",
109 "SAX function getEntity",
110 "SAX function entityDecl",
111 "SAX function notationDecl",
112 "SAX function attributeDecl",
113 "SAX function elementDecl",
114 "SAX function unparsedEntityDecl",
115 "SAX function setDocumentLocator",
116 "SAX function startDocument",
117 "SAX function endDocument",
118 "SAX function startElement",
119 "SAX function endElement",
120 "SAX function reference",
121 "SAX function characters",
122 "SAX function ignorableWhitespace",
123 "SAX function processingInstruction",
124 "SAX function comment",
125 "SAX function warning",
126 "SAX function error",
127 "SAX function fatalError",
128 "SAX function getParameterEntity",
129 "SAX function cdataBlock",
130 "SAX function externalSubset",
131};
132
133/**
134 * xmlGetFeaturesList:
135 * @len: the length of the features name array (input/output)
136 * @result: an array of string to be filled with the features name.
137 *
138 * Copy at most *@len feature names into the @result array
139 *
140 * Returns -1 in case or error, or the total number of features,
141 * len is updated with the number of strings copied,
142 * strings must not be deallocated
143 */
144int
Daniel Veillardf403d292003-10-05 13:51:35 +0000145xmlGetFeaturesList(int *len, const char **result)
146{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000147 int ret, i;
148
Daniel Veillardf403d292003-10-05 13:51:35 +0000149 ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000150 if ((len == NULL) || (result == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000151 return (ret);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000152 if ((*len < 0) || (*len >= 1000))
Daniel Veillardf403d292003-10-05 13:51:35 +0000153 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000154 if (*len > ret)
Daniel Veillardf403d292003-10-05 13:51:35 +0000155 *len = ret;
156 for (i = 0; i < *len; i++)
157 result[i] = xmlFeaturesList[i];
158 return (ret);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000159}
160
161/**
162 * xmlGetFeature:
163 * @ctxt: an XML/HTML parser context
164 * @name: the feature name
165 * @result: location to store the result
166 *
167 * Read the current value of one feature of this parser instance
168 *
169 * Returns -1 in case or error, 0 otherwise
170 */
171int
Daniel Veillardf403d292003-10-05 13:51:35 +0000172xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result)
173{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000174 if ((ctxt == NULL) || (name == NULL) || (result == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000175 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000176
177 if (!strcmp(name, "validate")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000178 *((int *) result) = ctxt->validate;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000179 } else if (!strcmp(name, "keep blanks")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000180 *((int *) result) = ctxt->keepBlanks;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000181 } else if (!strcmp(name, "disable SAX")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000182 *((int *) result) = ctxt->disableSAX;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000183 } else if (!strcmp(name, "fetch external entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000184 *((int *) result) = ctxt->loadsubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000185 } else if (!strcmp(name, "substitute entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000186 *((int *) result) = ctxt->replaceEntities;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000187 } else if (!strcmp(name, "gather line info")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000188 *((int *) result) = ctxt->record_info;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000189 } else if (!strcmp(name, "user data")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000190 *((void **) result) = ctxt->userData;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000191 } else if (!strcmp(name, "is html")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000192 *((int *) result) = ctxt->html;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000193 } else if (!strcmp(name, "is standalone")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000194 *((int *) result) = ctxt->standalone;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000195 } else if (!strcmp(name, "document")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000196 *((xmlDocPtr *) result) = ctxt->myDoc;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000197 } else if (!strcmp(name, "is well formed")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000198 *((int *) result) = ctxt->wellFormed;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000199 } else if (!strcmp(name, "is valid")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000200 *((int *) result) = ctxt->valid;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000201 } else if (!strcmp(name, "SAX block")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000202 *((xmlSAXHandlerPtr *) result) = ctxt->sax;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000203 } else if (!strcmp(name, "SAX function internalSubset")) {
204 *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset;
205 } else if (!strcmp(name, "SAX function isStandalone")) {
206 *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone;
207 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000208 *((hasInternalSubsetSAXFunc *) result) =
209 ctxt->sax->hasInternalSubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000210 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000211 *((hasExternalSubsetSAXFunc *) result) =
212 ctxt->sax->hasExternalSubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000213 } else if (!strcmp(name, "SAX function resolveEntity")) {
214 *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity;
215 } else if (!strcmp(name, "SAX function getEntity")) {
216 *((getEntitySAXFunc *) result) = ctxt->sax->getEntity;
217 } else if (!strcmp(name, "SAX function entityDecl")) {
218 *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl;
219 } else if (!strcmp(name, "SAX function notationDecl")) {
220 *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl;
221 } else if (!strcmp(name, "SAX function attributeDecl")) {
222 *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl;
223 } else if (!strcmp(name, "SAX function elementDecl")) {
224 *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl;
225 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000226 *((unparsedEntityDeclSAXFunc *) result) =
227 ctxt->sax->unparsedEntityDecl;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000228 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000229 *((setDocumentLocatorSAXFunc *) result) =
230 ctxt->sax->setDocumentLocator;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000231 } else if (!strcmp(name, "SAX function startDocument")) {
232 *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument;
233 } else if (!strcmp(name, "SAX function endDocument")) {
234 *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument;
235 } else if (!strcmp(name, "SAX function startElement")) {
236 *((startElementSAXFunc *) result) = ctxt->sax->startElement;
237 } else if (!strcmp(name, "SAX function endElement")) {
238 *((endElementSAXFunc *) result) = ctxt->sax->endElement;
239 } else if (!strcmp(name, "SAX function reference")) {
240 *((referenceSAXFunc *) result) = ctxt->sax->reference;
241 } else if (!strcmp(name, "SAX function characters")) {
242 *((charactersSAXFunc *) result) = ctxt->sax->characters;
243 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000244 *((ignorableWhitespaceSAXFunc *) result) =
245 ctxt->sax->ignorableWhitespace;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000246 } else if (!strcmp(name, "SAX function processingInstruction")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000247 *((processingInstructionSAXFunc *) result) =
248 ctxt->sax->processingInstruction;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000249 } else if (!strcmp(name, "SAX function comment")) {
250 *((commentSAXFunc *) result) = ctxt->sax->comment;
251 } else if (!strcmp(name, "SAX function warning")) {
252 *((warningSAXFunc *) result) = ctxt->sax->warning;
253 } else if (!strcmp(name, "SAX function error")) {
254 *((errorSAXFunc *) result) = ctxt->sax->error;
255 } else if (!strcmp(name, "SAX function fatalError")) {
256 *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError;
257 } else if (!strcmp(name, "SAX function getParameterEntity")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000258 *((getParameterEntitySAXFunc *) result) =
259 ctxt->sax->getParameterEntity;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000260 } else if (!strcmp(name, "SAX function cdataBlock")) {
261 *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock;
262 } else if (!strcmp(name, "SAX function externalSubset")) {
263 *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset;
264 } else {
Daniel Veillardf403d292003-10-05 13:51:35 +0000265 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000266 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000267 return (0);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000268}
269
270/**
271 * xmlSetFeature:
272 * @ctxt: an XML/HTML parser context
273 * @name: the feature name
274 * @value: pointer to the location of the new value
275 *
276 * Change the current value of one feature of this parser instance
277 *
278 * Returns -1 in case or error, 0 otherwise
279 */
Daniel Veillardf403d292003-10-05 13:51:35 +0000280int
281xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value)
282{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000283 if ((ctxt == NULL) || (name == NULL) || (value == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000284 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000285
286 if (!strcmp(name, "validate")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000287 int newvalidate = *((int *) value);
288
289 if ((!ctxt->validate) && (newvalidate != 0)) {
290 if (ctxt->vctxt.warning == NULL)
291 ctxt->vctxt.warning = xmlParserValidityWarning;
292 if (ctxt->vctxt.error == NULL)
293 ctxt->vctxt.error = xmlParserValidityError;
294 ctxt->vctxt.nodeMax = 0;
295 }
Daniel Veillard73b013f2003-09-30 12:36:01 +0000296 ctxt->validate = newvalidate;
297 } else if (!strcmp(name, "keep blanks")) {
298 ctxt->keepBlanks = *((int *) value);
299 } else if (!strcmp(name, "disable SAX")) {
300 ctxt->disableSAX = *((int *) value);
301 } else if (!strcmp(name, "fetch external entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000302 ctxt->loadsubset = *((int *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000303 } else if (!strcmp(name, "substitute entities")) {
304 ctxt->replaceEntities = *((int *) value);
305 } else if (!strcmp(name, "gather line info")) {
306 ctxt->record_info = *((int *) value);
307 } else if (!strcmp(name, "user data")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000308 ctxt->userData = *((void **) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000309 } else if (!strcmp(name, "is html")) {
310 ctxt->html = *((int *) value);
311 } else if (!strcmp(name, "is standalone")) {
312 ctxt->standalone = *((int *) value);
313 } else if (!strcmp(name, "document")) {
314 ctxt->myDoc = *((xmlDocPtr *) value);
315 } else if (!strcmp(name, "is well formed")) {
316 ctxt->wellFormed = *((int *) value);
317 } else if (!strcmp(name, "is valid")) {
318 ctxt->valid = *((int *) value);
319 } else if (!strcmp(name, "SAX block")) {
320 ctxt->sax = *((xmlSAXHandlerPtr *) value);
321 } else if (!strcmp(name, "SAX function internalSubset")) {
322 ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value);
323 } else if (!strcmp(name, "SAX function isStandalone")) {
324 ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value);
325 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000326 ctxt->sax->hasInternalSubset =
327 *((hasInternalSubsetSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000328 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000329 ctxt->sax->hasExternalSubset =
330 *((hasExternalSubsetSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000331 } else if (!strcmp(name, "SAX function resolveEntity")) {
332 ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value);
333 } else if (!strcmp(name, "SAX function getEntity")) {
334 ctxt->sax->getEntity = *((getEntitySAXFunc *) value);
335 } else if (!strcmp(name, "SAX function entityDecl")) {
336 ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value);
337 } else if (!strcmp(name, "SAX function notationDecl")) {
338 ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value);
339 } else if (!strcmp(name, "SAX function attributeDecl")) {
340 ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value);
341 } else if (!strcmp(name, "SAX function elementDecl")) {
342 ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value);
343 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000344 ctxt->sax->unparsedEntityDecl =
345 *((unparsedEntityDeclSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000346 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000347 ctxt->sax->setDocumentLocator =
348 *((setDocumentLocatorSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000349 } else if (!strcmp(name, "SAX function startDocument")) {
350 ctxt->sax->startDocument = *((startDocumentSAXFunc *) value);
351 } else if (!strcmp(name, "SAX function endDocument")) {
352 ctxt->sax->endDocument = *((endDocumentSAXFunc *) value);
353 } else if (!strcmp(name, "SAX function startElement")) {
354 ctxt->sax->startElement = *((startElementSAXFunc *) value);
355 } else if (!strcmp(name, "SAX function endElement")) {
356 ctxt->sax->endElement = *((endElementSAXFunc *) value);
357 } else if (!strcmp(name, "SAX function reference")) {
358 ctxt->sax->reference = *((referenceSAXFunc *) value);
359 } else if (!strcmp(name, "SAX function characters")) {
360 ctxt->sax->characters = *((charactersSAXFunc *) value);
361 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000362 ctxt->sax->ignorableWhitespace =
363 *((ignorableWhitespaceSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000364 } else if (!strcmp(name, "SAX function processingInstruction")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000365 ctxt->sax->processingInstruction =
366 *((processingInstructionSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000367 } else if (!strcmp(name, "SAX function comment")) {
368 ctxt->sax->comment = *((commentSAXFunc *) value);
369 } else if (!strcmp(name, "SAX function warning")) {
370 ctxt->sax->warning = *((warningSAXFunc *) value);
371 } else if (!strcmp(name, "SAX function error")) {
372 ctxt->sax->error = *((errorSAXFunc *) value);
373 } else if (!strcmp(name, "SAX function fatalError")) {
374 ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value);
375 } else if (!strcmp(name, "SAX function getParameterEntity")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000376 ctxt->sax->getParameterEntity =
377 *((getParameterEntitySAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000378 } else if (!strcmp(name, "SAX function cdataBlock")) {
379 ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value);
380 } else if (!strcmp(name, "SAX function externalSubset")) {
381 ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value);
382 } else {
Daniel Veillardf403d292003-10-05 13:51:35 +0000383 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000384 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000385 return (0);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000386}
387
Daniel Veillard8940fd52003-09-29 09:07:08 +0000388/**
389 * xmlDecodeEntities:
390 * @ctxt: the parser context
391 * @len: the len to decode (in bytes !), -1 for no size limit
392 * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
393 * @end: an end marker xmlChar, 0 if none
394 * @end2: an end marker xmlChar, 0 if none
395 * @end3: an end marker xmlChar, 0 if none
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800396 *
Daniel Veillard8940fd52003-09-29 09:07:08 +0000397 * This function is deprecated, we now always process entities content
398 * through xmlStringDecodeEntities
399 *
400 * TODO: remove it in next major release.
401 *
402 * [67] Reference ::= EntityRef | CharRef
403 *
404 * [69] PEReference ::= '%' Name ';'
405 *
406 * Returns A newly allocated string with the substitution done. The caller
407 * must deallocate it !
408 */
409xmlChar *
410xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
411 int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
412 xmlChar end ATTRIBUTE_UNUSED,
413 xmlChar end2 ATTRIBUTE_UNUSED,
414 xmlChar end3 ATTRIBUTE_UNUSED)
415{
416 static int deprecated = 0;
417
418 if (!deprecated) {
419 xmlGenericError(xmlGenericErrorContext,
420 "xmlDecodeEntities() deprecated function reached\n");
421 deprecated = 1;
422 }
423 return (NULL);
424}
425
426/**
427 * xmlNamespaceParseNCName:
428 * @ctxt: an XML parser context
429 *
430 * parse an XML namespace name.
431 *
432 * TODO: this seems not in use anymore, the namespace handling is done on
433 * top of the SAX interfaces, i.e. not on raw input.
434 *
435 * [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
436 *
437 * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
438 * CombiningChar | Extender
439 *
440 * Returns the namespace name or NULL
441 */
442
443xmlChar *
444xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
445{
446 static int deprecated = 0;
447
448 if (!deprecated) {
449 xmlGenericError(xmlGenericErrorContext,
450 "xmlNamespaceParseNCName() deprecated function reached\n");
451 deprecated = 1;
452 }
453 return (NULL);
454}
455
456/**
457 * xmlNamespaceParseQName:
458 * @ctxt: an XML parser context
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800459 * @prefix: a xmlChar **
Daniel Veillard8940fd52003-09-29 09:07:08 +0000460 *
461 * TODO: this seems not in use anymore, the namespace handling is done on
462 * top of the SAX interfaces, i.e. not on raw input.
463 *
464 * parse an XML qualified name
465 *
466 * [NS 5] QName ::= (Prefix ':')? LocalPart
467 *
468 * [NS 6] Prefix ::= NCName
469 *
470 * [NS 7] LocalPart ::= NCName
471 *
472 * Returns the local part, and prefix is updated
473 * to get the Prefix if any.
474 */
475
476xmlChar *
477xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
478 xmlChar ** prefix ATTRIBUTE_UNUSED)
479{
480
481 static int deprecated = 0;
482
483 if (!deprecated) {
484 xmlGenericError(xmlGenericErrorContext,
485 "xmlNamespaceParseQName() deprecated function reached\n");
486 deprecated = 1;
487 }
488 return (NULL);
489}
490
491/**
492 * xmlNamespaceParseNSDef:
493 * @ctxt: an XML parser context
494 *
495 * parse a namespace prefix declaration
496 *
497 * TODO: this seems not in use anymore, the namespace handling is done on
498 * top of the SAX interfaces, i.e. not on raw input.
499 *
500 * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
501 *
502 * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
503 *
504 * Returns the namespace name
505 */
506
507xmlChar *
508xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
509{
510 static int deprecated = 0;
511
512 if (!deprecated) {
513 xmlGenericError(xmlGenericErrorContext,
514 "xmlNamespaceParseNSDef() deprecated function reached\n");
515 deprecated = 1;
516 }
517 return (NULL);
518}
519
520/**
521 * xmlParseQuotedString:
522 * @ctxt: an XML parser context
523 *
524 * Parse and return a string between quotes or doublequotes
525 *
526 * TODO: Deprecated, to be removed at next drop of binary compatibility
527 *
528 * Returns the string parser or NULL.
529 */
530xmlChar *
531xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
532{
533 static int deprecated = 0;
534
535 if (!deprecated) {
536 xmlGenericError(xmlGenericErrorContext,
537 "xmlParseQuotedString() deprecated function reached\n");
538 deprecated = 1;
539 }
540 return (NULL);
541}
542
543/**
544 * xmlParseNamespace:
545 * @ctxt: an XML parser context
546 *
547 * xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
548 *
549 * This is what the older xml-name Working Draft specified, a bunch of
550 * other stuff may still rely on it, so support is still here as
551 * if it was declared on the root of the Tree:-(
552 *
553 * TODO: remove from library
554 *
555 * To be removed at next drop of binary compatibility
556 */
557
558void
559xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
560{
561 static int deprecated = 0;
562
563 if (!deprecated) {
564 xmlGenericError(xmlGenericErrorContext,
565 "xmlParseNamespace() deprecated function reached\n");
566 deprecated = 1;
567 }
568}
569
570/**
571 * xmlScanName:
572 * @ctxt: an XML parser context
573 *
574 * Trickery: parse an XML name but without consuming the input flow
575 * Needed for rollback cases. Used only when parsing entities references.
576 *
577 * TODO: seems deprecated now, only used in the default part of
578 * xmlParserHandleReference
579 *
580 * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
581 * CombiningChar | Extender
582 *
583 * [5] Name ::= (Letter | '_' | ':') (NameChar)*
584 *
585 * [6] Names ::= Name (S Name)*
586 *
587 * Returns the Name parsed or NULL
588 */
589
590xmlChar *
591xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
592{
593 static int deprecated = 0;
594
595 if (!deprecated) {
596 xmlGenericError(xmlGenericErrorContext,
597 "xmlScanName() deprecated function reached\n");
598 deprecated = 1;
599 }
600 return (NULL);
601}
602
603/**
604 * xmlParserHandleReference:
605 * @ctxt: the parser context
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800606 *
Daniel Veillard8940fd52003-09-29 09:07:08 +0000607 * TODO: Remove, now deprecated ... the test is done directly in the
608 * content parsing
609 * routines.
610 *
611 * [67] Reference ::= EntityRef | CharRef
612 *
613 * [68] EntityRef ::= '&' Name ';'
614 *
615 * [ WFC: Entity Declared ]
616 * the Name given in the entity reference must match that in an entity
617 * declaration, except that well-formed documents need not declare any
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800618 * of the following entities: amp, lt, gt, apos, quot.
Daniel Veillard8940fd52003-09-29 09:07:08 +0000619 *
620 * [ WFC: Parsed Entity ]
621 * An entity reference must not contain the name of an unparsed entity
622 *
623 * [66] CharRef ::= '&#' [0-9]+ ';' |
624 * '&#x' [0-9a-fA-F]+ ';'
625 *
626 * A PEReference may have been detected in the current input stream
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800627 * the handling is done accordingly to
Daniel Veillard8940fd52003-09-29 09:07:08 +0000628 * http://www.w3.org/TR/REC-xml#entproc
629 */
630void
631xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
632{
633 static int deprecated = 0;
634
635 if (!deprecated) {
636 xmlGenericError(xmlGenericErrorContext,
637 "xmlParserHandleReference() deprecated function reached\n");
638 deprecated = 1;
639 }
640
641 return;
642}
643
644/**
645 * xmlHandleEntity:
646 * @ctxt: an XML parser context
647 * @entity: an XML entity pointer.
648 *
649 * Default handling of defined entities, when should we define a new input
650 * stream ? When do we just handle that as a set of chars ?
651 *
652 * OBSOLETE: to be removed at some point.
653 */
654
655void
656xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
657 xmlEntityPtr entity ATTRIBUTE_UNUSED)
658{
659 static int deprecated = 0;
660
661 if (!deprecated) {
662 xmlGenericError(xmlGenericErrorContext,
663 "xmlHandleEntity() deprecated function reached\n");
664 deprecated = 1;
665 }
666}
667
668/**
669 * xmlNewGlobalNs:
670 * @doc: the document carrying the namespace
671 * @href: the URI associated
672 * @prefix: the prefix for the namespace
673 *
674 * Creation of a Namespace, the old way using PI and without scoping
675 * DEPRECATED !!!
Daniel Veillard8940fd52003-09-29 09:07:08 +0000676 * Returns NULL this functionality had been removed
677 */
678xmlNsPtr
679xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
680 const xmlChar * href ATTRIBUTE_UNUSED,
681 const xmlChar * prefix ATTRIBUTE_UNUSED)
682{
683 static int deprecated = 0;
684
685 if (!deprecated) {
686 xmlGenericError(xmlGenericErrorContext,
687 "xmlNewGlobalNs() deprecated function reached\n");
688 deprecated = 1;
689 }
690 return (NULL);
691}
692
693/**
694 * xmlUpgradeOldNs:
695 * @doc: a document pointer
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800696 *
Daniel Veillard8940fd52003-09-29 09:07:08 +0000697 * Upgrade old style Namespaces (PI) and move them to the root of the document.
698 * DEPRECATED
699 */
700void
701xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
702{
703 static int deprecated = 0;
704
705 if (!deprecated) {
706 xmlGenericError(xmlGenericErrorContext,
707 "xmlUpgradeOldNs() deprecated function reached\n");
708 deprecated = 1;
709 }
710}
711
712/**
713 * xmlEncodeEntities:
714 * @doc: the document containing the string
715 * @input: A string to convert to XML.
716 *
717 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
718 * compatibility
719 *
720 * People must migrate their code to xmlEncodeEntitiesReentrant !
721 * This routine will issue a warning when encountered.
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800722 *
Daniel Veillard8940fd52003-09-29 09:07:08 +0000723 * Returns NULL
724 */
725const xmlChar *
726xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
Daniel Veillardf403d292003-10-05 13:51:35 +0000727 const xmlChar * input ATTRIBUTE_UNUSED)
728{
Daniel Veillard8940fd52003-09-29 09:07:08 +0000729 static int warning = 1;
730
731 if (warning) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000732 xmlGenericError(xmlGenericErrorContext,
733 "Deprecated API xmlEncodeEntities() used\n");
734 xmlGenericError(xmlGenericErrorContext,
735 " change code to use xmlEncodeEntitiesReentrant()\n");
736 warning = 0;
Daniel Veillard8940fd52003-09-29 09:07:08 +0000737 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000738 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000739}
740
741/************************************************************************
742 * *
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800743 * Old set of SAXv1 functions *
Daniel Veillard8940fd52003-09-29 09:07:08 +0000744 * *
745 ************************************************************************/
746static int deprecated_v1_msg = 0;
747
748#define DEPRECATED(n) \
749 if (deprecated_v1_msg == 0) \
750 xmlGenericError(xmlGenericErrorContext, \
751 "Use of deprecated SAXv1 function %s\n", n); \
752 deprecated_v1_msg++;
753
754/**
755 * getPublicId:
756 * @ctx: the user data (XML parser context)
757 *
758 * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
759 * DEPRECATED: use xmlSAX2GetPublicId()
760 *
761 * Returns a xmlChar *
762 */
763const xmlChar *
764getPublicId(void *ctx)
765{
766 DEPRECATED("getPublicId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000767 return (xmlSAX2GetPublicId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000768}
769
770/**
771 * getSystemId:
772 * @ctx: the user data (XML parser context)
773 *
774 * Provides the system ID, basically URL or filename e.g.
775 * http://www.sgmlsource.com/dtds/memo.dtd
776 * DEPRECATED: use xmlSAX2GetSystemId()
777 *
778 * Returns a xmlChar *
779 */
780const xmlChar *
781getSystemId(void *ctx)
782{
783 DEPRECATED("getSystemId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000784 return (xmlSAX2GetSystemId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000785}
786
787/**
788 * getLineNumber:
789 * @ctx: the user data (XML parser context)
790 *
791 * Provide the line number of the current parsing point.
792 * DEPRECATED: use xmlSAX2GetLineNumber()
793 *
794 * Returns an int
795 */
796int
797getLineNumber(void *ctx)
798{
799 DEPRECATED("getLineNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000800 return (xmlSAX2GetLineNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000801}
802
803/**
804 * getColumnNumber:
805 * @ctx: the user data (XML parser context)
806 *
807 * Provide the column number of the current parsing point.
808 * DEPRECATED: use xmlSAX2GetColumnNumber()
809 *
810 * Returns an int
811 */
812int
813getColumnNumber(void *ctx)
814{
815 DEPRECATED("getColumnNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000816 return (xmlSAX2GetColumnNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000817}
818
819/**
820 * isStandalone:
821 * @ctx: the user data (XML parser context)
822 *
823 * Is this document tagged standalone ?
824 * DEPRECATED: use xmlSAX2IsStandalone()
825 *
826 * Returns 1 if true
827 */
828int
829isStandalone(void *ctx)
830{
831 DEPRECATED("isStandalone")
Daniel Veillardf403d292003-10-05 13:51:35 +0000832 return (xmlSAX2IsStandalone(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000833}
834
835/**
836 * hasInternalSubset:
837 * @ctx: the user data (XML parser context)
838 *
839 * Does this document has an internal subset
840 * DEPRECATED: use xmlSAX2HasInternalSubset()
841 *
842 * Returns 1 if true
843 */
844int
845hasInternalSubset(void *ctx)
846{
847 DEPRECATED("hasInternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000848 return (xmlSAX2HasInternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000849}
850
851/**
852 * hasExternalSubset:
853 * @ctx: the user data (XML parser context)
854 *
855 * Does this document has an external subset
856 * DEPRECATED: use xmlSAX2HasExternalSubset()
857 *
858 * Returns 1 if true
859 */
860int
861hasExternalSubset(void *ctx)
862{
863 DEPRECATED("hasExternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000864 return (xmlSAX2HasExternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000865}
866
867/**
868 * internalSubset:
869 * @ctx: the user data (XML parser context)
870 * @name: the root element name
871 * @ExternalID: the external ID
872 * @SystemID: the SYSTEM ID (e.g. filename or URL)
873 *
874 * Callback on internal subset declaration.
875 * DEPRECATED: use xmlSAX2InternalSubset()
876 */
877void
Daniel Veillardf403d292003-10-05 13:51:35 +0000878internalSubset(void *ctx, const xmlChar * name,
879 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000880{
881 DEPRECATED("internalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000882 xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000883}
884
885/**
886 * externalSubset:
887 * @ctx: the user data (XML parser context)
888 * @name: the root element name
889 * @ExternalID: the external ID
890 * @SystemID: the SYSTEM ID (e.g. filename or URL)
891 *
892 * Callback on external subset declaration.
893 * DEPRECATED: use xmlSAX2ExternalSubset()
894 */
895void
Daniel Veillardf403d292003-10-05 13:51:35 +0000896externalSubset(void *ctx, const xmlChar * name,
897 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000898{
899 DEPRECATED("externalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000900 xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000901}
902
903/**
904 * resolveEntity:
905 * @ctx: the user data (XML parser context)
906 * @publicId: The public ID of the entity
907 * @systemId: The system ID of the entity
908 *
909 * The entity loader, to control the loading of external entities,
910 * the application can either:
911 * - override this resolveEntity() callback in the SAX block
912 * - or better use the xmlSetExternalEntityLoader() function to
913 * set up it's own entity resolution routine
914 * DEPRECATED: use xmlSAX2ResolveEntity()
915 *
916 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
917 */
918xmlParserInputPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000919resolveEntity(void *ctx, const xmlChar * publicId,
920 const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000921{
922 DEPRECATED("resolveEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000923 return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000924}
925
926/**
927 * getEntity:
928 * @ctx: the user data (XML parser context)
929 * @name: The entity name
930 *
931 * Get an entity by name
932 * DEPRECATED: use xmlSAX2GetEntity()
933 *
934 * Returns the xmlEntityPtr if found.
935 */
936xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000937getEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000938{
939 DEPRECATED("getEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000940 return (xmlSAX2GetEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000941}
942
943/**
944 * getParameterEntity:
945 * @ctx: the user data (XML parser context)
946 * @name: The entity name
947 *
948 * Get a parameter entity by name
949 * DEPRECATED: use xmlSAX2GetParameterEntity()
950 *
951 * Returns the xmlEntityPtr if found.
952 */
953xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000954getParameterEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000955{
956 DEPRECATED("getParameterEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000957 return (xmlSAX2GetParameterEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000958}
959
960
961/**
962 * entityDecl:
963 * @ctx: the user data (XML parser context)
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800964 * @name: the entity name
965 * @type: the entity type
Daniel Veillard8940fd52003-09-29 09:07:08 +0000966 * @publicId: The public ID of the entity
967 * @systemId: The system ID of the entity
968 * @content: the entity value (without processing).
969 *
970 * An entity definition has been parsed
971 * DEPRECATED: use xmlSAX2EntityDecl()
972 */
973void
Daniel Veillardf403d292003-10-05 13:51:35 +0000974entityDecl(void *ctx, const xmlChar * name, int type,
975 const xmlChar * publicId, const xmlChar * systemId,
976 xmlChar * content)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000977{
978 DEPRECATED("entityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +0000979 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000980}
981
982/**
983 * attributeDecl:
984 * @ctx: the user data (XML parser context)
985 * @elem: the name of the element
Daniel Veillardf8e3db02012-09-11 13:26:36 +0800986 * @fullname: the attribute name
987 * @type: the attribute type
Daniel Veillard8940fd52003-09-29 09:07:08 +0000988 * @def: the type of default value
989 * @defaultValue: the attribute default value
990 * @tree: the tree of enumerated value set
991 *
992 * An attribute definition has been parsed
993 * DEPRECATED: use xmlSAX2AttributeDecl()
994 */
995void
Daniel Veillardf403d292003-10-05 13:51:35 +0000996attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
997 int type, int def, const xmlChar * defaultValue,
998 xmlEnumerationPtr tree)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000999{
1000 DEPRECATED("attributeDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001001 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
1002 tree);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001003}
1004
1005/**
1006 * elementDecl:
1007 * @ctx: the user data (XML parser context)
Daniel Veillardf8e3db02012-09-11 13:26:36 +08001008 * @name: the element name
1009 * @type: the element type
Daniel Veillard8940fd52003-09-29 09:07:08 +00001010 * @content: the element value tree
1011 *
1012 * An element definition has been parsed
1013 * DEPRECATED: use xmlSAX2ElementDecl()
1014 */
1015void
1016elementDecl(void *ctx, const xmlChar * name, int type,
1017 xmlElementContentPtr content)
1018{
1019 DEPRECATED("elementDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001020 xmlSAX2ElementDecl(ctx, name, type, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001021}
1022
1023/**
1024 * notationDecl:
1025 * @ctx: the user data (XML parser context)
1026 * @name: The name of the notation
1027 * @publicId: The public ID of the entity
1028 * @systemId: The system ID of the entity
1029 *
1030 * What to do when a notation declaration has been parsed.
1031 * DEPRECATED: use xmlSAX2NotationDecl()
1032 */
1033void
Daniel Veillardf403d292003-10-05 13:51:35 +00001034notationDecl(void *ctx, const xmlChar * name,
1035 const xmlChar * publicId, const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001036{
1037 DEPRECATED("notationDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001038 xmlSAX2NotationDecl(ctx, name, publicId, systemId);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001039}
1040
1041/**
1042 * unparsedEntityDecl:
1043 * @ctx: the user data (XML parser context)
1044 * @name: The name of the entity
1045 * @publicId: The public ID of the entity
1046 * @systemId: The system ID of the entity
1047 * @notationName: the name of the notation
1048 *
1049 * What to do when an unparsed entity declaration is parsed
1050 * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
1051 */
1052void
Daniel Veillardf403d292003-10-05 13:51:35 +00001053unparsedEntityDecl(void *ctx, const xmlChar * name,
1054 const xmlChar * publicId, const xmlChar * systemId,
1055 const xmlChar * notationName)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001056{
1057 DEPRECATED("unparsedEntityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001058 xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
1059 notationName);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001060}
1061
1062/**
1063 * setDocumentLocator:
1064 * @ctx: the user data (XML parser context)
1065 * @loc: A SAX Locator
1066 *
1067 * Receive the document locator at startup, actually xmlDefaultSAXLocator
1068 * Everything is available on the context, so this is useless in our case.
1069 * DEPRECATED
1070 */
1071void
Daniel Veillardf403d292003-10-05 13:51:35 +00001072setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
1073 xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001074{
1075 DEPRECATED("setDocumentLocator")
1076}
1077
1078/**
1079 * startDocument:
1080 * @ctx: the user data (XML parser context)
1081 *
1082 * called when the document start being processed.
1083 * DEPRECATED: use xmlSAX2StartDocument()
1084 */
1085void
1086startDocument(void *ctx)
1087{
Daniel Veillard4aede2e2003-10-17 12:43:59 +00001088 /* don't be too painful for glade users */
1089 /* DEPRECATED("startDocument") */
Daniel Veillardf403d292003-10-05 13:51:35 +00001090 xmlSAX2StartDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001091}
1092
1093/**
1094 * endDocument:
1095 * @ctx: the user data (XML parser context)
1096 *
1097 * called when the document end has been detected.
1098 * DEPRECATED: use xmlSAX2EndDocument()
1099 */
1100void
1101endDocument(void *ctx)
1102{
1103 DEPRECATED("endDocument")
Daniel Veillardf403d292003-10-05 13:51:35 +00001104 xmlSAX2EndDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001105}
1106
1107/**
1108 * attribute:
1109 * @ctx: the user data (XML parser context)
1110 * @fullname: The attribute name, including namespace prefix
1111 * @value: The attribute value
1112 *
1113 * Handle an attribute that has been read by the parser.
1114 * The default handling is to convert the attribute into an
1115 * DOM subtree and past it in a new xmlAttr element added to
1116 * the element.
1117 * DEPRECATED: use xmlSAX2Attribute()
1118 */
1119void
Daniel Veillardf403d292003-10-05 13:51:35 +00001120attribute(void *ctx ATTRIBUTE_UNUSED,
1121 const xmlChar * fullname ATTRIBUTE_UNUSED,
1122 const xmlChar * value ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001123{
1124 DEPRECATED("attribute")
1125}
1126
1127/**
1128 * startElement:
1129 * @ctx: the user data (XML parser context)
1130 * @fullname: The element name, including namespace prefix
1131 * @atts: An array of name/value attributes pairs, NULL terminated
1132 *
1133 * called when an opening tag has been processed.
1134 * DEPRECATED: use xmlSAX2StartElement()
1135 */
1136void
Daniel Veillardf403d292003-10-05 13:51:35 +00001137startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001138{
Daniel Veillard509028f2003-12-24 11:10:17 +00001139 xmlSAX2StartElement(ctx, fullname, atts);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001140}
1141
1142/**
1143 * endElement:
1144 * @ctx: the user data (XML parser context)
1145 * @name: The element name
1146 *
1147 * called when the end of an element has been detected.
1148 * DEPRECATED: use xmlSAX2EndElement()
1149 */
1150void
Daniel Veillardf403d292003-10-05 13:51:35 +00001151endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001152{
1153 DEPRECATED("endElement")
Nicolas Le Cam77b5b462014-02-10 10:32:45 +08001154 xmlSAX2EndElement(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001155}
1156
1157/**
1158 * reference:
1159 * @ctx: the user data (XML parser context)
1160 * @name: The entity name
1161 *
Daniel Veillardf8e3db02012-09-11 13:26:36 +08001162 * called when an entity reference is detected.
Daniel Veillard8940fd52003-09-29 09:07:08 +00001163 * DEPRECATED: use xmlSAX2Reference()
1164 */
1165void
Daniel Veillardf403d292003-10-05 13:51:35 +00001166reference(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001167{
1168 DEPRECATED("reference")
Daniel Veillardf403d292003-10-05 13:51:35 +00001169 xmlSAX2Reference(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001170}
1171
1172/**
1173 * characters:
1174 * @ctx: the user data (XML parser context)
1175 * @ch: a xmlChar string
1176 * @len: the number of xmlChar
1177 *
1178 * receiving some chars from the parser.
1179 * DEPRECATED: use xmlSAX2Characters()
1180 */
1181void
Daniel Veillardf403d292003-10-05 13:51:35 +00001182characters(void *ctx, const xmlChar * ch, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001183{
1184 DEPRECATED("characters")
Daniel Veillardf403d292003-10-05 13:51:35 +00001185 xmlSAX2Characters(ctx, ch, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001186}
1187
1188/**
1189 * ignorableWhitespace:
1190 * @ctx: the user data (XML parser context)
1191 * @ch: a xmlChar string
1192 * @len: the number of xmlChar
1193 *
1194 * receiving some ignorable whitespaces from the parser.
1195 * UNUSED: by default the DOM building will use characters
1196 * DEPRECATED: use xmlSAX2IgnorableWhitespace()
1197 */
1198void
Daniel Veillardf403d292003-10-05 13:51:35 +00001199ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
1200 const xmlChar * ch ATTRIBUTE_UNUSED,
1201 int len ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001202{
1203 DEPRECATED("ignorableWhitespace")
1204}
1205
1206/**
1207 * processingInstruction:
1208 * @ctx: the user data (XML parser context)
1209 * @target: the target name
1210 * @data: the PI data's
1211 *
1212 * A processing instruction has been parsed.
1213 * DEPRECATED: use xmlSAX2ProcessingInstruction()
1214 */
1215void
Daniel Veillardf403d292003-10-05 13:51:35 +00001216processingInstruction(void *ctx, const xmlChar * target,
1217 const xmlChar * data)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001218{
1219 DEPRECATED("processingInstruction")
Daniel Veillardf403d292003-10-05 13:51:35 +00001220 xmlSAX2ProcessingInstruction(ctx, target, data);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001221}
1222
1223/**
1224 * globalNamespace:
1225 * @ctx: the user data (XML parser context)
1226 * @href: the namespace associated URN
1227 * @prefix: the namespace prefix
1228 *
1229 * An old global namespace has been parsed.
1230 * DEPRECATED
1231 */
1232void
Daniel Veillardf403d292003-10-05 13:51:35 +00001233globalNamespace(void *ctx ATTRIBUTE_UNUSED,
1234 const xmlChar * href ATTRIBUTE_UNUSED,
1235 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001236{
1237 DEPRECATED("globalNamespace")
1238}
1239
1240/**
1241 * setNamespace:
1242 * @ctx: the user data (XML parser context)
1243 * @name: the namespace prefix
1244 *
1245 * Set the current element namespace.
1246 * DEPRECATED
1247 */
1248
1249void
Daniel Veillardf403d292003-10-05 13:51:35 +00001250setNamespace(void *ctx ATTRIBUTE_UNUSED,
1251 const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001252{
1253 DEPRECATED("setNamespace")
1254}
1255
1256/**
1257 * getNamespace:
1258 * @ctx: the user data (XML parser context)
1259 *
1260 * Get the current element namespace.
1261 * DEPRECATED
1262 *
1263 * Returns the xmlNsPtr or NULL if none
1264 */
1265
1266xmlNsPtr
1267getNamespace(void *ctx ATTRIBUTE_UNUSED)
1268{
1269 DEPRECATED("getNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001270 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001271}
1272
1273/**
1274 * checkNamespace:
1275 * @ctx: the user data (XML parser context)
1276 * @namespace: the namespace to check against
1277 *
1278 * Check that the current element namespace is the same as the
1279 * one read upon parsing.
1280 * DEPRECATED
1281 *
1282 * Returns 1 if true 0 otherwise
1283 */
1284
1285int
Daniel Veillardf403d292003-10-05 13:51:35 +00001286checkNamespace(void *ctx ATTRIBUTE_UNUSED,
1287 xmlChar * namespace ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001288{
1289 DEPRECATED("checkNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001290 return (0);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001291}
1292
1293/**
1294 * namespaceDecl:
1295 * @ctx: the user data (XML parser context)
1296 * @href: the namespace associated URN
1297 * @prefix: the namespace prefix
1298 *
1299 * A namespace has been parsed.
1300 * DEPRECATED
1301 */
1302void
Daniel Veillardf403d292003-10-05 13:51:35 +00001303namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
1304 const xmlChar * href ATTRIBUTE_UNUSED,
1305 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001306{
1307 DEPRECATED("namespaceDecl")
1308}
1309
1310/**
1311 * comment:
1312 * @ctx: the user data (XML parser context)
1313 * @value: the comment content
1314 *
1315 * A comment has been parsed.
1316 * DEPRECATED: use xmlSAX2Comment()
1317 */
1318void
Daniel Veillardf403d292003-10-05 13:51:35 +00001319comment(void *ctx, const xmlChar * value)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001320{
1321 DEPRECATED("comment")
Daniel Veillardf403d292003-10-05 13:51:35 +00001322 xmlSAX2Comment(ctx, value);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001323}
1324
1325/**
1326 * cdataBlock:
1327 * @ctx: the user data (XML parser context)
1328 * @value: The pcdata content
1329 * @len: the block length
1330 *
1331 * called when a pcdata block has been parsed
1332 * DEPRECATED: use xmlSAX2CDataBlock()
1333 */
1334void
Daniel Veillardf403d292003-10-05 13:51:35 +00001335cdataBlock(void *ctx, const xmlChar * value, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001336{
1337 DEPRECATED("cdataBlock")
Daniel Veillardf403d292003-10-05 13:51:35 +00001338 xmlSAX2CDataBlock(ctx, value, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001339}
Daniel Veillard5d4644e2005-04-01 13:11:58 +00001340#define bottom_legacy
1341#include "elfgcchack.h"
Daniel Veillard8940fd52003-09-29 09:07:08 +00001342#endif /* LIBXML_LEGACY_ENABLED */
1343