blob: 9ed74133f2d363f7f1b571156d52adcea4fcda46 [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 Veillardf403d292003-10-05 13:51:35 +000030xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end,
31 xmlChar end2, xmlChar end3);
32
33/**
34 * htmlDecodeEntities:
35 * @ctxt: the parser context
36 * @len: the len to decode (in bytes !), -1 for no size limit
37 * @end: an end marker xmlChar, 0 if none
38 * @end2: an end marker xmlChar, 0 if none
39 * @end3: an end marker xmlChar, 0 if none
40 *
41 * Substitute the HTML entities by their value
42 *
43 * DEPRECATED !!!!
44 *
45 * Returns A newly allocated string with the substitution done. The caller
46 * must deallocate it !
47 */
48xmlChar *
49htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
50 int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,
51 xmlChar end2 ATTRIBUTE_UNUSED,
52 xmlChar end3 ATTRIBUTE_UNUSED)
53{
54 static int deprecated = 0;
55
56 if (!deprecated) {
57 xmlGenericError(xmlGenericErrorContext,
58 "htmlDecodeEntities() deprecated function reached\n");
59 deprecated = 1;
60 }
61 return (NULL);
62}
63
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000064/**
65 * xmlInitializePredefinedEntities:
66 *
67 * Set up the predefined entities.
68 * Deprecated call
69 */
Daniel Veillardf403d292003-10-05 13:51:35 +000070void
71xmlInitializePredefinedEntities(void)
72{
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000073}
74
75/**
76 * xmlCleanupPredefinedEntities:
77 *
78 * Cleanup up the predefined entities table.
79 * Deprecated call
80 */
Daniel Veillardf403d292003-10-05 13:51:35 +000081void
82xmlCleanupPredefinedEntities(void)
83{
Daniel Veillardd3a2e4c2003-09-30 13:38:04 +000084}
85
Daniel Veillard73b013f2003-09-30 12:36:01 +000086static const char *xmlFeaturesList[] = {
87 "validate",
88 "load subset",
89 "keep blanks",
90 "disable SAX",
91 "fetch external entities",
92 "substitute entities",
93 "gather line info",
94 "user data",
95 "is html",
96 "is standalone",
97 "stop parser",
98 "document",
99 "is well formed",
100 "is valid",
101 "SAX block",
102 "SAX function internalSubset",
103 "SAX function isStandalone",
104 "SAX function hasInternalSubset",
105 "SAX function hasExternalSubset",
106 "SAX function resolveEntity",
107 "SAX function getEntity",
108 "SAX function entityDecl",
109 "SAX function notationDecl",
110 "SAX function attributeDecl",
111 "SAX function elementDecl",
112 "SAX function unparsedEntityDecl",
113 "SAX function setDocumentLocator",
114 "SAX function startDocument",
115 "SAX function endDocument",
116 "SAX function startElement",
117 "SAX function endElement",
118 "SAX function reference",
119 "SAX function characters",
120 "SAX function ignorableWhitespace",
121 "SAX function processingInstruction",
122 "SAX function comment",
123 "SAX function warning",
124 "SAX function error",
125 "SAX function fatalError",
126 "SAX function getParameterEntity",
127 "SAX function cdataBlock",
128 "SAX function externalSubset",
129};
130
131/**
132 * xmlGetFeaturesList:
133 * @len: the length of the features name array (input/output)
134 * @result: an array of string to be filled with the features name.
135 *
136 * Copy at most *@len feature names into the @result array
137 *
138 * Returns -1 in case or error, or the total number of features,
139 * len is updated with the number of strings copied,
140 * strings must not be deallocated
141 */
142int
Daniel Veillardf403d292003-10-05 13:51:35 +0000143xmlGetFeaturesList(int *len, const char **result)
144{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000145 int ret, i;
146
Daniel Veillardf403d292003-10-05 13:51:35 +0000147 ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000148 if ((len == NULL) || (result == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000149 return (ret);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000150 if ((*len < 0) || (*len >= 1000))
Daniel Veillardf403d292003-10-05 13:51:35 +0000151 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000152 if (*len > ret)
Daniel Veillardf403d292003-10-05 13:51:35 +0000153 *len = ret;
154 for (i = 0; i < *len; i++)
155 result[i] = xmlFeaturesList[i];
156 return (ret);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000157}
158
159/**
160 * xmlGetFeature:
161 * @ctxt: an XML/HTML parser context
162 * @name: the feature name
163 * @result: location to store the result
164 *
165 * Read the current value of one feature of this parser instance
166 *
167 * Returns -1 in case or error, 0 otherwise
168 */
169int
Daniel Veillardf403d292003-10-05 13:51:35 +0000170xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result)
171{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000172 if ((ctxt == NULL) || (name == NULL) || (result == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000173 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000174
175 if (!strcmp(name, "validate")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000176 *((int *) result) = ctxt->validate;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000177 } else if (!strcmp(name, "keep blanks")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000178 *((int *) result) = ctxt->keepBlanks;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000179 } else if (!strcmp(name, "disable SAX")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000180 *((int *) result) = ctxt->disableSAX;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000181 } else if (!strcmp(name, "fetch external entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000182 *((int *) result) = ctxt->loadsubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000183 } else if (!strcmp(name, "substitute entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000184 *((int *) result) = ctxt->replaceEntities;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000185 } else if (!strcmp(name, "gather line info")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000186 *((int *) result) = ctxt->record_info;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000187 } else if (!strcmp(name, "user data")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000188 *((void **) result) = ctxt->userData;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000189 } else if (!strcmp(name, "is html")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000190 *((int *) result) = ctxt->html;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000191 } else if (!strcmp(name, "is standalone")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000192 *((int *) result) = ctxt->standalone;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000193 } else if (!strcmp(name, "document")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000194 *((xmlDocPtr *) result) = ctxt->myDoc;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000195 } else if (!strcmp(name, "is well formed")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000196 *((int *) result) = ctxt->wellFormed;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000197 } else if (!strcmp(name, "is valid")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000198 *((int *) result) = ctxt->valid;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000199 } else if (!strcmp(name, "SAX block")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000200 *((xmlSAXHandlerPtr *) result) = ctxt->sax;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000201 } else if (!strcmp(name, "SAX function internalSubset")) {
202 *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset;
203 } else if (!strcmp(name, "SAX function isStandalone")) {
204 *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone;
205 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000206 *((hasInternalSubsetSAXFunc *) result) =
207 ctxt->sax->hasInternalSubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000208 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000209 *((hasExternalSubsetSAXFunc *) result) =
210 ctxt->sax->hasExternalSubset;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000211 } else if (!strcmp(name, "SAX function resolveEntity")) {
212 *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity;
213 } else if (!strcmp(name, "SAX function getEntity")) {
214 *((getEntitySAXFunc *) result) = ctxt->sax->getEntity;
215 } else if (!strcmp(name, "SAX function entityDecl")) {
216 *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl;
217 } else if (!strcmp(name, "SAX function notationDecl")) {
218 *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl;
219 } else if (!strcmp(name, "SAX function attributeDecl")) {
220 *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl;
221 } else if (!strcmp(name, "SAX function elementDecl")) {
222 *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl;
223 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000224 *((unparsedEntityDeclSAXFunc *) result) =
225 ctxt->sax->unparsedEntityDecl;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000226 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000227 *((setDocumentLocatorSAXFunc *) result) =
228 ctxt->sax->setDocumentLocator;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000229 } else if (!strcmp(name, "SAX function startDocument")) {
230 *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument;
231 } else if (!strcmp(name, "SAX function endDocument")) {
232 *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument;
233 } else if (!strcmp(name, "SAX function startElement")) {
234 *((startElementSAXFunc *) result) = ctxt->sax->startElement;
235 } else if (!strcmp(name, "SAX function endElement")) {
236 *((endElementSAXFunc *) result) = ctxt->sax->endElement;
237 } else if (!strcmp(name, "SAX function reference")) {
238 *((referenceSAXFunc *) result) = ctxt->sax->reference;
239 } else if (!strcmp(name, "SAX function characters")) {
240 *((charactersSAXFunc *) result) = ctxt->sax->characters;
241 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000242 *((ignorableWhitespaceSAXFunc *) result) =
243 ctxt->sax->ignorableWhitespace;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000244 } else if (!strcmp(name, "SAX function processingInstruction")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000245 *((processingInstructionSAXFunc *) result) =
246 ctxt->sax->processingInstruction;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000247 } else if (!strcmp(name, "SAX function comment")) {
248 *((commentSAXFunc *) result) = ctxt->sax->comment;
249 } else if (!strcmp(name, "SAX function warning")) {
250 *((warningSAXFunc *) result) = ctxt->sax->warning;
251 } else if (!strcmp(name, "SAX function error")) {
252 *((errorSAXFunc *) result) = ctxt->sax->error;
253 } else if (!strcmp(name, "SAX function fatalError")) {
254 *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError;
255 } else if (!strcmp(name, "SAX function getParameterEntity")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000256 *((getParameterEntitySAXFunc *) result) =
257 ctxt->sax->getParameterEntity;
Daniel Veillard73b013f2003-09-30 12:36:01 +0000258 } else if (!strcmp(name, "SAX function cdataBlock")) {
259 *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock;
260 } else if (!strcmp(name, "SAX function externalSubset")) {
261 *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset;
262 } else {
Daniel Veillardf403d292003-10-05 13:51:35 +0000263 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000264 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000265 return (0);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000266}
267
268/**
269 * xmlSetFeature:
270 * @ctxt: an XML/HTML parser context
271 * @name: the feature name
272 * @value: pointer to the location of the new value
273 *
274 * Change the current value of one feature of this parser instance
275 *
276 * Returns -1 in case or error, 0 otherwise
277 */
Daniel Veillardf403d292003-10-05 13:51:35 +0000278int
279xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value)
280{
Daniel Veillard73b013f2003-09-30 12:36:01 +0000281 if ((ctxt == NULL) || (name == NULL) || (value == NULL))
Daniel Veillardf403d292003-10-05 13:51:35 +0000282 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000283
284 if (!strcmp(name, "validate")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000285 int newvalidate = *((int *) value);
286
287 if ((!ctxt->validate) && (newvalidate != 0)) {
288 if (ctxt->vctxt.warning == NULL)
289 ctxt->vctxt.warning = xmlParserValidityWarning;
290 if (ctxt->vctxt.error == NULL)
291 ctxt->vctxt.error = xmlParserValidityError;
292 ctxt->vctxt.nodeMax = 0;
293 }
Daniel Veillard73b013f2003-09-30 12:36:01 +0000294 ctxt->validate = newvalidate;
295 } else if (!strcmp(name, "keep blanks")) {
296 ctxt->keepBlanks = *((int *) value);
297 } else if (!strcmp(name, "disable SAX")) {
298 ctxt->disableSAX = *((int *) value);
299 } else if (!strcmp(name, "fetch external entities")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000300 ctxt->loadsubset = *((int *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000301 } else if (!strcmp(name, "substitute entities")) {
302 ctxt->replaceEntities = *((int *) value);
303 } else if (!strcmp(name, "gather line info")) {
304 ctxt->record_info = *((int *) value);
305 } else if (!strcmp(name, "user data")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000306 ctxt->userData = *((void **) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000307 } else if (!strcmp(name, "is html")) {
308 ctxt->html = *((int *) value);
309 } else if (!strcmp(name, "is standalone")) {
310 ctxt->standalone = *((int *) value);
311 } else if (!strcmp(name, "document")) {
312 ctxt->myDoc = *((xmlDocPtr *) value);
313 } else if (!strcmp(name, "is well formed")) {
314 ctxt->wellFormed = *((int *) value);
315 } else if (!strcmp(name, "is valid")) {
316 ctxt->valid = *((int *) value);
317 } else if (!strcmp(name, "SAX block")) {
318 ctxt->sax = *((xmlSAXHandlerPtr *) value);
319 } else if (!strcmp(name, "SAX function internalSubset")) {
320 ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value);
321 } else if (!strcmp(name, "SAX function isStandalone")) {
322 ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value);
323 } else if (!strcmp(name, "SAX function hasInternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000324 ctxt->sax->hasInternalSubset =
325 *((hasInternalSubsetSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000326 } else if (!strcmp(name, "SAX function hasExternalSubset")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000327 ctxt->sax->hasExternalSubset =
328 *((hasExternalSubsetSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000329 } else if (!strcmp(name, "SAX function resolveEntity")) {
330 ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value);
331 } else if (!strcmp(name, "SAX function getEntity")) {
332 ctxt->sax->getEntity = *((getEntitySAXFunc *) value);
333 } else if (!strcmp(name, "SAX function entityDecl")) {
334 ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value);
335 } else if (!strcmp(name, "SAX function notationDecl")) {
336 ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value);
337 } else if (!strcmp(name, "SAX function attributeDecl")) {
338 ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value);
339 } else if (!strcmp(name, "SAX function elementDecl")) {
340 ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value);
341 } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000342 ctxt->sax->unparsedEntityDecl =
343 *((unparsedEntityDeclSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000344 } else if (!strcmp(name, "SAX function setDocumentLocator")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000345 ctxt->sax->setDocumentLocator =
346 *((setDocumentLocatorSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000347 } else if (!strcmp(name, "SAX function startDocument")) {
348 ctxt->sax->startDocument = *((startDocumentSAXFunc *) value);
349 } else if (!strcmp(name, "SAX function endDocument")) {
350 ctxt->sax->endDocument = *((endDocumentSAXFunc *) value);
351 } else if (!strcmp(name, "SAX function startElement")) {
352 ctxt->sax->startElement = *((startElementSAXFunc *) value);
353 } else if (!strcmp(name, "SAX function endElement")) {
354 ctxt->sax->endElement = *((endElementSAXFunc *) value);
355 } else if (!strcmp(name, "SAX function reference")) {
356 ctxt->sax->reference = *((referenceSAXFunc *) value);
357 } else if (!strcmp(name, "SAX function characters")) {
358 ctxt->sax->characters = *((charactersSAXFunc *) value);
359 } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000360 ctxt->sax->ignorableWhitespace =
361 *((ignorableWhitespaceSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000362 } else if (!strcmp(name, "SAX function processingInstruction")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000363 ctxt->sax->processingInstruction =
364 *((processingInstructionSAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000365 } else if (!strcmp(name, "SAX function comment")) {
366 ctxt->sax->comment = *((commentSAXFunc *) value);
367 } else if (!strcmp(name, "SAX function warning")) {
368 ctxt->sax->warning = *((warningSAXFunc *) value);
369 } else if (!strcmp(name, "SAX function error")) {
370 ctxt->sax->error = *((errorSAXFunc *) value);
371 } else if (!strcmp(name, "SAX function fatalError")) {
372 ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value);
373 } else if (!strcmp(name, "SAX function getParameterEntity")) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000374 ctxt->sax->getParameterEntity =
375 *((getParameterEntitySAXFunc *) value);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000376 } else if (!strcmp(name, "SAX function cdataBlock")) {
377 ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value);
378 } else if (!strcmp(name, "SAX function externalSubset")) {
379 ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value);
380 } else {
Daniel Veillardf403d292003-10-05 13:51:35 +0000381 return (-1);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000382 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000383 return (0);
Daniel Veillard73b013f2003-09-30 12:36:01 +0000384}
385
Daniel Veillard8940fd52003-09-29 09:07:08 +0000386/**
387 * xmlDecodeEntities:
388 * @ctxt: the parser context
389 * @len: the len to decode (in bytes !), -1 for no size limit
390 * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
391 * @end: an end marker xmlChar, 0 if none
392 * @end2: an end marker xmlChar, 0 if none
393 * @end3: an end marker xmlChar, 0 if none
394 *
395 * This function is deprecated, we now always process entities content
396 * through xmlStringDecodeEntities
397 *
398 * TODO: remove it in next major release.
399 *
400 * [67] Reference ::= EntityRef | CharRef
401 *
402 * [69] PEReference ::= '%' Name ';'
403 *
404 * Returns A newly allocated string with the substitution done. The caller
405 * must deallocate it !
406 */
407xmlChar *
408xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
409 int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
410 xmlChar end ATTRIBUTE_UNUSED,
411 xmlChar end2 ATTRIBUTE_UNUSED,
412 xmlChar end3 ATTRIBUTE_UNUSED)
413{
414 static int deprecated = 0;
415
416 if (!deprecated) {
417 xmlGenericError(xmlGenericErrorContext,
418 "xmlDecodeEntities() deprecated function reached\n");
419 deprecated = 1;
420 }
421 return (NULL);
422}
423
424/**
425 * xmlNamespaceParseNCName:
426 * @ctxt: an XML parser context
427 *
428 * parse an XML namespace name.
429 *
430 * TODO: this seems not in use anymore, the namespace handling is done on
431 * top of the SAX interfaces, i.e. not on raw input.
432 *
433 * [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
434 *
435 * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
436 * CombiningChar | Extender
437 *
438 * Returns the namespace name or NULL
439 */
440
441xmlChar *
442xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
443{
444 static int deprecated = 0;
445
446 if (!deprecated) {
447 xmlGenericError(xmlGenericErrorContext,
448 "xmlNamespaceParseNCName() deprecated function reached\n");
449 deprecated = 1;
450 }
451 return (NULL);
452}
453
454/**
455 * xmlNamespaceParseQName:
456 * @ctxt: an XML parser context
457 * @prefix: a xmlChar **
458 *
459 * TODO: this seems not in use anymore, the namespace handling is done on
460 * top of the SAX interfaces, i.e. not on raw input.
461 *
462 * parse an XML qualified name
463 *
464 * [NS 5] QName ::= (Prefix ':')? LocalPart
465 *
466 * [NS 6] Prefix ::= NCName
467 *
468 * [NS 7] LocalPart ::= NCName
469 *
470 * Returns the local part, and prefix is updated
471 * to get the Prefix if any.
472 */
473
474xmlChar *
475xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
476 xmlChar ** prefix ATTRIBUTE_UNUSED)
477{
478
479 static int deprecated = 0;
480
481 if (!deprecated) {
482 xmlGenericError(xmlGenericErrorContext,
483 "xmlNamespaceParseQName() deprecated function reached\n");
484 deprecated = 1;
485 }
486 return (NULL);
487}
488
489/**
490 * xmlNamespaceParseNSDef:
491 * @ctxt: an XML parser context
492 *
493 * parse a namespace prefix declaration
494 *
495 * TODO: this seems not in use anymore, the namespace handling is done on
496 * top of the SAX interfaces, i.e. not on raw input.
497 *
498 * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
499 *
500 * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
501 *
502 * Returns the namespace name
503 */
504
505xmlChar *
506xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
507{
508 static int deprecated = 0;
509
510 if (!deprecated) {
511 xmlGenericError(xmlGenericErrorContext,
512 "xmlNamespaceParseNSDef() deprecated function reached\n");
513 deprecated = 1;
514 }
515 return (NULL);
516}
517
518/**
519 * xmlParseQuotedString:
520 * @ctxt: an XML parser context
521 *
522 * Parse and return a string between quotes or doublequotes
523 *
524 * TODO: Deprecated, to be removed at next drop of binary compatibility
525 *
526 * Returns the string parser or NULL.
527 */
528xmlChar *
529xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
530{
531 static int deprecated = 0;
532
533 if (!deprecated) {
534 xmlGenericError(xmlGenericErrorContext,
535 "xmlParseQuotedString() deprecated function reached\n");
536 deprecated = 1;
537 }
538 return (NULL);
539}
540
541/**
542 * xmlParseNamespace:
543 * @ctxt: an XML parser context
544 *
545 * xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
546 *
547 * This is what the older xml-name Working Draft specified, a bunch of
548 * other stuff may still rely on it, so support is still here as
549 * if it was declared on the root of the Tree:-(
550 *
551 * TODO: remove from library
552 *
553 * To be removed at next drop of binary compatibility
554 */
555
556void
557xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
558{
559 static int deprecated = 0;
560
561 if (!deprecated) {
562 xmlGenericError(xmlGenericErrorContext,
563 "xmlParseNamespace() deprecated function reached\n");
564 deprecated = 1;
565 }
566}
567
568/**
569 * xmlScanName:
570 * @ctxt: an XML parser context
571 *
572 * Trickery: parse an XML name but without consuming the input flow
573 * Needed for rollback cases. Used only when parsing entities references.
574 *
575 * TODO: seems deprecated now, only used in the default part of
576 * xmlParserHandleReference
577 *
578 * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
579 * CombiningChar | Extender
580 *
581 * [5] Name ::= (Letter | '_' | ':') (NameChar)*
582 *
583 * [6] Names ::= Name (S Name)*
584 *
585 * Returns the Name parsed or NULL
586 */
587
588xmlChar *
589xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
590{
591 static int deprecated = 0;
592
593 if (!deprecated) {
594 xmlGenericError(xmlGenericErrorContext,
595 "xmlScanName() deprecated function reached\n");
596 deprecated = 1;
597 }
598 return (NULL);
599}
600
601/**
602 * xmlParserHandleReference:
603 * @ctxt: the parser context
604 *
605 * TODO: Remove, now deprecated ... the test is done directly in the
606 * content parsing
607 * routines.
608 *
609 * [67] Reference ::= EntityRef | CharRef
610 *
611 * [68] EntityRef ::= '&' Name ';'
612 *
613 * [ WFC: Entity Declared ]
614 * the Name given in the entity reference must match that in an entity
615 * declaration, except that well-formed documents need not declare any
616 * of the following entities: amp, lt, gt, apos, quot.
617 *
618 * [ WFC: Parsed Entity ]
619 * An entity reference must not contain the name of an unparsed entity
620 *
621 * [66] CharRef ::= '&#' [0-9]+ ';' |
622 * '&#x' [0-9a-fA-F]+ ';'
623 *
624 * A PEReference may have been detected in the current input stream
625 * the handling is done accordingly to
626 * http://www.w3.org/TR/REC-xml#entproc
627 */
628void
629xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
630{
631 static int deprecated = 0;
632
633 if (!deprecated) {
634 xmlGenericError(xmlGenericErrorContext,
635 "xmlParserHandleReference() deprecated function reached\n");
636 deprecated = 1;
637 }
638
639 return;
640}
641
642/**
643 * xmlHandleEntity:
644 * @ctxt: an XML parser context
645 * @entity: an XML entity pointer.
646 *
647 * Default handling of defined entities, when should we define a new input
648 * stream ? When do we just handle that as a set of chars ?
649 *
650 * OBSOLETE: to be removed at some point.
651 */
652
653void
654xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
655 xmlEntityPtr entity ATTRIBUTE_UNUSED)
656{
657 static int deprecated = 0;
658
659 if (!deprecated) {
660 xmlGenericError(xmlGenericErrorContext,
661 "xmlHandleEntity() deprecated function reached\n");
662 deprecated = 1;
663 }
664}
665
666/**
667 * xmlNewGlobalNs:
668 * @doc: the document carrying the namespace
669 * @href: the URI associated
670 * @prefix: the prefix for the namespace
671 *
672 * Creation of a Namespace, the old way using PI and without scoping
673 * DEPRECATED !!!
674 * It now create a namespace on the root element of the document if found.
675 * Returns NULL this functionality had been removed
676 */
677xmlNsPtr
678xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
679 const xmlChar * href ATTRIBUTE_UNUSED,
680 const xmlChar * prefix ATTRIBUTE_UNUSED)
681{
682 static int deprecated = 0;
683
684 if (!deprecated) {
685 xmlGenericError(xmlGenericErrorContext,
686 "xmlNewGlobalNs() deprecated function reached\n");
687 deprecated = 1;
688 }
689 return (NULL);
690}
691
692/**
693 * xmlUpgradeOldNs:
694 * @doc: a document pointer
695 *
696 * Upgrade old style Namespaces (PI) and move them to the root of the document.
697 * DEPRECATED
698 */
699void
700xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
701{
702 static int deprecated = 0;
703
704 if (!deprecated) {
705 xmlGenericError(xmlGenericErrorContext,
706 "xmlUpgradeOldNs() deprecated function reached\n");
707 deprecated = 1;
708 }
709}
710
711/**
712 * xmlEncodeEntities:
713 * @doc: the document containing the string
714 * @input: A string to convert to XML.
715 *
716 * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
717 * compatibility
718 *
719 * People must migrate their code to xmlEncodeEntitiesReentrant !
720 * This routine will issue a warning when encountered.
721 *
722 * Returns NULL
723 */
724const xmlChar *
725xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
Daniel Veillardf403d292003-10-05 13:51:35 +0000726 const xmlChar * input ATTRIBUTE_UNUSED)
727{
Daniel Veillard8940fd52003-09-29 09:07:08 +0000728 static int warning = 1;
729
730 if (warning) {
Daniel Veillardf403d292003-10-05 13:51:35 +0000731 xmlGenericError(xmlGenericErrorContext,
732 "Deprecated API xmlEncodeEntities() used\n");
733 xmlGenericError(xmlGenericErrorContext,
734 " change code to use xmlEncodeEntitiesReentrant()\n");
735 warning = 0;
Daniel Veillard8940fd52003-09-29 09:07:08 +0000736 }
Daniel Veillardf403d292003-10-05 13:51:35 +0000737 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000738}
739
740/************************************************************************
741 * *
742 * Old set of SAXv1 functions *
743 * *
744 ************************************************************************/
745static int deprecated_v1_msg = 0;
746
747#define DEPRECATED(n) \
748 if (deprecated_v1_msg == 0) \
749 xmlGenericError(xmlGenericErrorContext, \
750 "Use of deprecated SAXv1 function %s\n", n); \
751 deprecated_v1_msg++;
752
753/**
754 * getPublicId:
755 * @ctx: the user data (XML parser context)
756 *
757 * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
758 * DEPRECATED: use xmlSAX2GetPublicId()
759 *
760 * Returns a xmlChar *
761 */
762const xmlChar *
763getPublicId(void *ctx)
764{
765 DEPRECATED("getPublicId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000766 return (xmlSAX2GetPublicId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000767}
768
769/**
770 * getSystemId:
771 * @ctx: the user data (XML parser context)
772 *
773 * Provides the system ID, basically URL or filename e.g.
774 * http://www.sgmlsource.com/dtds/memo.dtd
775 * DEPRECATED: use xmlSAX2GetSystemId()
776 *
777 * Returns a xmlChar *
778 */
779const xmlChar *
780getSystemId(void *ctx)
781{
782 DEPRECATED("getSystemId")
Daniel Veillardf403d292003-10-05 13:51:35 +0000783 return (xmlSAX2GetSystemId(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000784}
785
786/**
787 * getLineNumber:
788 * @ctx: the user data (XML parser context)
789 *
790 * Provide the line number of the current parsing point.
791 * DEPRECATED: use xmlSAX2GetLineNumber()
792 *
793 * Returns an int
794 */
795int
796getLineNumber(void *ctx)
797{
798 DEPRECATED("getLineNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000799 return (xmlSAX2GetLineNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000800}
801
802/**
803 * getColumnNumber:
804 * @ctx: the user data (XML parser context)
805 *
806 * Provide the column number of the current parsing point.
807 * DEPRECATED: use xmlSAX2GetColumnNumber()
808 *
809 * Returns an int
810 */
811int
812getColumnNumber(void *ctx)
813{
814 DEPRECATED("getColumnNumber")
Daniel Veillardf403d292003-10-05 13:51:35 +0000815 return (xmlSAX2GetColumnNumber(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000816}
817
818/**
819 * isStandalone:
820 * @ctx: the user data (XML parser context)
821 *
822 * Is this document tagged standalone ?
823 * DEPRECATED: use xmlSAX2IsStandalone()
824 *
825 * Returns 1 if true
826 */
827int
828isStandalone(void *ctx)
829{
830 DEPRECATED("isStandalone")
Daniel Veillardf403d292003-10-05 13:51:35 +0000831 return (xmlSAX2IsStandalone(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000832}
833
834/**
835 * hasInternalSubset:
836 * @ctx: the user data (XML parser context)
837 *
838 * Does this document has an internal subset
839 * DEPRECATED: use xmlSAX2HasInternalSubset()
840 *
841 * Returns 1 if true
842 */
843int
844hasInternalSubset(void *ctx)
845{
846 DEPRECATED("hasInternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000847 return (xmlSAX2HasInternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000848}
849
850/**
851 * hasExternalSubset:
852 * @ctx: the user data (XML parser context)
853 *
854 * Does this document has an external subset
855 * DEPRECATED: use xmlSAX2HasExternalSubset()
856 *
857 * Returns 1 if true
858 */
859int
860hasExternalSubset(void *ctx)
861{
862 DEPRECATED("hasExternalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000863 return (xmlSAX2HasExternalSubset(ctx));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000864}
865
866/**
867 * internalSubset:
868 * @ctx: the user data (XML parser context)
869 * @name: the root element name
870 * @ExternalID: the external ID
871 * @SystemID: the SYSTEM ID (e.g. filename or URL)
872 *
873 * Callback on internal subset declaration.
874 * DEPRECATED: use xmlSAX2InternalSubset()
875 */
876void
Daniel Veillardf403d292003-10-05 13:51:35 +0000877internalSubset(void *ctx, const xmlChar * name,
878 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000879{
880 DEPRECATED("internalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000881 xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000882}
883
884/**
885 * externalSubset:
886 * @ctx: the user data (XML parser context)
887 * @name: the root element name
888 * @ExternalID: the external ID
889 * @SystemID: the SYSTEM ID (e.g. filename or URL)
890 *
891 * Callback on external subset declaration.
892 * DEPRECATED: use xmlSAX2ExternalSubset()
893 */
894void
Daniel Veillardf403d292003-10-05 13:51:35 +0000895externalSubset(void *ctx, const xmlChar * name,
896 const xmlChar * ExternalID, const xmlChar * SystemID)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000897{
898 DEPRECATED("externalSubset")
Daniel Veillardf403d292003-10-05 13:51:35 +0000899 xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000900}
901
902/**
903 * resolveEntity:
904 * @ctx: the user data (XML parser context)
905 * @publicId: The public ID of the entity
906 * @systemId: The system ID of the entity
907 *
908 * The entity loader, to control the loading of external entities,
909 * the application can either:
910 * - override this resolveEntity() callback in the SAX block
911 * - or better use the xmlSetExternalEntityLoader() function to
912 * set up it's own entity resolution routine
913 * DEPRECATED: use xmlSAX2ResolveEntity()
914 *
915 * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
916 */
917xmlParserInputPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000918resolveEntity(void *ctx, const xmlChar * publicId,
919 const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000920{
921 DEPRECATED("resolveEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000922 return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000923}
924
925/**
926 * getEntity:
927 * @ctx: the user data (XML parser context)
928 * @name: The entity name
929 *
930 * Get an entity by name
931 * DEPRECATED: use xmlSAX2GetEntity()
932 *
933 * Returns the xmlEntityPtr if found.
934 */
935xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000936getEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000937{
938 DEPRECATED("getEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000939 return (xmlSAX2GetEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000940}
941
942/**
943 * getParameterEntity:
944 * @ctx: the user data (XML parser context)
945 * @name: The entity name
946 *
947 * Get a parameter entity by name
948 * DEPRECATED: use xmlSAX2GetParameterEntity()
949 *
950 * Returns the xmlEntityPtr if found.
951 */
952xmlEntityPtr
Daniel Veillardf403d292003-10-05 13:51:35 +0000953getParameterEntity(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000954{
955 DEPRECATED("getParameterEntity")
Daniel Veillardf403d292003-10-05 13:51:35 +0000956 return (xmlSAX2GetParameterEntity(ctx, name));
Daniel Veillard8940fd52003-09-29 09:07:08 +0000957}
958
959
960/**
961 * entityDecl:
962 * @ctx: the user data (XML parser context)
963 * @name: the entity name
964 * @type: the entity type
965 * @publicId: The public ID of the entity
966 * @systemId: The system ID of the entity
967 * @content: the entity value (without processing).
968 *
969 * An entity definition has been parsed
970 * DEPRECATED: use xmlSAX2EntityDecl()
971 */
972void
Daniel Veillardf403d292003-10-05 13:51:35 +0000973entityDecl(void *ctx, const xmlChar * name, int type,
974 const xmlChar * publicId, const xmlChar * systemId,
975 xmlChar * content)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000976{
977 DEPRECATED("entityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +0000978 xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +0000979}
980
981/**
982 * attributeDecl:
983 * @ctx: the user data (XML parser context)
984 * @elem: the name of the element
985 * @fullname: the attribute name
986 * @type: the attribute type
987 * @def: the type of default value
988 * @defaultValue: the attribute default value
989 * @tree: the tree of enumerated value set
990 *
991 * An attribute definition has been parsed
992 * DEPRECATED: use xmlSAX2AttributeDecl()
993 */
994void
Daniel Veillardf403d292003-10-05 13:51:35 +0000995attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
996 int type, int def, const xmlChar * defaultValue,
997 xmlEnumerationPtr tree)
Daniel Veillard8940fd52003-09-29 09:07:08 +0000998{
999 DEPRECATED("attributeDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001000 xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
1001 tree);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001002}
1003
1004/**
1005 * elementDecl:
1006 * @ctx: the user data (XML parser context)
1007 * @name: the element name
1008 * @type: the element type
1009 * @content: the element value tree
1010 *
1011 * An element definition has been parsed
1012 * DEPRECATED: use xmlSAX2ElementDecl()
1013 */
1014void
1015elementDecl(void *ctx, const xmlChar * name, int type,
1016 xmlElementContentPtr content)
1017{
1018 DEPRECATED("elementDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001019 xmlSAX2ElementDecl(ctx, name, type, content);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001020}
1021
1022/**
1023 * notationDecl:
1024 * @ctx: the user data (XML parser context)
1025 * @name: The name of the notation
1026 * @publicId: The public ID of the entity
1027 * @systemId: The system ID of the entity
1028 *
1029 * What to do when a notation declaration has been parsed.
1030 * DEPRECATED: use xmlSAX2NotationDecl()
1031 */
1032void
Daniel Veillardf403d292003-10-05 13:51:35 +00001033notationDecl(void *ctx, const xmlChar * name,
1034 const xmlChar * publicId, const xmlChar * systemId)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001035{
1036 DEPRECATED("notationDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001037 xmlSAX2NotationDecl(ctx, name, publicId, systemId);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001038}
1039
1040/**
1041 * unparsedEntityDecl:
1042 * @ctx: the user data (XML parser context)
1043 * @name: The name of the entity
1044 * @publicId: The public ID of the entity
1045 * @systemId: The system ID of the entity
1046 * @notationName: the name of the notation
1047 *
1048 * What to do when an unparsed entity declaration is parsed
1049 * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
1050 */
1051void
Daniel Veillardf403d292003-10-05 13:51:35 +00001052unparsedEntityDecl(void *ctx, const xmlChar * name,
1053 const xmlChar * publicId, const xmlChar * systemId,
1054 const xmlChar * notationName)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001055{
1056 DEPRECATED("unparsedEntityDecl")
Daniel Veillardf403d292003-10-05 13:51:35 +00001057 xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
1058 notationName);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001059}
1060
1061/**
1062 * setDocumentLocator:
1063 * @ctx: the user data (XML parser context)
1064 * @loc: A SAX Locator
1065 *
1066 * Receive the document locator at startup, actually xmlDefaultSAXLocator
1067 * Everything is available on the context, so this is useless in our case.
1068 * DEPRECATED
1069 */
1070void
Daniel Veillardf403d292003-10-05 13:51:35 +00001071setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
1072 xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001073{
1074 DEPRECATED("setDocumentLocator")
1075}
1076
1077/**
1078 * startDocument:
1079 * @ctx: the user data (XML parser context)
1080 *
1081 * called when the document start being processed.
1082 * DEPRECATED: use xmlSAX2StartDocument()
1083 */
1084void
1085startDocument(void *ctx)
1086{
Daniel Veillard4aede2e2003-10-17 12:43:59 +00001087 /* don't be too painful for glade users */
1088 /* DEPRECATED("startDocument") */
Daniel Veillardf403d292003-10-05 13:51:35 +00001089 xmlSAX2StartDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001090}
1091
1092/**
1093 * endDocument:
1094 * @ctx: the user data (XML parser context)
1095 *
1096 * called when the document end has been detected.
1097 * DEPRECATED: use xmlSAX2EndDocument()
1098 */
1099void
1100endDocument(void *ctx)
1101{
1102 DEPRECATED("endDocument")
Daniel Veillardf403d292003-10-05 13:51:35 +00001103 xmlSAX2EndDocument(ctx);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001104}
1105
1106/**
1107 * attribute:
1108 * @ctx: the user data (XML parser context)
1109 * @fullname: The attribute name, including namespace prefix
1110 * @value: The attribute value
1111 *
1112 * Handle an attribute that has been read by the parser.
1113 * The default handling is to convert the attribute into an
1114 * DOM subtree and past it in a new xmlAttr element added to
1115 * the element.
1116 * DEPRECATED: use xmlSAX2Attribute()
1117 */
1118void
Daniel Veillardf403d292003-10-05 13:51:35 +00001119attribute(void *ctx ATTRIBUTE_UNUSED,
1120 const xmlChar * fullname ATTRIBUTE_UNUSED,
1121 const xmlChar * value ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001122{
1123 DEPRECATED("attribute")
1124}
1125
1126/**
1127 * startElement:
1128 * @ctx: the user data (XML parser context)
1129 * @fullname: The element name, including namespace prefix
1130 * @atts: An array of name/value attributes pairs, NULL terminated
1131 *
1132 * called when an opening tag has been processed.
1133 * DEPRECATED: use xmlSAX2StartElement()
1134 */
1135void
Daniel Veillardf403d292003-10-05 13:51:35 +00001136startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001137{
Daniel Veillard509028f2003-12-24 11:10:17 +00001138 xmlSAX2StartElement(ctx, fullname, atts);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001139}
1140
1141/**
1142 * endElement:
1143 * @ctx: the user data (XML parser context)
1144 * @name: The element name
1145 *
1146 * called when the end of an element has been detected.
1147 * DEPRECATED: use xmlSAX2EndElement()
1148 */
1149void
Daniel Veillardf403d292003-10-05 13:51:35 +00001150endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001151{
1152 DEPRECATED("endElement")
Daniel Veillardf403d292003-10-05 13:51:35 +00001153 xmlSAX2EndElement(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001154}
1155
1156/**
1157 * reference:
1158 * @ctx: the user data (XML parser context)
1159 * @name: The entity name
1160 *
1161 * called when an entity reference is detected.
1162 * DEPRECATED: use xmlSAX2Reference()
1163 */
1164void
Daniel Veillardf403d292003-10-05 13:51:35 +00001165reference(void *ctx, const xmlChar * name)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001166{
1167 DEPRECATED("reference")
Daniel Veillardf403d292003-10-05 13:51:35 +00001168 xmlSAX2Reference(ctx, name);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001169}
1170
1171/**
1172 * characters:
1173 * @ctx: the user data (XML parser context)
1174 * @ch: a xmlChar string
1175 * @len: the number of xmlChar
1176 *
1177 * receiving some chars from the parser.
1178 * DEPRECATED: use xmlSAX2Characters()
1179 */
1180void
Daniel Veillardf403d292003-10-05 13:51:35 +00001181characters(void *ctx, const xmlChar * ch, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001182{
1183 DEPRECATED("characters")
Daniel Veillardf403d292003-10-05 13:51:35 +00001184 xmlSAX2Characters(ctx, ch, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001185}
1186
1187/**
1188 * ignorableWhitespace:
1189 * @ctx: the user data (XML parser context)
1190 * @ch: a xmlChar string
1191 * @len: the number of xmlChar
1192 *
1193 * receiving some ignorable whitespaces from the parser.
1194 * UNUSED: by default the DOM building will use characters
1195 * DEPRECATED: use xmlSAX2IgnorableWhitespace()
1196 */
1197void
Daniel Veillardf403d292003-10-05 13:51:35 +00001198ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
1199 const xmlChar * ch ATTRIBUTE_UNUSED,
1200 int len ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001201{
1202 DEPRECATED("ignorableWhitespace")
1203}
1204
1205/**
1206 * processingInstruction:
1207 * @ctx: the user data (XML parser context)
1208 * @target: the target name
1209 * @data: the PI data's
1210 *
1211 * A processing instruction has been parsed.
1212 * DEPRECATED: use xmlSAX2ProcessingInstruction()
1213 */
1214void
Daniel Veillardf403d292003-10-05 13:51:35 +00001215processingInstruction(void *ctx, const xmlChar * target,
1216 const xmlChar * data)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001217{
1218 DEPRECATED("processingInstruction")
Daniel Veillardf403d292003-10-05 13:51:35 +00001219 xmlSAX2ProcessingInstruction(ctx, target, data);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001220}
1221
1222/**
1223 * globalNamespace:
1224 * @ctx: the user data (XML parser context)
1225 * @href: the namespace associated URN
1226 * @prefix: the namespace prefix
1227 *
1228 * An old global namespace has been parsed.
1229 * DEPRECATED
1230 */
1231void
Daniel Veillardf403d292003-10-05 13:51:35 +00001232globalNamespace(void *ctx ATTRIBUTE_UNUSED,
1233 const xmlChar * href ATTRIBUTE_UNUSED,
1234 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001235{
1236 DEPRECATED("globalNamespace")
1237}
1238
1239/**
1240 * setNamespace:
1241 * @ctx: the user data (XML parser context)
1242 * @name: the namespace prefix
1243 *
1244 * Set the current element namespace.
1245 * DEPRECATED
1246 */
1247
1248void
Daniel Veillardf403d292003-10-05 13:51:35 +00001249setNamespace(void *ctx ATTRIBUTE_UNUSED,
1250 const xmlChar * name ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001251{
1252 DEPRECATED("setNamespace")
1253}
1254
1255/**
1256 * getNamespace:
1257 * @ctx: the user data (XML parser context)
1258 *
1259 * Get the current element namespace.
1260 * DEPRECATED
1261 *
1262 * Returns the xmlNsPtr or NULL if none
1263 */
1264
1265xmlNsPtr
1266getNamespace(void *ctx ATTRIBUTE_UNUSED)
1267{
1268 DEPRECATED("getNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001269 return (NULL);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001270}
1271
1272/**
1273 * checkNamespace:
1274 * @ctx: the user data (XML parser context)
1275 * @namespace: the namespace to check against
1276 *
1277 * Check that the current element namespace is the same as the
1278 * one read upon parsing.
1279 * DEPRECATED
1280 *
1281 * Returns 1 if true 0 otherwise
1282 */
1283
1284int
Daniel Veillardf403d292003-10-05 13:51:35 +00001285checkNamespace(void *ctx ATTRIBUTE_UNUSED,
1286 xmlChar * namespace ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001287{
1288 DEPRECATED("checkNamespace")
Daniel Veillardf403d292003-10-05 13:51:35 +00001289 return (0);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001290}
1291
1292/**
1293 * namespaceDecl:
1294 * @ctx: the user data (XML parser context)
1295 * @href: the namespace associated URN
1296 * @prefix: the namespace prefix
1297 *
1298 * A namespace has been parsed.
1299 * DEPRECATED
1300 */
1301void
Daniel Veillardf403d292003-10-05 13:51:35 +00001302namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
1303 const xmlChar * href ATTRIBUTE_UNUSED,
1304 const xmlChar * prefix ATTRIBUTE_UNUSED)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001305{
1306 DEPRECATED("namespaceDecl")
1307}
1308
1309/**
1310 * comment:
1311 * @ctx: the user data (XML parser context)
1312 * @value: the comment content
1313 *
1314 * A comment has been parsed.
1315 * DEPRECATED: use xmlSAX2Comment()
1316 */
1317void
Daniel Veillardf403d292003-10-05 13:51:35 +00001318comment(void *ctx, const xmlChar * value)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001319{
1320 DEPRECATED("comment")
Daniel Veillardf403d292003-10-05 13:51:35 +00001321 xmlSAX2Comment(ctx, value);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001322}
1323
1324/**
1325 * cdataBlock:
1326 * @ctx: the user data (XML parser context)
1327 * @value: The pcdata content
1328 * @len: the block length
1329 *
1330 * called when a pcdata block has been parsed
1331 * DEPRECATED: use xmlSAX2CDataBlock()
1332 */
1333void
Daniel Veillardf403d292003-10-05 13:51:35 +00001334cdataBlock(void *ctx, const xmlChar * value, int len)
Daniel Veillard8940fd52003-09-29 09:07:08 +00001335{
1336 DEPRECATED("cdataBlock")
Daniel Veillardf403d292003-10-05 13:51:35 +00001337 xmlSAX2CDataBlock(ctx, value, len);
Daniel Veillard8940fd52003-09-29 09:07:08 +00001338}
Daniel Veillard8940fd52003-09-29 09:07:08 +00001339#endif /* LIBXML_LEGACY_ENABLED */
1340