legacy.c 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343
  1. /*
  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. #define IN_LIBXML
  10. #include "libxml.h"
  11. #ifdef LIBXML_LEGACY_ENABLED
  12. #include <string.h>
  13. #include <libxml/tree.h>
  14. #include <libxml/entities.h>
  15. #include <libxml/SAX.h>
  16. #include <libxml/parserInternals.h>
  17. #include <libxml/HTMLparser.h>
  18. void xmlUpgradeOldNs(xmlDocPtr doc);
  19. /************************************************************************
  20. * *
  21. * Deprecated functions kept for compatibility *
  22. * *
  23. ************************************************************************/
  24. #ifdef LIBXML_HTML_ENABLED
  25. xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end,
  26. xmlChar end2, xmlChar end3);
  27. /**
  28. * htmlDecodeEntities:
  29. * @ctxt: the parser context
  30. * @len: the len to decode (in bytes !), -1 for no size limit
  31. * @end: an end marker xmlChar, 0 if none
  32. * @end2: an end marker xmlChar, 0 if none
  33. * @end3: an end marker xmlChar, 0 if none
  34. *
  35. * Substitute the HTML entities by their value
  36. *
  37. * DEPRECATED !!!!
  38. *
  39. * Returns A newly allocated string with the substitution done. The caller
  40. * must deallocate it !
  41. */
  42. xmlChar *
  43. htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
  44. int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,
  45. xmlChar end2 ATTRIBUTE_UNUSED,
  46. xmlChar end3 ATTRIBUTE_UNUSED)
  47. {
  48. static int deprecated = 0;
  49. if (!deprecated) {
  50. xmlGenericError(xmlGenericErrorContext,
  51. "htmlDecodeEntities() deprecated function reached\n");
  52. deprecated = 1;
  53. }
  54. return (NULL);
  55. }
  56. #endif
  57. /**
  58. * xmlInitializePredefinedEntities:
  59. *
  60. * Set up the predefined entities.
  61. * Deprecated call
  62. */
  63. void
  64. xmlInitializePredefinedEntities(void)
  65. {
  66. }
  67. /**
  68. * xmlCleanupPredefinedEntities:
  69. *
  70. * Cleanup up the predefined entities table.
  71. * Deprecated call
  72. */
  73. void
  74. xmlCleanupPredefinedEntities(void)
  75. {
  76. }
  77. static const char *xmlFeaturesList[] = {
  78. "validate",
  79. "load subset",
  80. "keep blanks",
  81. "disable SAX",
  82. "fetch external entities",
  83. "substitute entities",
  84. "gather line info",
  85. "user data",
  86. "is html",
  87. "is standalone",
  88. "stop parser",
  89. "document",
  90. "is well formed",
  91. "is valid",
  92. "SAX block",
  93. "SAX function internalSubset",
  94. "SAX function isStandalone",
  95. "SAX function hasInternalSubset",
  96. "SAX function hasExternalSubset",
  97. "SAX function resolveEntity",
  98. "SAX function getEntity",
  99. "SAX function entityDecl",
  100. "SAX function notationDecl",
  101. "SAX function attributeDecl",
  102. "SAX function elementDecl",
  103. "SAX function unparsedEntityDecl",
  104. "SAX function setDocumentLocator",
  105. "SAX function startDocument",
  106. "SAX function endDocument",
  107. "SAX function startElement",
  108. "SAX function endElement",
  109. "SAX function reference",
  110. "SAX function characters",
  111. "SAX function ignorableWhitespace",
  112. "SAX function processingInstruction",
  113. "SAX function comment",
  114. "SAX function warning",
  115. "SAX function error",
  116. "SAX function fatalError",
  117. "SAX function getParameterEntity",
  118. "SAX function cdataBlock",
  119. "SAX function externalSubset",
  120. };
  121. /**
  122. * xmlGetFeaturesList:
  123. * @len: the length of the features name array (input/output)
  124. * @result: an array of string to be filled with the features name.
  125. *
  126. * Copy at most *@len feature names into the @result array
  127. *
  128. * Returns -1 in case or error, or the total number of features,
  129. * len is updated with the number of strings copied,
  130. * strings must not be deallocated
  131. */
  132. int
  133. xmlGetFeaturesList(int *len, const char **result)
  134. {
  135. int ret, i;
  136. ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]);
  137. if ((len == NULL) || (result == NULL))
  138. return (ret);
  139. if ((*len < 0) || (*len >= 1000))
  140. return (-1);
  141. if (*len > ret)
  142. *len = ret;
  143. for (i = 0; i < *len; i++)
  144. result[i] = xmlFeaturesList[i];
  145. return (ret);
  146. }
  147. /**
  148. * xmlGetFeature:
  149. * @ctxt: an XML/HTML parser context
  150. * @name: the feature name
  151. * @result: location to store the result
  152. *
  153. * Read the current value of one feature of this parser instance
  154. *
  155. * Returns -1 in case or error, 0 otherwise
  156. */
  157. int
  158. xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result)
  159. {
  160. if ((ctxt == NULL) || (name == NULL) || (result == NULL))
  161. return (-1);
  162. if (!strcmp(name, "validate")) {
  163. *((int *) result) = ctxt->validate;
  164. } else if (!strcmp(name, "keep blanks")) {
  165. *((int *) result) = ctxt->keepBlanks;
  166. } else if (!strcmp(name, "disable SAX")) {
  167. *((int *) result) = ctxt->disableSAX;
  168. } else if (!strcmp(name, "fetch external entities")) {
  169. *((int *) result) = ctxt->loadsubset;
  170. } else if (!strcmp(name, "substitute entities")) {
  171. *((int *) result) = ctxt->replaceEntities;
  172. } else if (!strcmp(name, "gather line info")) {
  173. *((int *) result) = ctxt->record_info;
  174. } else if (!strcmp(name, "user data")) {
  175. *((void **) result) = ctxt->userData;
  176. } else if (!strcmp(name, "is html")) {
  177. *((int *) result) = ctxt->html;
  178. } else if (!strcmp(name, "is standalone")) {
  179. *((int *) result) = ctxt->standalone;
  180. } else if (!strcmp(name, "document")) {
  181. *((xmlDocPtr *) result) = ctxt->myDoc;
  182. } else if (!strcmp(name, "is well formed")) {
  183. *((int *) result) = ctxt->wellFormed;
  184. } else if (!strcmp(name, "is valid")) {
  185. *((int *) result) = ctxt->valid;
  186. } else if (!strcmp(name, "SAX block")) {
  187. *((xmlSAXHandlerPtr *) result) = ctxt->sax;
  188. } else if (!strcmp(name, "SAX function internalSubset")) {
  189. *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset;
  190. } else if (!strcmp(name, "SAX function isStandalone")) {
  191. *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone;
  192. } else if (!strcmp(name, "SAX function hasInternalSubset")) {
  193. *((hasInternalSubsetSAXFunc *) result) =
  194. ctxt->sax->hasInternalSubset;
  195. } else if (!strcmp(name, "SAX function hasExternalSubset")) {
  196. *((hasExternalSubsetSAXFunc *) result) =
  197. ctxt->sax->hasExternalSubset;
  198. } else if (!strcmp(name, "SAX function resolveEntity")) {
  199. *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity;
  200. } else if (!strcmp(name, "SAX function getEntity")) {
  201. *((getEntitySAXFunc *) result) = ctxt->sax->getEntity;
  202. } else if (!strcmp(name, "SAX function entityDecl")) {
  203. *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl;
  204. } else if (!strcmp(name, "SAX function notationDecl")) {
  205. *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl;
  206. } else if (!strcmp(name, "SAX function attributeDecl")) {
  207. *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl;
  208. } else if (!strcmp(name, "SAX function elementDecl")) {
  209. *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl;
  210. } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
  211. *((unparsedEntityDeclSAXFunc *) result) =
  212. ctxt->sax->unparsedEntityDecl;
  213. } else if (!strcmp(name, "SAX function setDocumentLocator")) {
  214. *((setDocumentLocatorSAXFunc *) result) =
  215. ctxt->sax->setDocumentLocator;
  216. } else if (!strcmp(name, "SAX function startDocument")) {
  217. *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument;
  218. } else if (!strcmp(name, "SAX function endDocument")) {
  219. *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument;
  220. } else if (!strcmp(name, "SAX function startElement")) {
  221. *((startElementSAXFunc *) result) = ctxt->sax->startElement;
  222. } else if (!strcmp(name, "SAX function endElement")) {
  223. *((endElementSAXFunc *) result) = ctxt->sax->endElement;
  224. } else if (!strcmp(name, "SAX function reference")) {
  225. *((referenceSAXFunc *) result) = ctxt->sax->reference;
  226. } else if (!strcmp(name, "SAX function characters")) {
  227. *((charactersSAXFunc *) result) = ctxt->sax->characters;
  228. } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
  229. *((ignorableWhitespaceSAXFunc *) result) =
  230. ctxt->sax->ignorableWhitespace;
  231. } else if (!strcmp(name, "SAX function processingInstruction")) {
  232. *((processingInstructionSAXFunc *) result) =
  233. ctxt->sax->processingInstruction;
  234. } else if (!strcmp(name, "SAX function comment")) {
  235. *((commentSAXFunc *) result) = ctxt->sax->comment;
  236. } else if (!strcmp(name, "SAX function warning")) {
  237. *((warningSAXFunc *) result) = ctxt->sax->warning;
  238. } else if (!strcmp(name, "SAX function error")) {
  239. *((errorSAXFunc *) result) = ctxt->sax->error;
  240. } else if (!strcmp(name, "SAX function fatalError")) {
  241. *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError;
  242. } else if (!strcmp(name, "SAX function getParameterEntity")) {
  243. *((getParameterEntitySAXFunc *) result) =
  244. ctxt->sax->getParameterEntity;
  245. } else if (!strcmp(name, "SAX function cdataBlock")) {
  246. *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock;
  247. } else if (!strcmp(name, "SAX function externalSubset")) {
  248. *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset;
  249. } else {
  250. return (-1);
  251. }
  252. return (0);
  253. }
  254. /**
  255. * xmlSetFeature:
  256. * @ctxt: an XML/HTML parser context
  257. * @name: the feature name
  258. * @value: pointer to the location of the new value
  259. *
  260. * Change the current value of one feature of this parser instance
  261. *
  262. * Returns -1 in case or error, 0 otherwise
  263. */
  264. int
  265. xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value)
  266. {
  267. if ((ctxt == NULL) || (name == NULL) || (value == NULL))
  268. return (-1);
  269. if (!strcmp(name, "validate")) {
  270. int newvalidate = *((int *) value);
  271. if ((!ctxt->validate) && (newvalidate != 0)) {
  272. if (ctxt->vctxt.warning == NULL)
  273. ctxt->vctxt.warning = xmlParserValidityWarning;
  274. if (ctxt->vctxt.error == NULL)
  275. ctxt->vctxt.error = xmlParserValidityError;
  276. ctxt->vctxt.nodeMax = 0;
  277. }
  278. ctxt->validate = newvalidate;
  279. } else if (!strcmp(name, "keep blanks")) {
  280. ctxt->keepBlanks = *((int *) value);
  281. } else if (!strcmp(name, "disable SAX")) {
  282. ctxt->disableSAX = *((int *) value);
  283. } else if (!strcmp(name, "fetch external entities")) {
  284. ctxt->loadsubset = *((int *) value);
  285. } else if (!strcmp(name, "substitute entities")) {
  286. ctxt->replaceEntities = *((int *) value);
  287. } else if (!strcmp(name, "gather line info")) {
  288. ctxt->record_info = *((int *) value);
  289. } else if (!strcmp(name, "user data")) {
  290. ctxt->userData = *((void **) value);
  291. } else if (!strcmp(name, "is html")) {
  292. ctxt->html = *((int *) value);
  293. } else if (!strcmp(name, "is standalone")) {
  294. ctxt->standalone = *((int *) value);
  295. } else if (!strcmp(name, "document")) {
  296. ctxt->myDoc = *((xmlDocPtr *) value);
  297. } else if (!strcmp(name, "is well formed")) {
  298. ctxt->wellFormed = *((int *) value);
  299. } else if (!strcmp(name, "is valid")) {
  300. ctxt->valid = *((int *) value);
  301. } else if (!strcmp(name, "SAX block")) {
  302. ctxt->sax = *((xmlSAXHandlerPtr *) value);
  303. } else if (!strcmp(name, "SAX function internalSubset")) {
  304. ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value);
  305. } else if (!strcmp(name, "SAX function isStandalone")) {
  306. ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value);
  307. } else if (!strcmp(name, "SAX function hasInternalSubset")) {
  308. ctxt->sax->hasInternalSubset =
  309. *((hasInternalSubsetSAXFunc *) value);
  310. } else if (!strcmp(name, "SAX function hasExternalSubset")) {
  311. ctxt->sax->hasExternalSubset =
  312. *((hasExternalSubsetSAXFunc *) value);
  313. } else if (!strcmp(name, "SAX function resolveEntity")) {
  314. ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value);
  315. } else if (!strcmp(name, "SAX function getEntity")) {
  316. ctxt->sax->getEntity = *((getEntitySAXFunc *) value);
  317. } else if (!strcmp(name, "SAX function entityDecl")) {
  318. ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value);
  319. } else if (!strcmp(name, "SAX function notationDecl")) {
  320. ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value);
  321. } else if (!strcmp(name, "SAX function attributeDecl")) {
  322. ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value);
  323. } else if (!strcmp(name, "SAX function elementDecl")) {
  324. ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value);
  325. } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
  326. ctxt->sax->unparsedEntityDecl =
  327. *((unparsedEntityDeclSAXFunc *) value);
  328. } else if (!strcmp(name, "SAX function setDocumentLocator")) {
  329. ctxt->sax->setDocumentLocator =
  330. *((setDocumentLocatorSAXFunc *) value);
  331. } else if (!strcmp(name, "SAX function startDocument")) {
  332. ctxt->sax->startDocument = *((startDocumentSAXFunc *) value);
  333. } else if (!strcmp(name, "SAX function endDocument")) {
  334. ctxt->sax->endDocument = *((endDocumentSAXFunc *) value);
  335. } else if (!strcmp(name, "SAX function startElement")) {
  336. ctxt->sax->startElement = *((startElementSAXFunc *) value);
  337. } else if (!strcmp(name, "SAX function endElement")) {
  338. ctxt->sax->endElement = *((endElementSAXFunc *) value);
  339. } else if (!strcmp(name, "SAX function reference")) {
  340. ctxt->sax->reference = *((referenceSAXFunc *) value);
  341. } else if (!strcmp(name, "SAX function characters")) {
  342. ctxt->sax->characters = *((charactersSAXFunc *) value);
  343. } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
  344. ctxt->sax->ignorableWhitespace =
  345. *((ignorableWhitespaceSAXFunc *) value);
  346. } else if (!strcmp(name, "SAX function processingInstruction")) {
  347. ctxt->sax->processingInstruction =
  348. *((processingInstructionSAXFunc *) value);
  349. } else if (!strcmp(name, "SAX function comment")) {
  350. ctxt->sax->comment = *((commentSAXFunc *) value);
  351. } else if (!strcmp(name, "SAX function warning")) {
  352. ctxt->sax->warning = *((warningSAXFunc *) value);
  353. } else if (!strcmp(name, "SAX function error")) {
  354. ctxt->sax->error = *((errorSAXFunc *) value);
  355. } else if (!strcmp(name, "SAX function fatalError")) {
  356. ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value);
  357. } else if (!strcmp(name, "SAX function getParameterEntity")) {
  358. ctxt->sax->getParameterEntity =
  359. *((getParameterEntitySAXFunc *) value);
  360. } else if (!strcmp(name, "SAX function cdataBlock")) {
  361. ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value);
  362. } else if (!strcmp(name, "SAX function externalSubset")) {
  363. ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value);
  364. } else {
  365. return (-1);
  366. }
  367. return (0);
  368. }
  369. /**
  370. * xmlDecodeEntities:
  371. * @ctxt: the parser context
  372. * @len: the len to decode (in bytes !), -1 for no size limit
  373. * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
  374. * @end: an end marker xmlChar, 0 if none
  375. * @end2: an end marker xmlChar, 0 if none
  376. * @end3: an end marker xmlChar, 0 if none
  377. *
  378. * This function is deprecated, we now always process entities content
  379. * through xmlStringDecodeEntities
  380. *
  381. * TODO: remove it in next major release.
  382. *
  383. * [67] Reference ::= EntityRef | CharRef
  384. *
  385. * [69] PEReference ::= '%' Name ';'
  386. *
  387. * Returns A newly allocated string with the substitution done. The caller
  388. * must deallocate it !
  389. */
  390. xmlChar *
  391. xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
  392. int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
  393. xmlChar end ATTRIBUTE_UNUSED,
  394. xmlChar end2 ATTRIBUTE_UNUSED,
  395. xmlChar end3 ATTRIBUTE_UNUSED)
  396. {
  397. static int deprecated = 0;
  398. if (!deprecated) {
  399. xmlGenericError(xmlGenericErrorContext,
  400. "xmlDecodeEntities() deprecated function reached\n");
  401. deprecated = 1;
  402. }
  403. return (NULL);
  404. }
  405. /**
  406. * xmlNamespaceParseNCName:
  407. * @ctxt: an XML parser context
  408. *
  409. * parse an XML namespace name.
  410. *
  411. * TODO: this seems not in use anymore, the namespace handling is done on
  412. * top of the SAX interfaces, i.e. not on raw input.
  413. *
  414. * [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
  415. *
  416. * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
  417. * CombiningChar | Extender
  418. *
  419. * Returns the namespace name or NULL
  420. */
  421. xmlChar *
  422. xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  423. {
  424. static int deprecated = 0;
  425. if (!deprecated) {
  426. xmlGenericError(xmlGenericErrorContext,
  427. "xmlNamespaceParseNCName() deprecated function reached\n");
  428. deprecated = 1;
  429. }
  430. return (NULL);
  431. }
  432. /**
  433. * xmlNamespaceParseQName:
  434. * @ctxt: an XML parser context
  435. * @prefix: a xmlChar **
  436. *
  437. * TODO: this seems not in use anymore, the namespace handling is done on
  438. * top of the SAX interfaces, i.e. not on raw input.
  439. *
  440. * parse an XML qualified name
  441. *
  442. * [NS 5] QName ::= (Prefix ':')? LocalPart
  443. *
  444. * [NS 6] Prefix ::= NCName
  445. *
  446. * [NS 7] LocalPart ::= NCName
  447. *
  448. * Returns the local part, and prefix is updated
  449. * to get the Prefix if any.
  450. */
  451. xmlChar *
  452. xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
  453. xmlChar ** prefix ATTRIBUTE_UNUSED)
  454. {
  455. static int deprecated = 0;
  456. if (!deprecated) {
  457. xmlGenericError(xmlGenericErrorContext,
  458. "xmlNamespaceParseQName() deprecated function reached\n");
  459. deprecated = 1;
  460. }
  461. return (NULL);
  462. }
  463. /**
  464. * xmlNamespaceParseNSDef:
  465. * @ctxt: an XML parser context
  466. *
  467. * parse a namespace prefix declaration
  468. *
  469. * TODO: this seems not in use anymore, the namespace handling is done on
  470. * top of the SAX interfaces, i.e. not on raw input.
  471. *
  472. * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
  473. *
  474. * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
  475. *
  476. * Returns the namespace name
  477. */
  478. xmlChar *
  479. xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  480. {
  481. static int deprecated = 0;
  482. if (!deprecated) {
  483. xmlGenericError(xmlGenericErrorContext,
  484. "xmlNamespaceParseNSDef() deprecated function reached\n");
  485. deprecated = 1;
  486. }
  487. return (NULL);
  488. }
  489. /**
  490. * xmlParseQuotedString:
  491. * @ctxt: an XML parser context
  492. *
  493. * Parse and return a string between quotes or doublequotes
  494. *
  495. * TODO: Deprecated, to be removed at next drop of binary compatibility
  496. *
  497. * Returns the string parser or NULL.
  498. */
  499. xmlChar *
  500. xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  501. {
  502. static int deprecated = 0;
  503. if (!deprecated) {
  504. xmlGenericError(xmlGenericErrorContext,
  505. "xmlParseQuotedString() deprecated function reached\n");
  506. deprecated = 1;
  507. }
  508. return (NULL);
  509. }
  510. /**
  511. * xmlParseNamespace:
  512. * @ctxt: an XML parser context
  513. *
  514. * xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
  515. *
  516. * This is what the older xml-name Working Draft specified, a bunch of
  517. * other stuff may still rely on it, so support is still here as
  518. * if it was declared on the root of the Tree:-(
  519. *
  520. * TODO: remove from library
  521. *
  522. * To be removed at next drop of binary compatibility
  523. */
  524. void
  525. xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  526. {
  527. static int deprecated = 0;
  528. if (!deprecated) {
  529. xmlGenericError(xmlGenericErrorContext,
  530. "xmlParseNamespace() deprecated function reached\n");
  531. deprecated = 1;
  532. }
  533. }
  534. /**
  535. * xmlScanName:
  536. * @ctxt: an XML parser context
  537. *
  538. * Trickery: parse an XML name but without consuming the input flow
  539. * Needed for rollback cases. Used only when parsing entities references.
  540. *
  541. * TODO: seems deprecated now, only used in the default part of
  542. * xmlParserHandleReference
  543. *
  544. * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
  545. * CombiningChar | Extender
  546. *
  547. * [5] Name ::= (Letter | '_' | ':') (NameChar)*
  548. *
  549. * [6] Names ::= Name (S Name)*
  550. *
  551. * Returns the Name parsed or NULL
  552. */
  553. xmlChar *
  554. xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  555. {
  556. static int deprecated = 0;
  557. if (!deprecated) {
  558. xmlGenericError(xmlGenericErrorContext,
  559. "xmlScanName() deprecated function reached\n");
  560. deprecated = 1;
  561. }
  562. return (NULL);
  563. }
  564. /**
  565. * xmlParserHandleReference:
  566. * @ctxt: the parser context
  567. *
  568. * TODO: Remove, now deprecated ... the test is done directly in the
  569. * content parsing
  570. * routines.
  571. *
  572. * [67] Reference ::= EntityRef | CharRef
  573. *
  574. * [68] EntityRef ::= '&' Name ';'
  575. *
  576. * [ WFC: Entity Declared ]
  577. * the Name given in the entity reference must match that in an entity
  578. * declaration, except that well-formed documents need not declare any
  579. * of the following entities: amp, lt, gt, apos, quot.
  580. *
  581. * [ WFC: Parsed Entity ]
  582. * An entity reference must not contain the name of an unparsed entity
  583. *
  584. * [66] CharRef ::= '&#' [0-9]+ ';' |
  585. * '&#x' [0-9a-fA-F]+ ';'
  586. *
  587. * A PEReference may have been detected in the current input stream
  588. * the handling is done accordingly to
  589. * http://www.w3.org/TR/REC-xml#entproc
  590. */
  591. void
  592. xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
  593. {
  594. static int deprecated = 0;
  595. if (!deprecated) {
  596. xmlGenericError(xmlGenericErrorContext,
  597. "xmlParserHandleReference() deprecated function reached\n");
  598. deprecated = 1;
  599. }
  600. return;
  601. }
  602. /**
  603. * xmlHandleEntity:
  604. * @ctxt: an XML parser context
  605. * @entity: an XML entity pointer.
  606. *
  607. * Default handling of defined entities, when should we define a new input
  608. * stream ? When do we just handle that as a set of chars ?
  609. *
  610. * OBSOLETE: to be removed at some point.
  611. */
  612. void
  613. xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
  614. xmlEntityPtr entity ATTRIBUTE_UNUSED)
  615. {
  616. static int deprecated = 0;
  617. if (!deprecated) {
  618. xmlGenericError(xmlGenericErrorContext,
  619. "xmlHandleEntity() deprecated function reached\n");
  620. deprecated = 1;
  621. }
  622. }
  623. /**
  624. * xmlNewGlobalNs:
  625. * @doc: the document carrying the namespace
  626. * @href: the URI associated
  627. * @prefix: the prefix for the namespace
  628. *
  629. * Creation of a Namespace, the old way using PI and without scoping
  630. * DEPRECATED !!!
  631. * Returns NULL this functionality had been removed
  632. */
  633. xmlNsPtr
  634. xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
  635. const xmlChar * href ATTRIBUTE_UNUSED,
  636. const xmlChar * prefix ATTRIBUTE_UNUSED)
  637. {
  638. static int deprecated = 0;
  639. if (!deprecated) {
  640. xmlGenericError(xmlGenericErrorContext,
  641. "xmlNewGlobalNs() deprecated function reached\n");
  642. deprecated = 1;
  643. }
  644. return (NULL);
  645. }
  646. /**
  647. * xmlUpgradeOldNs:
  648. * @doc: a document pointer
  649. *
  650. * Upgrade old style Namespaces (PI) and move them to the root of the document.
  651. * DEPRECATED
  652. */
  653. void
  654. xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
  655. {
  656. static int deprecated = 0;
  657. if (!deprecated) {
  658. xmlGenericError(xmlGenericErrorContext,
  659. "xmlUpgradeOldNs() deprecated function reached\n");
  660. deprecated = 1;
  661. }
  662. }
  663. /**
  664. * xmlEncodeEntities:
  665. * @doc: the document containing the string
  666. * @input: A string to convert to XML.
  667. *
  668. * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
  669. * compatibility
  670. *
  671. * People must migrate their code to xmlEncodeEntitiesReentrant !
  672. * This routine will issue a warning when encountered.
  673. *
  674. * Returns NULL
  675. */
  676. const xmlChar *
  677. xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
  678. const xmlChar * input ATTRIBUTE_UNUSED)
  679. {
  680. static int warning = 1;
  681. if (warning) {
  682. xmlGenericError(xmlGenericErrorContext,
  683. "Deprecated API xmlEncodeEntities() used\n");
  684. xmlGenericError(xmlGenericErrorContext,
  685. " change code to use xmlEncodeEntitiesReentrant()\n");
  686. warning = 0;
  687. }
  688. return (NULL);
  689. }
  690. /************************************************************************
  691. * *
  692. * Old set of SAXv1 functions *
  693. * *
  694. ************************************************************************/
  695. static int deprecated_v1_msg = 0;
  696. #define DEPRECATED(n) \
  697. if (deprecated_v1_msg == 0) \
  698. xmlGenericError(xmlGenericErrorContext, \
  699. "Use of deprecated SAXv1 function %s\n", n); \
  700. deprecated_v1_msg++;
  701. /**
  702. * getPublicId:
  703. * @ctx: the user data (XML parser context)
  704. *
  705. * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
  706. * DEPRECATED: use xmlSAX2GetPublicId()
  707. *
  708. * Returns a xmlChar *
  709. */
  710. const xmlChar *
  711. getPublicId(void *ctx)
  712. {
  713. DEPRECATED("getPublicId")
  714. return (xmlSAX2GetPublicId(ctx));
  715. }
  716. /**
  717. * getSystemId:
  718. * @ctx: the user data (XML parser context)
  719. *
  720. * Provides the system ID, basically URL or filename e.g.
  721. * http://www.sgmlsource.com/dtds/memo.dtd
  722. * DEPRECATED: use xmlSAX2GetSystemId()
  723. *
  724. * Returns a xmlChar *
  725. */
  726. const xmlChar *
  727. getSystemId(void *ctx)
  728. {
  729. DEPRECATED("getSystemId")
  730. return (xmlSAX2GetSystemId(ctx));
  731. }
  732. /**
  733. * getLineNumber:
  734. * @ctx: the user data (XML parser context)
  735. *
  736. * Provide the line number of the current parsing point.
  737. * DEPRECATED: use xmlSAX2GetLineNumber()
  738. *
  739. * Returns an int
  740. */
  741. int
  742. getLineNumber(void *ctx)
  743. {
  744. DEPRECATED("getLineNumber")
  745. return (xmlSAX2GetLineNumber(ctx));
  746. }
  747. /**
  748. * getColumnNumber:
  749. * @ctx: the user data (XML parser context)
  750. *
  751. * Provide the column number of the current parsing point.
  752. * DEPRECATED: use xmlSAX2GetColumnNumber()
  753. *
  754. * Returns an int
  755. */
  756. int
  757. getColumnNumber(void *ctx)
  758. {
  759. DEPRECATED("getColumnNumber")
  760. return (xmlSAX2GetColumnNumber(ctx));
  761. }
  762. /**
  763. * isStandalone:
  764. * @ctx: the user data (XML parser context)
  765. *
  766. * Is this document tagged standalone ?
  767. * DEPRECATED: use xmlSAX2IsStandalone()
  768. *
  769. * Returns 1 if true
  770. */
  771. int
  772. isStandalone(void *ctx)
  773. {
  774. DEPRECATED("isStandalone")
  775. return (xmlSAX2IsStandalone(ctx));
  776. }
  777. /**
  778. * hasInternalSubset:
  779. * @ctx: the user data (XML parser context)
  780. *
  781. * Does this document has an internal subset
  782. * DEPRECATED: use xmlSAX2HasInternalSubset()
  783. *
  784. * Returns 1 if true
  785. */
  786. int
  787. hasInternalSubset(void *ctx)
  788. {
  789. DEPRECATED("hasInternalSubset")
  790. return (xmlSAX2HasInternalSubset(ctx));
  791. }
  792. /**
  793. * hasExternalSubset:
  794. * @ctx: the user data (XML parser context)
  795. *
  796. * Does this document has an external subset
  797. * DEPRECATED: use xmlSAX2HasExternalSubset()
  798. *
  799. * Returns 1 if true
  800. */
  801. int
  802. hasExternalSubset(void *ctx)
  803. {
  804. DEPRECATED("hasExternalSubset")
  805. return (xmlSAX2HasExternalSubset(ctx));
  806. }
  807. /**
  808. * internalSubset:
  809. * @ctx: the user data (XML parser context)
  810. * @name: the root element name
  811. * @ExternalID: the external ID
  812. * @SystemID: the SYSTEM ID (e.g. filename or URL)
  813. *
  814. * Callback on internal subset declaration.
  815. * DEPRECATED: use xmlSAX2InternalSubset()
  816. */
  817. void
  818. internalSubset(void *ctx, const xmlChar * name,
  819. const xmlChar * ExternalID, const xmlChar * SystemID)
  820. {
  821. DEPRECATED("internalSubset")
  822. xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
  823. }
  824. /**
  825. * externalSubset:
  826. * @ctx: the user data (XML parser context)
  827. * @name: the root element name
  828. * @ExternalID: the external ID
  829. * @SystemID: the SYSTEM ID (e.g. filename or URL)
  830. *
  831. * Callback on external subset declaration.
  832. * DEPRECATED: use xmlSAX2ExternalSubset()
  833. */
  834. void
  835. externalSubset(void *ctx, const xmlChar * name,
  836. const xmlChar * ExternalID, const xmlChar * SystemID)
  837. {
  838. DEPRECATED("externalSubset")
  839. xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
  840. }
  841. /**
  842. * resolveEntity:
  843. * @ctx: the user data (XML parser context)
  844. * @publicId: The public ID of the entity
  845. * @systemId: The system ID of the entity
  846. *
  847. * The entity loader, to control the loading of external entities,
  848. * the application can either:
  849. * - override this resolveEntity() callback in the SAX block
  850. * - or better use the xmlSetExternalEntityLoader() function to
  851. * set up it's own entity resolution routine
  852. * DEPRECATED: use xmlSAX2ResolveEntity()
  853. *
  854. * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
  855. */
  856. xmlParserInputPtr
  857. resolveEntity(void *ctx, const xmlChar * publicId,
  858. const xmlChar * systemId)
  859. {
  860. DEPRECATED("resolveEntity")
  861. return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
  862. }
  863. /**
  864. * getEntity:
  865. * @ctx: the user data (XML parser context)
  866. * @name: The entity name
  867. *
  868. * Get an entity by name
  869. * DEPRECATED: use xmlSAX2GetEntity()
  870. *
  871. * Returns the xmlEntityPtr if found.
  872. */
  873. xmlEntityPtr
  874. getEntity(void *ctx, const xmlChar * name)
  875. {
  876. DEPRECATED("getEntity")
  877. return (xmlSAX2GetEntity(ctx, name));
  878. }
  879. /**
  880. * getParameterEntity:
  881. * @ctx: the user data (XML parser context)
  882. * @name: The entity name
  883. *
  884. * Get a parameter entity by name
  885. * DEPRECATED: use xmlSAX2GetParameterEntity()
  886. *
  887. * Returns the xmlEntityPtr if found.
  888. */
  889. xmlEntityPtr
  890. getParameterEntity(void *ctx, const xmlChar * name)
  891. {
  892. DEPRECATED("getParameterEntity")
  893. return (xmlSAX2GetParameterEntity(ctx, name));
  894. }
  895. /**
  896. * entityDecl:
  897. * @ctx: the user data (XML parser context)
  898. * @name: the entity name
  899. * @type: the entity type
  900. * @publicId: The public ID of the entity
  901. * @systemId: The system ID of the entity
  902. * @content: the entity value (without processing).
  903. *
  904. * An entity definition has been parsed
  905. * DEPRECATED: use xmlSAX2EntityDecl()
  906. */
  907. void
  908. entityDecl(void *ctx, const xmlChar * name, int type,
  909. const xmlChar * publicId, const xmlChar * systemId,
  910. xmlChar * content)
  911. {
  912. DEPRECATED("entityDecl")
  913. xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
  914. }
  915. /**
  916. * attributeDecl:
  917. * @ctx: the user data (XML parser context)
  918. * @elem: the name of the element
  919. * @fullname: the attribute name
  920. * @type: the attribute type
  921. * @def: the type of default value
  922. * @defaultValue: the attribute default value
  923. * @tree: the tree of enumerated value set
  924. *
  925. * An attribute definition has been parsed
  926. * DEPRECATED: use xmlSAX2AttributeDecl()
  927. */
  928. void
  929. attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
  930. int type, int def, const xmlChar * defaultValue,
  931. xmlEnumerationPtr tree)
  932. {
  933. DEPRECATED("attributeDecl")
  934. xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
  935. tree);
  936. }
  937. /**
  938. * elementDecl:
  939. * @ctx: the user data (XML parser context)
  940. * @name: the element name
  941. * @type: the element type
  942. * @content: the element value tree
  943. *
  944. * An element definition has been parsed
  945. * DEPRECATED: use xmlSAX2ElementDecl()
  946. */
  947. void
  948. elementDecl(void *ctx, const xmlChar * name, int type,
  949. xmlElementContentPtr content)
  950. {
  951. DEPRECATED("elementDecl")
  952. xmlSAX2ElementDecl(ctx, name, type, content);
  953. }
  954. /**
  955. * notationDecl:
  956. * @ctx: the user data (XML parser context)
  957. * @name: The name of the notation
  958. * @publicId: The public ID of the entity
  959. * @systemId: The system ID of the entity
  960. *
  961. * What to do when a notation declaration has been parsed.
  962. * DEPRECATED: use xmlSAX2NotationDecl()
  963. */
  964. void
  965. notationDecl(void *ctx, const xmlChar * name,
  966. const xmlChar * publicId, const xmlChar * systemId)
  967. {
  968. DEPRECATED("notationDecl")
  969. xmlSAX2NotationDecl(ctx, name, publicId, systemId);
  970. }
  971. /**
  972. * unparsedEntityDecl:
  973. * @ctx: the user data (XML parser context)
  974. * @name: The name of the entity
  975. * @publicId: The public ID of the entity
  976. * @systemId: The system ID of the entity
  977. * @notationName: the name of the notation
  978. *
  979. * What to do when an unparsed entity declaration is parsed
  980. * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
  981. */
  982. void
  983. unparsedEntityDecl(void *ctx, const xmlChar * name,
  984. const xmlChar * publicId, const xmlChar * systemId,
  985. const xmlChar * notationName)
  986. {
  987. DEPRECATED("unparsedEntityDecl")
  988. xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
  989. notationName);
  990. }
  991. /**
  992. * setDocumentLocator:
  993. * @ctx: the user data (XML parser context)
  994. * @loc: A SAX Locator
  995. *
  996. * Receive the document locator at startup, actually xmlDefaultSAXLocator
  997. * Everything is available on the context, so this is useless in our case.
  998. * DEPRECATED
  999. */
  1000. void
  1001. setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
  1002. xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
  1003. {
  1004. DEPRECATED("setDocumentLocator")
  1005. }
  1006. /**
  1007. * startDocument:
  1008. * @ctx: the user data (XML parser context)
  1009. *
  1010. * called when the document start being processed.
  1011. * DEPRECATED: use xmlSAX2StartDocument()
  1012. */
  1013. void
  1014. startDocument(void *ctx)
  1015. {
  1016. /* don't be too painful for glade users */
  1017. /* DEPRECATED("startDocument") */
  1018. xmlSAX2StartDocument(ctx);
  1019. }
  1020. /**
  1021. * endDocument:
  1022. * @ctx: the user data (XML parser context)
  1023. *
  1024. * called when the document end has been detected.
  1025. * DEPRECATED: use xmlSAX2EndDocument()
  1026. */
  1027. void
  1028. endDocument(void *ctx)
  1029. {
  1030. DEPRECATED("endDocument")
  1031. xmlSAX2EndDocument(ctx);
  1032. }
  1033. /**
  1034. * attribute:
  1035. * @ctx: the user data (XML parser context)
  1036. * @fullname: The attribute name, including namespace prefix
  1037. * @value: The attribute value
  1038. *
  1039. * Handle an attribute that has been read by the parser.
  1040. * The default handling is to convert the attribute into an
  1041. * DOM subtree and past it in a new xmlAttr element added to
  1042. * the element.
  1043. * DEPRECATED: use xmlSAX2Attribute()
  1044. */
  1045. void
  1046. attribute(void *ctx ATTRIBUTE_UNUSED,
  1047. const xmlChar * fullname ATTRIBUTE_UNUSED,
  1048. const xmlChar * value ATTRIBUTE_UNUSED)
  1049. {
  1050. DEPRECATED("attribute")
  1051. }
  1052. /**
  1053. * startElement:
  1054. * @ctx: the user data (XML parser context)
  1055. * @fullname: The element name, including namespace prefix
  1056. * @atts: An array of name/value attributes pairs, NULL terminated
  1057. *
  1058. * called when an opening tag has been processed.
  1059. * DEPRECATED: use xmlSAX2StartElement()
  1060. */
  1061. void
  1062. startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
  1063. {
  1064. xmlSAX2StartElement(ctx, fullname, atts);
  1065. }
  1066. /**
  1067. * endElement:
  1068. * @ctx: the user data (XML parser context)
  1069. * @name: The element name
  1070. *
  1071. * called when the end of an element has been detected.
  1072. * DEPRECATED: use xmlSAX2EndElement()
  1073. */
  1074. void
  1075. endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
  1076. {
  1077. DEPRECATED("endElement")
  1078. xmlSAX2EndElement(ctx, name);
  1079. }
  1080. /**
  1081. * reference:
  1082. * @ctx: the user data (XML parser context)
  1083. * @name: The entity name
  1084. *
  1085. * called when an entity reference is detected.
  1086. * DEPRECATED: use xmlSAX2Reference()
  1087. */
  1088. void
  1089. reference(void *ctx, const xmlChar * name)
  1090. {
  1091. DEPRECATED("reference")
  1092. xmlSAX2Reference(ctx, name);
  1093. }
  1094. /**
  1095. * characters:
  1096. * @ctx: the user data (XML parser context)
  1097. * @ch: a xmlChar string
  1098. * @len: the number of xmlChar
  1099. *
  1100. * receiving some chars from the parser.
  1101. * DEPRECATED: use xmlSAX2Characters()
  1102. */
  1103. void
  1104. characters(void *ctx, const xmlChar * ch, int len)
  1105. {
  1106. DEPRECATED("characters")
  1107. xmlSAX2Characters(ctx, ch, len);
  1108. }
  1109. /**
  1110. * ignorableWhitespace:
  1111. * @ctx: the user data (XML parser context)
  1112. * @ch: a xmlChar string
  1113. * @len: the number of xmlChar
  1114. *
  1115. * receiving some ignorable whitespaces from the parser.
  1116. * UNUSED: by default the DOM building will use characters
  1117. * DEPRECATED: use xmlSAX2IgnorableWhitespace()
  1118. */
  1119. void
  1120. ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
  1121. const xmlChar * ch ATTRIBUTE_UNUSED,
  1122. int len ATTRIBUTE_UNUSED)
  1123. {
  1124. DEPRECATED("ignorableWhitespace")
  1125. }
  1126. /**
  1127. * processingInstruction:
  1128. * @ctx: the user data (XML parser context)
  1129. * @target: the target name
  1130. * @data: the PI data's
  1131. *
  1132. * A processing instruction has been parsed.
  1133. * DEPRECATED: use xmlSAX2ProcessingInstruction()
  1134. */
  1135. void
  1136. processingInstruction(void *ctx, const xmlChar * target,
  1137. const xmlChar * data)
  1138. {
  1139. DEPRECATED("processingInstruction")
  1140. xmlSAX2ProcessingInstruction(ctx, target, data);
  1141. }
  1142. /**
  1143. * globalNamespace:
  1144. * @ctx: the user data (XML parser context)
  1145. * @href: the namespace associated URN
  1146. * @prefix: the namespace prefix
  1147. *
  1148. * An old global namespace has been parsed.
  1149. * DEPRECATED
  1150. */
  1151. void
  1152. globalNamespace(void *ctx ATTRIBUTE_UNUSED,
  1153. const xmlChar * href ATTRIBUTE_UNUSED,
  1154. const xmlChar * prefix ATTRIBUTE_UNUSED)
  1155. {
  1156. DEPRECATED("globalNamespace")
  1157. }
  1158. /**
  1159. * setNamespace:
  1160. * @ctx: the user data (XML parser context)
  1161. * @name: the namespace prefix
  1162. *
  1163. * Set the current element namespace.
  1164. * DEPRECATED
  1165. */
  1166. void
  1167. setNamespace(void *ctx ATTRIBUTE_UNUSED,
  1168. const xmlChar * name ATTRIBUTE_UNUSED)
  1169. {
  1170. DEPRECATED("setNamespace")
  1171. }
  1172. /**
  1173. * getNamespace:
  1174. * @ctx: the user data (XML parser context)
  1175. *
  1176. * Get the current element namespace.
  1177. * DEPRECATED
  1178. *
  1179. * Returns the xmlNsPtr or NULL if none
  1180. */
  1181. xmlNsPtr
  1182. getNamespace(void *ctx ATTRIBUTE_UNUSED)
  1183. {
  1184. DEPRECATED("getNamespace")
  1185. return (NULL);
  1186. }
  1187. /**
  1188. * checkNamespace:
  1189. * @ctx: the user data (XML parser context)
  1190. * @namespace: the namespace to check against
  1191. *
  1192. * Check that the current element namespace is the same as the
  1193. * one read upon parsing.
  1194. * DEPRECATED
  1195. *
  1196. * Returns 1 if true 0 otherwise
  1197. */
  1198. int
  1199. checkNamespace(void *ctx ATTRIBUTE_UNUSED,
  1200. xmlChar * namespace ATTRIBUTE_UNUSED)
  1201. {
  1202. DEPRECATED("checkNamespace")
  1203. return (0);
  1204. }
  1205. /**
  1206. * namespaceDecl:
  1207. * @ctx: the user data (XML parser context)
  1208. * @href: the namespace associated URN
  1209. * @prefix: the namespace prefix
  1210. *
  1211. * A namespace has been parsed.
  1212. * DEPRECATED
  1213. */
  1214. void
  1215. namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
  1216. const xmlChar * href ATTRIBUTE_UNUSED,
  1217. const xmlChar * prefix ATTRIBUTE_UNUSED)
  1218. {
  1219. DEPRECATED("namespaceDecl")
  1220. }
  1221. /**
  1222. * comment:
  1223. * @ctx: the user data (XML parser context)
  1224. * @value: the comment content
  1225. *
  1226. * A comment has been parsed.
  1227. * DEPRECATED: use xmlSAX2Comment()
  1228. */
  1229. void
  1230. comment(void *ctx, const xmlChar * value)
  1231. {
  1232. DEPRECATED("comment")
  1233. xmlSAX2Comment(ctx, value);
  1234. }
  1235. /**
  1236. * cdataBlock:
  1237. * @ctx: the user data (XML parser context)
  1238. * @value: The pcdata content
  1239. * @len: the block length
  1240. *
  1241. * called when a pcdata block has been parsed
  1242. * DEPRECATED: use xmlSAX2CDataBlock()
  1243. */
  1244. void
  1245. cdataBlock(void *ctx, const xmlChar * value, int len)
  1246. {
  1247. DEPRECATED("cdataBlock")
  1248. xmlSAX2CDataBlock(ctx, value, len);
  1249. }
  1250. #define bottom_legacy
  1251. #include "elfgcchack.h"
  1252. #endif /* LIBXML_LEGACY_ENABLED */