blob: bbbd2c98eb1ec73b91baf8774d99ae2f28e79445 [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
396 *
397 * 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
459 * @prefix: a xmlChar **
460 *
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
606 *
607 * 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
618 * of the following entities: amp, lt, gt, apos, quot.
619 *
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
627 * the handling is done accordingly to
628 * 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 !!!
676 * It now create a namespace on the root element of the document if found.
677 * Returns NULL this functionality had been removed
678 */
679xmlNsPtr
680xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
681 const xmlChar * href ATTRIBUTE_UNUSED,
682 const xmlChar * prefix ATTRIBUTE_UNUSED)
683{
684 static int deprecated = 0;
685
686 if (!deprecated) {
687 xmlGenericError(xmlGenericErrorContext,
688 "xmlNewGlobalNs() deprecated function reached\n");
689 deprecated = 1;
690 }
691 return (NULL);
692}
693
694/**
695 * xmlUpgradeOldNs:
696 * @doc: a document pointer
697 *
698 * Upgrade old style Namespaces (PI) and move them to the root of the document.
699 * DEPRECATED
700 */
701void
702xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
703{
704 static int deprecated = 0;
705
706 if (!deprecated) {
707 xmlGenericError(xmlGenericErrorContext,
708 "xmlUpgradeOldNs() deprecated function reached\n");
709 deprecated = 1;
710 }
711}
712
713/**
714 * xmlEncodeEntities:
715 * @doc: the document containing the string
716 * @input: A string to convert to XML.
717 *
718 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
719 * compatibility
720 *
721 * People must migrate their code to xmlEncodeEntitiesReentrant !
722 * This routine will issue a warning when encountered.
723 *
724 * Returns NULL
725 */
726const xmlChar *
727xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
Daniel Veillardf403d292003-10-05 13:51:35 +0000728 const xmlChar * input ATTRIBUTE_UNUSED)
729{
Daniel Veillard8940fd52003-09-29 09:07:08 +0000730 static int warning = 1;
731
732 if (warning) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000733 xmlGenericError(xmlGenericErrorContext,
734 "Deprecated API xmlEncodeEntities() used\n");
735 xmlGenericError(xmlGenericErrorContext,
736 " change code to use xmlEncodeEntitiesReentrant()\n");
737 warning = 0;
Daniel Veillard8940fd52003-09-29 09:07:08 +0000738 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000739 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000740}
741
742/************************************************************************
743 * *
744 * Old set of SAXv1 functions *
745 * *
746 ************************************************************************/
747static int deprecated_v1_msg = 0;
748
749#define DEPRECATED(n) \
750 if (deprecated_v1_msg == 0) \
751 xmlGenericError(xmlGenericErrorContext, \
752 "Use of deprecated SAXv1 function %s\n", n); \
753 deprecated_v1_msg++;
754
755/**
756 * getPublicId:
757 * @ctx: the user data (XML parser context)
758 *
759 * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
760 * DEPRECATED: use xmlSAX2GetPublicId()
761 *
762 * Returns a xmlChar *
763 */
764const xmlChar *
765getPublicId(void *ctx)
766{
767 DEPRECATED("getPublicId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000768 return (xmlSAX2GetPublicId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000769}
770
771/**
772 * getSystemId:
773 * @ctx: the user data (XML parser context)
774 *
775 * Provides the system ID, basically URL or filename e.g.
776 * http://www.sgmlsource.com/dtds/memo.dtd
777 * DEPRECATED: use xmlSAX2GetSystemId()
778 *
779 * Returns a xmlChar *
780 */
781const xmlChar *
782getSystemId(void *ctx)
783{
784 DEPRECATED("getSystemId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000785 return (xmlSAX2GetSystemId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000786}
787
788/**
789 * getLineNumber:
790 * @ctx: the user data (XML parser context)
791 *
792 * Provide the line number of the current parsing point.
793 * DEPRECATED: use xmlSAX2GetLineNumber()
794 *
795 * Returns an int
796 */
797int
798getLineNumber(void *ctx)
799{
800 DEPRECATED("getLineNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000801 return (xmlSAX2GetLineNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000802}
803
804/**
805 * getColumnNumber:
806 * @ctx: the user data (XML parser context)
807 *
808 * Provide the column number of the current parsing point.
809 * DEPRECATED: use xmlSAX2GetColumnNumber()
810 *
811 * Returns an int
812 */
813int
814getColumnNumber(void *ctx)
815{
816 DEPRECATED("getColumnNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000817 return (xmlSAX2GetColumnNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000818}
819
820/**
821 * isStandalone:
822 * @ctx: the user data (XML parser context)
823 *
824 * Is this document tagged standalone ?
825 * DEPRECATED: use xmlSAX2IsStandalone()
826 *
827 * Returns 1 if true
828 */
829int
830isStandalone(void *ctx)
831{
832 DEPRECATED("isStandalone")
Daniel Veillardf403d292003-10-05 13:51:35 +0000833 return (xmlSAX2IsStandalone(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000834}
835
836/**
837 * hasInternalSubset:
838 * @ctx: the user data (XML parser context)
839 *
840 * Does this document has an internal subset
841 * DEPRECATED: use xmlSAX2HasInternalSubset()
842 *
843 * Returns 1 if true
844 */
845int
846hasInternalSubset(void *ctx)
847{
848 DEPRECATED("hasInternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000849 return (xmlSAX2HasInternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000850}
851
852/**
853 * hasExternalSubset:
854 * @ctx: the user data (XML parser context)
855 *
856 * Does this document has an external subset
857 * DEPRECATED: use xmlSAX2HasExternalSubset()
858 *
859 * Returns 1 if true
860 */
861int
862hasExternalSubset(void *ctx)
863{
864 DEPRECATED("hasExternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000865 return (xmlSAX2HasExternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000866}
867
868/**
869 * internalSubset:
870 * @ctx: the user data (XML parser context)
871 * @name: the root element name
872 * @ExternalID: the external ID
873 * @SystemID: the SYSTEM ID (e.g. filename or URL)
874 *
875 * Callback on internal subset declaration.
876 * DEPRECATED: use xmlSAX2InternalSubset()
877 */
878void
Daniel Veillardf403d292003-10-05 13:51:35 +0000879internalSubset(void *ctx, const xmlChar * name,
880 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000881{
882 DEPRECATED("internalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000883 xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000884}
885
886/**
887 * externalSubset:
888 * @ctx: the user data (XML parser context)
889 * @name: the root element name
890 * @ExternalID: the external ID
891 * @SystemID: the SYSTEM ID (e.g. filename or URL)
892 *
893 * Callback on external subset declaration.
894 * DEPRECATED: use xmlSAX2ExternalSubset()
895 */
896void
Daniel Veillardf403d292003-10-05 13:51:35 +0000897externalSubset(void *ctx, const xmlChar * name,
898 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000899{
900 DEPRECATED("externalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000901 xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000902}
903
904/**
905 * resolveEntity:
906 * @ctx: the user data (XML parser context)
907 * @publicId: The public ID of the entity
908 * @systemId: The system ID of the entity
909 *
910 * The entity loader, to control the loading of external entities,
911 * the application can either:
912 * - override this resolveEntity() callback in the SAX block
913 * - or better use the xmlSetExternalEntityLoader() function to
914 * set up it's own entity resolution routine
915 * DEPRECATED: use xmlSAX2ResolveEntity()
916 *
917 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
918 */
919xmlParserInputPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000920resolveEntity(void *ctx, const xmlChar * publicId,
921 const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000922{
923 DEPRECATED("resolveEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000924 return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000925}
926
927/**
928 * getEntity:
929 * @ctx: the user data (XML parser context)
930 * @name: The entity name
931 *
932 * Get an entity by name
933 * DEPRECATED: use xmlSAX2GetEntity()
934 *
935 * Returns the xmlEntityPtr if found.
936 */
937xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000938getEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000939{
940 DEPRECATED("getEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000941 return (xmlSAX2GetEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000942}
943
944/**
945 * getParameterEntity:
946 * @ctx: the user data (XML parser context)
947 * @name: The entity name
948 *
949 * Get a parameter entity by name
950 * DEPRECATED: use xmlSAX2GetParameterEntity()
951 *
952 * Returns the xmlEntityPtr if found.
953 */
954xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000955getParameterEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000956{
957 DEPRECATED("getParameterEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000958 return (xmlSAX2GetParameterEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000959}
960
961
962/**
963 * entityDecl:
964 * @ctx: the user data (XML parser context)
965 * @name: the entity name
966 * @type: the entity type
967 * @publicId: The public ID of the entity
968 * @systemId: The system ID of the entity
969 * @content: the entity value (without processing).
970 *
971 * An entity definition has been parsed
972 * DEPRECATED: use xmlSAX2EntityDecl()
973 */
974void
Daniel Veillardf403d292003-10-05 13:51:35 +0000975entityDecl(void *ctx, const xmlChar * name, int type,
976 const xmlChar * publicId, const xmlChar * systemId,
977 xmlChar * content)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000978{
979 DEPRECATED("entityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +0000980 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000981}
982
983/**
984 * attributeDecl:
985 * @ctx: the user data (XML parser context)
986 * @elem: the name of the element
987 * @fullname: the attribute name
988 * @type: the attribute type
989 * @def: the type of default value
990 * @defaultValue: the attribute default value
991 * @tree: the tree of enumerated value set
992 *
993 * An attribute definition has been parsed
994 * DEPRECATED: use xmlSAX2AttributeDecl()
995 */
996void
Daniel Veillardf403d292003-10-05 13:51:35 +0000997attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
998 int type, int def, const xmlChar * defaultValue,
999 xmlEnumerationPtr tree)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001000{
1001 DEPRECATED("attributeDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001002 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
1003 tree);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001004}
1005
1006/**
1007 * elementDecl:
1008 * @ctx: the user data (XML parser context)
1009 * @name: the element name
1010 * @type: the element type
1011 * @content: the element value tree
1012 *
1013 * An element definition has been parsed
1014 * DEPRECATED: use xmlSAX2ElementDecl()
1015 */
1016void
1017elementDecl(void *ctx, const xmlChar * name, int type,
1018 xmlElementContentPtr content)
1019{
1020 DEPRECATED("elementDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001021 xmlSAX2ElementDecl(ctx, name, type, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001022}
1023
1024/**
1025 * notationDecl:
1026 * @ctx: the user data (XML parser context)
1027 * @name: The name of the notation
1028 * @publicId: The public ID of the entity
1029 * @systemId: The system ID of the entity
1030 *
1031 * What to do when a notation declaration has been parsed.
1032 * DEPRECATED: use xmlSAX2NotationDecl()
1033 */
1034void
Daniel Veillardf403d292003-10-05 13:51:35 +00001035notationDecl(void *ctx, const xmlChar * name,
1036 const xmlChar * publicId, const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001037{
1038 DEPRECATED("notationDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001039 xmlSAX2NotationDecl(ctx, name, publicId, systemId);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001040}
1041
1042/**
1043 * unparsedEntityDecl:
1044 * @ctx: the user data (XML parser context)
1045 * @name: The name of the entity
1046 * @publicId: The public ID of the entity
1047 * @systemId: The system ID of the entity
1048 * @notationName: the name of the notation
1049 *
1050 * What to do when an unparsed entity declaration is parsed
1051 * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
1052 */
1053void
Daniel Veillardf403d292003-10-05 13:51:35 +00001054unparsedEntityDecl(void *ctx, const xmlChar * name,
1055 const xmlChar * publicId, const xmlChar * systemId,
1056 const xmlChar * notationName)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001057{
1058 DEPRECATED("unparsedEntityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001059 xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
1060 notationName);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001061}
1062
1063/**
1064 * setDocumentLocator:
1065 * @ctx: the user data (XML parser context)
1066 * @loc: A SAX Locator
1067 *
1068 * Receive the document locator at startup, actually xmlDefaultSAXLocator
1069 * Everything is available on the context, so this is useless in our case.
1070 * DEPRECATED
1071 */
1072void
Daniel Veillardf403d292003-10-05 13:51:35 +00001073setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
1074 xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001075{
1076 DEPRECATED("setDocumentLocator")
1077}
1078
1079/**
1080 * startDocument:
1081 * @ctx: the user data (XML parser context)
1082 *
1083 * called when the document start being processed.
1084 * DEPRECATED: use xmlSAX2StartDocument()
1085 */
1086void
1087startDocument(void *ctx)
1088{
Daniel Veillard4aede2e2003-10-17 12:43:59 +00001089 /* don't be too painful for glade users */
1090 /* DEPRECATED("startDocument") */
Daniel Veillardf403d292003-10-05 13:51:35 +00001091 xmlSAX2StartDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001092}
1093
1094/**
1095 * endDocument:
1096 * @ctx: the user data (XML parser context)
1097 *
1098 * called when the document end has been detected.
1099 * DEPRECATED: use xmlSAX2EndDocument()
1100 */
1101void
1102endDocument(void *ctx)
1103{
1104 DEPRECATED("endDocument")
Daniel Veillardf403d292003-10-05 13:51:35 +00001105 xmlSAX2EndDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001106}
1107
1108/**
1109 * attribute:
1110 * @ctx: the user data (XML parser context)
1111 * @fullname: The attribute name, including namespace prefix
1112 * @value: The attribute value
1113 *
1114 * Handle an attribute that has been read by the parser.
1115 * The default handling is to convert the attribute into an
1116 * DOM subtree and past it in a new xmlAttr element added to
1117 * the element.
1118 * DEPRECATED: use xmlSAX2Attribute()
1119 */
1120void
Daniel Veillardf403d292003-10-05 13:51:35 +00001121attribute(void *ctx ATTRIBUTE_UNUSED,
1122 const xmlChar * fullname ATTRIBUTE_UNUSED,
1123 const xmlChar * value ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001124{
1125 DEPRECATED("attribute")
1126}
1127
1128/**
1129 * startElement:
1130 * @ctx: the user data (XML parser context)
1131 * @fullname: The element name, including namespace prefix
1132 * @atts: An array of name/value attributes pairs, NULL terminated
1133 *
1134 * called when an opening tag has been processed.
1135 * DEPRECATED: use xmlSAX2StartElement()
1136 */
1137void
Daniel Veillardf403d292003-10-05 13:51:35 +00001138startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001139{
Daniel Veillard509028f2003-12-24 11:10:17 +00001140 xmlSAX2StartElement(ctx, fullname, atts);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001141}
1142
1143/**
1144 * endElement:
1145 * @ctx: the user data (XML parser context)
1146 * @name: The element name
1147 *
1148 * called when the end of an element has been detected.
1149 * DEPRECATED: use xmlSAX2EndElement()
1150 */
1151void
Daniel Veillardf403d292003-10-05 13:51:35 +00001152endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001153{
1154 DEPRECATED("endElement")
Daniel Veillardf403d292003-10-05 13:51:35 +00001155 xmlSAX2EndElement(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001156}
1157
1158/**
1159 * reference:
1160 * @ctx: the user data (XML parser context)
1161 * @name: The entity name
1162 *
1163 * called when an entity reference is detected.
1164 * DEPRECATED: use xmlSAX2Reference()
1165 */
1166void
Daniel Veillardf403d292003-10-05 13:51:35 +00001167reference(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001168{
1169 DEPRECATED("reference")
Daniel Veillardf403d292003-10-05 13:51:35 +00001170 xmlSAX2Reference(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001171}
1172
1173/**
1174 * characters:
1175 * @ctx: the user data (XML parser context)
1176 * @ch: a xmlChar string
1177 * @len: the number of xmlChar
1178 *
1179 * receiving some chars from the parser.
1180 * DEPRECATED: use xmlSAX2Characters()
1181 */
1182void
Daniel Veillardf403d292003-10-05 13:51:35 +00001183characters(void *ctx, const xmlChar * ch, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001184{
1185 DEPRECATED("characters")
Daniel Veillardf403d292003-10-05 13:51:35 +00001186 xmlSAX2Characters(ctx, ch, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001187}
1188
1189/**
1190 * ignorableWhitespace:
1191 * @ctx: the user data (XML parser context)
1192 * @ch: a xmlChar string
1193 * @len: the number of xmlChar
1194 *
1195 * receiving some ignorable whitespaces from the parser.
1196 * UNUSED: by default the DOM building will use characters
1197 * DEPRECATED: use xmlSAX2IgnorableWhitespace()
1198 */
1199void
Daniel Veillardf403d292003-10-05 13:51:35 +00001200ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
1201 const xmlChar * ch ATTRIBUTE_UNUSED,
1202 int len ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001203{
1204 DEPRECATED("ignorableWhitespace")
1205}
1206
1207/**
1208 * processingInstruction:
1209 * @ctx: the user data (XML parser context)
1210 * @target: the target name
1211 * @data: the PI data's
1212 *
1213 * A processing instruction has been parsed.
1214 * DEPRECATED: use xmlSAX2ProcessingInstruction()
1215 */
1216void
Daniel Veillardf403d292003-10-05 13:51:35 +00001217processingInstruction(void *ctx, const xmlChar * target,
1218 const xmlChar * data)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001219{
1220 DEPRECATED("processingInstruction")
Daniel Veillardf403d292003-10-05 13:51:35 +00001221 xmlSAX2ProcessingInstruction(ctx, target, data);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001222}
1223
1224/**
1225 * globalNamespace:
1226 * @ctx: the user data (XML parser context)
1227 * @href: the namespace associated URN
1228 * @prefix: the namespace prefix
1229 *
1230 * An old global namespace has been parsed.
1231 * DEPRECATED
1232 */
1233void
Daniel Veillardf403d292003-10-05 13:51:35 +00001234globalNamespace(void *ctx ATTRIBUTE_UNUSED,
1235 const xmlChar * href ATTRIBUTE_UNUSED,
1236 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001237{
1238 DEPRECATED("globalNamespace")
1239}
1240
1241/**
1242 * setNamespace:
1243 * @ctx: the user data (XML parser context)
1244 * @name: the namespace prefix
1245 *
1246 * Set the current element namespace.
1247 * DEPRECATED
1248 */
1249
1250void
Daniel Veillardf403d292003-10-05 13:51:35 +00001251setNamespace(void *ctx ATTRIBUTE_UNUSED,
1252 const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001253{
1254 DEPRECATED("setNamespace")
1255}
1256
1257/**
1258 * getNamespace:
1259 * @ctx: the user data (XML parser context)
1260 *
1261 * Get the current element namespace.
1262 * DEPRECATED
1263 *
1264 * Returns the xmlNsPtr or NULL if none
1265 */
1266
1267xmlNsPtr
1268getNamespace(void *ctx ATTRIBUTE_UNUSED)
1269{
1270 DEPRECATED("getNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001271 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001272}
1273
1274/**
1275 * checkNamespace:
1276 * @ctx: the user data (XML parser context)
1277 * @namespace: the namespace to check against
1278 *
1279 * Check that the current element namespace is the same as the
1280 * one read upon parsing.
1281 * DEPRECATED
1282 *
1283 * Returns 1 if true 0 otherwise
1284 */
1285
1286int
Daniel Veillardf403d292003-10-05 13:51:35 +00001287checkNamespace(void *ctx ATTRIBUTE_UNUSED,
1288 xmlChar * namespace ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001289{
1290 DEPRECATED("checkNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001291 return (0);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001292}
1293
1294/**
1295 * namespaceDecl:
1296 * @ctx: the user data (XML parser context)
1297 * @href: the namespace associated URN
1298 * @prefix: the namespace prefix
1299 *
1300 * A namespace has been parsed.
1301 * DEPRECATED
1302 */
1303void
Daniel Veillardf403d292003-10-05 13:51:35 +00001304namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
1305 const xmlChar * href ATTRIBUTE_UNUSED,
1306 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001307{
1308 DEPRECATED("namespaceDecl")
1309}
1310
1311/**
1312 * comment:
1313 * @ctx: the user data (XML parser context)
1314 * @value: the comment content
1315 *
1316 * A comment has been parsed.
1317 * DEPRECATED: use xmlSAX2Comment()
1318 */
1319void
Daniel Veillardf403d292003-10-05 13:51:35 +00001320comment(void *ctx, const xmlChar * value)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001321{
1322 DEPRECATED("comment")
Daniel Veillardf403d292003-10-05 13:51:35 +00001323 xmlSAX2Comment(ctx, value);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001324}
1325
1326/**
1327 * cdataBlock:
1328 * @ctx: the user data (XML parser context)
1329 * @value: The pcdata content
1330 * @len: the block length
1331 *
1332 * called when a pcdata block has been parsed
1333 * DEPRECATED: use xmlSAX2CDataBlock()
1334 */
1335void
Daniel Veillardf403d292003-10-05 13:51:35 +00001336cdataBlock(void *ctx, const xmlChar * value, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001337{
1338 DEPRECATED("cdataBlock")
Daniel Veillardf403d292003-10-05 13:51:35 +00001339 xmlSAX2CDataBlock(ctx, value, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001340}
Daniel Veillard5d4644e2005-04-01 13:11:58 +00001341#define bottom_legacy
1342#include "elfgcchack.h"
Daniel Veillard8940fd52003-09-29 09:07:08 +00001343#endif /* LIBXML_LEGACY_ENABLED */
1344