Daniel Veillard | 8940fd5 | 2003-09-29 09:07:08 +0000 | [diff] [blame^] | 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 | |
| 10 | #define IN_LIBXML |
| 11 | #include "libxml.h" |
| 12 | |
| 13 | #include <libxml/tree.h> |
| 14 | #include <libxml/entities.h> |
| 15 | #include <libxml/SAX.h> |
| 16 | #include <libxml/parserInternals.h> |
| 17 | |
| 18 | #ifdef LIBXML_LEGACY_ENABLED |
| 19 | void xmlUpgradeOldNs(xmlDocPtr doc); |
| 20 | |
| 21 | /************************************************************************ |
| 22 | * * |
| 23 | * Deprecated functions kept for compatibility * |
| 24 | * * |
| 25 | ************************************************************************/ |
| 26 | |
| 27 | /** |
| 28 | * xmlDecodeEntities: |
| 29 | * @ctxt: the parser context |
| 30 | * @len: the len to decode (in bytes !), -1 for no size limit |
| 31 | * @what: combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF |
| 32 | * @end: an end marker xmlChar, 0 if none |
| 33 | * @end2: an end marker xmlChar, 0 if none |
| 34 | * @end3: an end marker xmlChar, 0 if none |
| 35 | * |
| 36 | * This function is deprecated, we now always process entities content |
| 37 | * through xmlStringDecodeEntities |
| 38 | * |
| 39 | * TODO: remove it in next major release. |
| 40 | * |
| 41 | * [67] Reference ::= EntityRef | CharRef |
| 42 | * |
| 43 | * [69] PEReference ::= '%' Name ';' |
| 44 | * |
| 45 | * Returns A newly allocated string with the substitution done. The caller |
| 46 | * must deallocate it ! |
| 47 | */ |
| 48 | xmlChar * |
| 49 | xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, |
| 50 | int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED, |
| 51 | xmlChar end ATTRIBUTE_UNUSED, |
| 52 | xmlChar end2 ATTRIBUTE_UNUSED, |
| 53 | xmlChar end3 ATTRIBUTE_UNUSED) |
| 54 | { |
| 55 | static int deprecated = 0; |
| 56 | |
| 57 | if (!deprecated) { |
| 58 | xmlGenericError(xmlGenericErrorContext, |
| 59 | "xmlDecodeEntities() deprecated function reached\n"); |
| 60 | deprecated = 1; |
| 61 | } |
| 62 | return (NULL); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * xmlNamespaceParseNCName: |
| 67 | * @ctxt: an XML parser context |
| 68 | * |
| 69 | * parse an XML namespace name. |
| 70 | * |
| 71 | * TODO: this seems not in use anymore, the namespace handling is done on |
| 72 | * top of the SAX interfaces, i.e. not on raw input. |
| 73 | * |
| 74 | * [NS 3] NCName ::= (Letter | '_') (NCNameChar)* |
| 75 | * |
| 76 | * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | |
| 77 | * CombiningChar | Extender |
| 78 | * |
| 79 | * Returns the namespace name or NULL |
| 80 | */ |
| 81 | |
| 82 | xmlChar * |
| 83 | xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 84 | { |
| 85 | static int deprecated = 0; |
| 86 | |
| 87 | if (!deprecated) { |
| 88 | xmlGenericError(xmlGenericErrorContext, |
| 89 | "xmlNamespaceParseNCName() deprecated function reached\n"); |
| 90 | deprecated = 1; |
| 91 | } |
| 92 | return (NULL); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * xmlNamespaceParseQName: |
| 97 | * @ctxt: an XML parser context |
| 98 | * @prefix: a xmlChar ** |
| 99 | * |
| 100 | * TODO: this seems not in use anymore, the namespace handling is done on |
| 101 | * top of the SAX interfaces, i.e. not on raw input. |
| 102 | * |
| 103 | * parse an XML qualified name |
| 104 | * |
| 105 | * [NS 5] QName ::= (Prefix ':')? LocalPart |
| 106 | * |
| 107 | * [NS 6] Prefix ::= NCName |
| 108 | * |
| 109 | * [NS 7] LocalPart ::= NCName |
| 110 | * |
| 111 | * Returns the local part, and prefix is updated |
| 112 | * to get the Prefix if any. |
| 113 | */ |
| 114 | |
| 115 | xmlChar * |
| 116 | xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, |
| 117 | xmlChar ** prefix ATTRIBUTE_UNUSED) |
| 118 | { |
| 119 | |
| 120 | static int deprecated = 0; |
| 121 | |
| 122 | if (!deprecated) { |
| 123 | xmlGenericError(xmlGenericErrorContext, |
| 124 | "xmlNamespaceParseQName() deprecated function reached\n"); |
| 125 | deprecated = 1; |
| 126 | } |
| 127 | return (NULL); |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * xmlNamespaceParseNSDef: |
| 132 | * @ctxt: an XML parser context |
| 133 | * |
| 134 | * parse a namespace prefix declaration |
| 135 | * |
| 136 | * TODO: this seems not in use anymore, the namespace handling is done on |
| 137 | * top of the SAX interfaces, i.e. not on raw input. |
| 138 | * |
| 139 | * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral |
| 140 | * |
| 141 | * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)? |
| 142 | * |
| 143 | * Returns the namespace name |
| 144 | */ |
| 145 | |
| 146 | xmlChar * |
| 147 | xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 148 | { |
| 149 | static int deprecated = 0; |
| 150 | |
| 151 | if (!deprecated) { |
| 152 | xmlGenericError(xmlGenericErrorContext, |
| 153 | "xmlNamespaceParseNSDef() deprecated function reached\n"); |
| 154 | deprecated = 1; |
| 155 | } |
| 156 | return (NULL); |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * xmlParseQuotedString: |
| 161 | * @ctxt: an XML parser context |
| 162 | * |
| 163 | * Parse and return a string between quotes or doublequotes |
| 164 | * |
| 165 | * TODO: Deprecated, to be removed at next drop of binary compatibility |
| 166 | * |
| 167 | * Returns the string parser or NULL. |
| 168 | */ |
| 169 | xmlChar * |
| 170 | xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 171 | { |
| 172 | static int deprecated = 0; |
| 173 | |
| 174 | if (!deprecated) { |
| 175 | xmlGenericError(xmlGenericErrorContext, |
| 176 | "xmlParseQuotedString() deprecated function reached\n"); |
| 177 | deprecated = 1; |
| 178 | } |
| 179 | return (NULL); |
| 180 | } |
| 181 | |
| 182 | /** |
| 183 | * xmlParseNamespace: |
| 184 | * @ctxt: an XML parser context |
| 185 | * |
| 186 | * xmlParseNamespace: parse specific PI '<?namespace ...' constructs. |
| 187 | * |
| 188 | * This is what the older xml-name Working Draft specified, a bunch of |
| 189 | * other stuff may still rely on it, so support is still here as |
| 190 | * if it was declared on the root of the Tree:-( |
| 191 | * |
| 192 | * TODO: remove from library |
| 193 | * |
| 194 | * To be removed at next drop of binary compatibility |
| 195 | */ |
| 196 | |
| 197 | void |
| 198 | xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 199 | { |
| 200 | static int deprecated = 0; |
| 201 | |
| 202 | if (!deprecated) { |
| 203 | xmlGenericError(xmlGenericErrorContext, |
| 204 | "xmlParseNamespace() deprecated function reached\n"); |
| 205 | deprecated = 1; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | /** |
| 210 | * xmlScanName: |
| 211 | * @ctxt: an XML parser context |
| 212 | * |
| 213 | * Trickery: parse an XML name but without consuming the input flow |
| 214 | * Needed for rollback cases. Used only when parsing entities references. |
| 215 | * |
| 216 | * TODO: seems deprecated now, only used in the default part of |
| 217 | * xmlParserHandleReference |
| 218 | * |
| 219 | * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | |
| 220 | * CombiningChar | Extender |
| 221 | * |
| 222 | * [5] Name ::= (Letter | '_' | ':') (NameChar)* |
| 223 | * |
| 224 | * [6] Names ::= Name (S Name)* |
| 225 | * |
| 226 | * Returns the Name parsed or NULL |
| 227 | */ |
| 228 | |
| 229 | xmlChar * |
| 230 | xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 231 | { |
| 232 | static int deprecated = 0; |
| 233 | |
| 234 | if (!deprecated) { |
| 235 | xmlGenericError(xmlGenericErrorContext, |
| 236 | "xmlScanName() deprecated function reached\n"); |
| 237 | deprecated = 1; |
| 238 | } |
| 239 | return (NULL); |
| 240 | } |
| 241 | |
| 242 | /** |
| 243 | * xmlParserHandleReference: |
| 244 | * @ctxt: the parser context |
| 245 | * |
| 246 | * TODO: Remove, now deprecated ... the test is done directly in the |
| 247 | * content parsing |
| 248 | * routines. |
| 249 | * |
| 250 | * [67] Reference ::= EntityRef | CharRef |
| 251 | * |
| 252 | * [68] EntityRef ::= '&' Name ';' |
| 253 | * |
| 254 | * [ WFC: Entity Declared ] |
| 255 | * the Name given in the entity reference must match that in an entity |
| 256 | * declaration, except that well-formed documents need not declare any |
| 257 | * of the following entities: amp, lt, gt, apos, quot. |
| 258 | * |
| 259 | * [ WFC: Parsed Entity ] |
| 260 | * An entity reference must not contain the name of an unparsed entity |
| 261 | * |
| 262 | * [66] CharRef ::= '&#' [0-9]+ ';' | |
| 263 | * '&#x' [0-9a-fA-F]+ ';' |
| 264 | * |
| 265 | * A PEReference may have been detected in the current input stream |
| 266 | * the handling is done accordingly to |
| 267 | * http://www.w3.org/TR/REC-xml#entproc |
| 268 | */ |
| 269 | void |
| 270 | xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) |
| 271 | { |
| 272 | static int deprecated = 0; |
| 273 | |
| 274 | if (!deprecated) { |
| 275 | xmlGenericError(xmlGenericErrorContext, |
| 276 | "xmlParserHandleReference() deprecated function reached\n"); |
| 277 | deprecated = 1; |
| 278 | } |
| 279 | |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * xmlHandleEntity: |
| 285 | * @ctxt: an XML parser context |
| 286 | * @entity: an XML entity pointer. |
| 287 | * |
| 288 | * Default handling of defined entities, when should we define a new input |
| 289 | * stream ? When do we just handle that as a set of chars ? |
| 290 | * |
| 291 | * OBSOLETE: to be removed at some point. |
| 292 | */ |
| 293 | |
| 294 | void |
| 295 | xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, |
| 296 | xmlEntityPtr entity ATTRIBUTE_UNUSED) |
| 297 | { |
| 298 | static int deprecated = 0; |
| 299 | |
| 300 | if (!deprecated) { |
| 301 | xmlGenericError(xmlGenericErrorContext, |
| 302 | "xmlHandleEntity() deprecated function reached\n"); |
| 303 | deprecated = 1; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | /** |
| 308 | * xmlNewGlobalNs: |
| 309 | * @doc: the document carrying the namespace |
| 310 | * @href: the URI associated |
| 311 | * @prefix: the prefix for the namespace |
| 312 | * |
| 313 | * Creation of a Namespace, the old way using PI and without scoping |
| 314 | * DEPRECATED !!! |
| 315 | * It now create a namespace on the root element of the document if found. |
| 316 | * Returns NULL this functionality had been removed |
| 317 | */ |
| 318 | xmlNsPtr |
| 319 | xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED, |
| 320 | const xmlChar * href ATTRIBUTE_UNUSED, |
| 321 | const xmlChar * prefix ATTRIBUTE_UNUSED) |
| 322 | { |
| 323 | static int deprecated = 0; |
| 324 | |
| 325 | if (!deprecated) { |
| 326 | xmlGenericError(xmlGenericErrorContext, |
| 327 | "xmlNewGlobalNs() deprecated function reached\n"); |
| 328 | deprecated = 1; |
| 329 | } |
| 330 | return (NULL); |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * xmlUpgradeOldNs: |
| 335 | * @doc: a document pointer |
| 336 | * |
| 337 | * Upgrade old style Namespaces (PI) and move them to the root of the document. |
| 338 | * DEPRECATED |
| 339 | */ |
| 340 | void |
| 341 | xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED) |
| 342 | { |
| 343 | static int deprecated = 0; |
| 344 | |
| 345 | if (!deprecated) { |
| 346 | xmlGenericError(xmlGenericErrorContext, |
| 347 | "xmlUpgradeOldNs() deprecated function reached\n"); |
| 348 | deprecated = 1; |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | /** |
| 353 | * xmlEncodeEntities: |
| 354 | * @doc: the document containing the string |
| 355 | * @input: A string to convert to XML. |
| 356 | * |
| 357 | * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary |
| 358 | * compatibility |
| 359 | * |
| 360 | * People must migrate their code to xmlEncodeEntitiesReentrant ! |
| 361 | * This routine will issue a warning when encountered. |
| 362 | * |
| 363 | * Returns NULL |
| 364 | */ |
| 365 | const xmlChar * |
| 366 | xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED, |
| 367 | const xmlChar *input ATTRIBUTE_UNUSED) { |
| 368 | static int warning = 1; |
| 369 | |
| 370 | if (warning) { |
| 371 | xmlGenericError(xmlGenericErrorContext, |
| 372 | "Deprecated API xmlEncodeEntities() used\n"); |
| 373 | xmlGenericError(xmlGenericErrorContext, |
| 374 | " change code to use xmlEncodeEntitiesReentrant()\n"); |
| 375 | warning = 0; |
| 376 | } |
| 377 | return(NULL); |
| 378 | } |
| 379 | |
| 380 | /************************************************************************ |
| 381 | * * |
| 382 | * Old set of SAXv1 functions * |
| 383 | * * |
| 384 | ************************************************************************/ |
| 385 | static int deprecated_v1_msg = 0; |
| 386 | |
| 387 | #define DEPRECATED(n) \ |
| 388 | if (deprecated_v1_msg == 0) \ |
| 389 | xmlGenericError(xmlGenericErrorContext, \ |
| 390 | "Use of deprecated SAXv1 function %s\n", n); \ |
| 391 | deprecated_v1_msg++; |
| 392 | |
| 393 | /** |
| 394 | * getPublicId: |
| 395 | * @ctx: the user data (XML parser context) |
| 396 | * |
| 397 | * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN" |
| 398 | * DEPRECATED: use xmlSAX2GetPublicId() |
| 399 | * |
| 400 | * Returns a xmlChar * |
| 401 | */ |
| 402 | const xmlChar * |
| 403 | getPublicId(void *ctx) |
| 404 | { |
| 405 | DEPRECATED("getPublicId") |
| 406 | return(xmlSAX2GetPublicId(ctx)); |
| 407 | } |
| 408 | |
| 409 | /** |
| 410 | * getSystemId: |
| 411 | * @ctx: the user data (XML parser context) |
| 412 | * |
| 413 | * Provides the system ID, basically URL or filename e.g. |
| 414 | * http://www.sgmlsource.com/dtds/memo.dtd |
| 415 | * DEPRECATED: use xmlSAX2GetSystemId() |
| 416 | * |
| 417 | * Returns a xmlChar * |
| 418 | */ |
| 419 | const xmlChar * |
| 420 | getSystemId(void *ctx) |
| 421 | { |
| 422 | DEPRECATED("getSystemId") |
| 423 | return(xmlSAX2GetSystemId(ctx)); |
| 424 | } |
| 425 | |
| 426 | /** |
| 427 | * getLineNumber: |
| 428 | * @ctx: the user data (XML parser context) |
| 429 | * |
| 430 | * Provide the line number of the current parsing point. |
| 431 | * DEPRECATED: use xmlSAX2GetLineNumber() |
| 432 | * |
| 433 | * Returns an int |
| 434 | */ |
| 435 | int |
| 436 | getLineNumber(void *ctx) |
| 437 | { |
| 438 | DEPRECATED("getLineNumber") |
| 439 | return(xmlSAX2GetLineNumber(ctx)); |
| 440 | } |
| 441 | |
| 442 | /** |
| 443 | * getColumnNumber: |
| 444 | * @ctx: the user data (XML parser context) |
| 445 | * |
| 446 | * Provide the column number of the current parsing point. |
| 447 | * DEPRECATED: use xmlSAX2GetColumnNumber() |
| 448 | * |
| 449 | * Returns an int |
| 450 | */ |
| 451 | int |
| 452 | getColumnNumber(void *ctx) |
| 453 | { |
| 454 | DEPRECATED("getColumnNumber") |
| 455 | return(xmlSAX2GetColumnNumber(ctx)); |
| 456 | } |
| 457 | |
| 458 | /** |
| 459 | * isStandalone: |
| 460 | * @ctx: the user data (XML parser context) |
| 461 | * |
| 462 | * Is this document tagged standalone ? |
| 463 | * DEPRECATED: use xmlSAX2IsStandalone() |
| 464 | * |
| 465 | * Returns 1 if true |
| 466 | */ |
| 467 | int |
| 468 | isStandalone(void *ctx) |
| 469 | { |
| 470 | DEPRECATED("isStandalone") |
| 471 | return(xmlSAX2IsStandalone(ctx)); |
| 472 | } |
| 473 | |
| 474 | /** |
| 475 | * hasInternalSubset: |
| 476 | * @ctx: the user data (XML parser context) |
| 477 | * |
| 478 | * Does this document has an internal subset |
| 479 | * DEPRECATED: use xmlSAX2HasInternalSubset() |
| 480 | * |
| 481 | * Returns 1 if true |
| 482 | */ |
| 483 | int |
| 484 | hasInternalSubset(void *ctx) |
| 485 | { |
| 486 | DEPRECATED("hasInternalSubset") |
| 487 | return(xmlSAX2HasInternalSubset(ctx)); |
| 488 | } |
| 489 | |
| 490 | /** |
| 491 | * hasExternalSubset: |
| 492 | * @ctx: the user data (XML parser context) |
| 493 | * |
| 494 | * Does this document has an external subset |
| 495 | * DEPRECATED: use xmlSAX2HasExternalSubset() |
| 496 | * |
| 497 | * Returns 1 if true |
| 498 | */ |
| 499 | int |
| 500 | hasExternalSubset(void *ctx) |
| 501 | { |
| 502 | DEPRECATED("hasExternalSubset") |
| 503 | return(xmlSAX2HasExternalSubset(ctx)); |
| 504 | } |
| 505 | |
| 506 | /** |
| 507 | * internalSubset: |
| 508 | * @ctx: the user data (XML parser context) |
| 509 | * @name: the root element name |
| 510 | * @ExternalID: the external ID |
| 511 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 512 | * |
| 513 | * Callback on internal subset declaration. |
| 514 | * DEPRECATED: use xmlSAX2InternalSubset() |
| 515 | */ |
| 516 | void |
| 517 | internalSubset(void *ctx, const xmlChar *name, |
| 518 | const xmlChar *ExternalID, const xmlChar *SystemID) |
| 519 | { |
| 520 | DEPRECATED("internalSubset") |
| 521 | xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID); |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * externalSubset: |
| 526 | * @ctx: the user data (XML parser context) |
| 527 | * @name: the root element name |
| 528 | * @ExternalID: the external ID |
| 529 | * @SystemID: the SYSTEM ID (e.g. filename or URL) |
| 530 | * |
| 531 | * Callback on external subset declaration. |
| 532 | * DEPRECATED: use xmlSAX2ExternalSubset() |
| 533 | */ |
| 534 | void |
| 535 | externalSubset(void *ctx, const xmlChar *name, |
| 536 | const xmlChar *ExternalID, const xmlChar *SystemID) |
| 537 | { |
| 538 | DEPRECATED("externalSubset") |
| 539 | xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID); |
| 540 | } |
| 541 | |
| 542 | /** |
| 543 | * resolveEntity: |
| 544 | * @ctx: the user data (XML parser context) |
| 545 | * @publicId: The public ID of the entity |
| 546 | * @systemId: The system ID of the entity |
| 547 | * |
| 548 | * The entity loader, to control the loading of external entities, |
| 549 | * the application can either: |
| 550 | * - override this resolveEntity() callback in the SAX block |
| 551 | * - or better use the xmlSetExternalEntityLoader() function to |
| 552 | * set up it's own entity resolution routine |
| 553 | * DEPRECATED: use xmlSAX2ResolveEntity() |
| 554 | * |
| 555 | * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. |
| 556 | */ |
| 557 | xmlParserInputPtr |
| 558 | resolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId) |
| 559 | { |
| 560 | DEPRECATED("resolveEntity") |
| 561 | return(xmlSAX2ResolveEntity(ctx, publicId, systemId)); |
| 562 | } |
| 563 | |
| 564 | /** |
| 565 | * getEntity: |
| 566 | * @ctx: the user data (XML parser context) |
| 567 | * @name: The entity name |
| 568 | * |
| 569 | * Get an entity by name |
| 570 | * DEPRECATED: use xmlSAX2GetEntity() |
| 571 | * |
| 572 | * Returns the xmlEntityPtr if found. |
| 573 | */ |
| 574 | xmlEntityPtr |
| 575 | getEntity(void *ctx, const xmlChar *name) |
| 576 | { |
| 577 | DEPRECATED("getEntity") |
| 578 | return(xmlSAX2GetEntity(ctx, name)); |
| 579 | } |
| 580 | |
| 581 | /** |
| 582 | * getParameterEntity: |
| 583 | * @ctx: the user data (XML parser context) |
| 584 | * @name: The entity name |
| 585 | * |
| 586 | * Get a parameter entity by name |
| 587 | * DEPRECATED: use xmlSAX2GetParameterEntity() |
| 588 | * |
| 589 | * Returns the xmlEntityPtr if found. |
| 590 | */ |
| 591 | xmlEntityPtr |
| 592 | getParameterEntity(void *ctx, const xmlChar *name) |
| 593 | { |
| 594 | DEPRECATED("getParameterEntity") |
| 595 | return(xmlSAX2GetParameterEntity(ctx, name)); |
| 596 | } |
| 597 | |
| 598 | |
| 599 | /** |
| 600 | * entityDecl: |
| 601 | * @ctx: the user data (XML parser context) |
| 602 | * @name: the entity name |
| 603 | * @type: the entity type |
| 604 | * @publicId: The public ID of the entity |
| 605 | * @systemId: The system ID of the entity |
| 606 | * @content: the entity value (without processing). |
| 607 | * |
| 608 | * An entity definition has been parsed |
| 609 | * DEPRECATED: use xmlSAX2EntityDecl() |
| 610 | */ |
| 611 | void |
| 612 | entityDecl(void *ctx, const xmlChar *name, int type, |
| 613 | const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) |
| 614 | { |
| 615 | DEPRECATED("entityDecl") |
| 616 | xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content); |
| 617 | } |
| 618 | |
| 619 | /** |
| 620 | * attributeDecl: |
| 621 | * @ctx: the user data (XML parser context) |
| 622 | * @elem: the name of the element |
| 623 | * @fullname: the attribute name |
| 624 | * @type: the attribute type |
| 625 | * @def: the type of default value |
| 626 | * @defaultValue: the attribute default value |
| 627 | * @tree: the tree of enumerated value set |
| 628 | * |
| 629 | * An attribute definition has been parsed |
| 630 | * DEPRECATED: use xmlSAX2AttributeDecl() |
| 631 | */ |
| 632 | void |
| 633 | attributeDecl(void *ctx, const xmlChar *elem, const xmlChar *fullname, |
| 634 | int type, int def, const xmlChar *defaultValue, |
| 635 | xmlEnumerationPtr tree) |
| 636 | { |
| 637 | DEPRECATED("attributeDecl") |
| 638 | xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue, tree); |
| 639 | } |
| 640 | |
| 641 | /** |
| 642 | * elementDecl: |
| 643 | * @ctx: the user data (XML parser context) |
| 644 | * @name: the element name |
| 645 | * @type: the element type |
| 646 | * @content: the element value tree |
| 647 | * |
| 648 | * An element definition has been parsed |
| 649 | * DEPRECATED: use xmlSAX2ElementDecl() |
| 650 | */ |
| 651 | void |
| 652 | elementDecl(void *ctx, const xmlChar * name, int type, |
| 653 | xmlElementContentPtr content) |
| 654 | { |
| 655 | DEPRECATED("elementDecl") |
| 656 | xmlSAX2ElementDecl(ctx, name, type, content); |
| 657 | } |
| 658 | |
| 659 | /** |
| 660 | * notationDecl: |
| 661 | * @ctx: the user data (XML parser context) |
| 662 | * @name: The name of the notation |
| 663 | * @publicId: The public ID of the entity |
| 664 | * @systemId: The system ID of the entity |
| 665 | * |
| 666 | * What to do when a notation declaration has been parsed. |
| 667 | * DEPRECATED: use xmlSAX2NotationDecl() |
| 668 | */ |
| 669 | void |
| 670 | notationDecl(void *ctx, const xmlChar *name, |
| 671 | const xmlChar *publicId, const xmlChar *systemId) |
| 672 | { |
| 673 | DEPRECATED("notationDecl") |
| 674 | xmlSAX2NotationDecl(ctx, name, publicId, systemId); |
| 675 | } |
| 676 | |
| 677 | /** |
| 678 | * unparsedEntityDecl: |
| 679 | * @ctx: the user data (XML parser context) |
| 680 | * @name: The name of the entity |
| 681 | * @publicId: The public ID of the entity |
| 682 | * @systemId: The system ID of the entity |
| 683 | * @notationName: the name of the notation |
| 684 | * |
| 685 | * What to do when an unparsed entity declaration is parsed |
| 686 | * DEPRECATED: use xmlSAX2UnparsedEntityDecl() |
| 687 | */ |
| 688 | void |
| 689 | unparsedEntityDecl(void *ctx, const xmlChar *name, |
| 690 | const xmlChar *publicId, const xmlChar *systemId, |
| 691 | const xmlChar *notationName) |
| 692 | { |
| 693 | DEPRECATED("unparsedEntityDecl") |
| 694 | xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId, notationName); |
| 695 | } |
| 696 | |
| 697 | /** |
| 698 | * setDocumentLocator: |
| 699 | * @ctx: the user data (XML parser context) |
| 700 | * @loc: A SAX Locator |
| 701 | * |
| 702 | * Receive the document locator at startup, actually xmlDefaultSAXLocator |
| 703 | * Everything is available on the context, so this is useless in our case. |
| 704 | * DEPRECATED |
| 705 | */ |
| 706 | void |
| 707 | setDocumentLocator(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) |
| 708 | { |
| 709 | DEPRECATED("setDocumentLocator") |
| 710 | } |
| 711 | |
| 712 | /** |
| 713 | * startDocument: |
| 714 | * @ctx: the user data (XML parser context) |
| 715 | * |
| 716 | * called when the document start being processed. |
| 717 | * DEPRECATED: use xmlSAX2StartDocument() |
| 718 | */ |
| 719 | void |
| 720 | startDocument(void *ctx) |
| 721 | { |
| 722 | DEPRECATED("startDocument") |
| 723 | xmlSAX2StartDocument(ctx); |
| 724 | } |
| 725 | |
| 726 | /** |
| 727 | * endDocument: |
| 728 | * @ctx: the user data (XML parser context) |
| 729 | * |
| 730 | * called when the document end has been detected. |
| 731 | * DEPRECATED: use xmlSAX2EndDocument() |
| 732 | */ |
| 733 | void |
| 734 | endDocument(void *ctx) |
| 735 | { |
| 736 | DEPRECATED("endDocument") |
| 737 | xmlSAX2EndDocument(ctx); |
| 738 | } |
| 739 | |
| 740 | /** |
| 741 | * attribute: |
| 742 | * @ctx: the user data (XML parser context) |
| 743 | * @fullname: The attribute name, including namespace prefix |
| 744 | * @value: The attribute value |
| 745 | * |
| 746 | * Handle an attribute that has been read by the parser. |
| 747 | * The default handling is to convert the attribute into an |
| 748 | * DOM subtree and past it in a new xmlAttr element added to |
| 749 | * the element. |
| 750 | * DEPRECATED: use xmlSAX2Attribute() |
| 751 | */ |
| 752 | void |
| 753 | attribute(void *ctx ATTRIBUTE_UNUSED, const xmlChar *fullname ATTRIBUTE_UNUSED, const xmlChar *value ATTRIBUTE_UNUSED) |
| 754 | { |
| 755 | DEPRECATED("attribute") |
| 756 | } |
| 757 | |
| 758 | /** |
| 759 | * startElement: |
| 760 | * @ctx: the user data (XML parser context) |
| 761 | * @fullname: The element name, including namespace prefix |
| 762 | * @atts: An array of name/value attributes pairs, NULL terminated |
| 763 | * |
| 764 | * called when an opening tag has been processed. |
| 765 | * DEPRECATED: use xmlSAX2StartElement() |
| 766 | */ |
| 767 | void |
| 768 | startElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) |
| 769 | { |
| 770 | DEPRECATED("startElement") |
| 771 | xmlSAX2StartElement(ctx, fullname, atts); |
| 772 | } |
| 773 | |
| 774 | /** |
| 775 | * endElement: |
| 776 | * @ctx: the user data (XML parser context) |
| 777 | * @name: The element name |
| 778 | * |
| 779 | * called when the end of an element has been detected. |
| 780 | * DEPRECATED: use xmlSAX2EndElement() |
| 781 | */ |
| 782 | void |
| 783 | endElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED) |
| 784 | { |
| 785 | DEPRECATED("endElement") |
| 786 | xmlSAX2EndElement(ctx, name); |
| 787 | } |
| 788 | |
| 789 | /** |
| 790 | * reference: |
| 791 | * @ctx: the user data (XML parser context) |
| 792 | * @name: The entity name |
| 793 | * |
| 794 | * called when an entity reference is detected. |
| 795 | * DEPRECATED: use xmlSAX2Reference() |
| 796 | */ |
| 797 | void |
| 798 | reference(void *ctx, const xmlChar *name) |
| 799 | { |
| 800 | DEPRECATED("reference") |
| 801 | xmlSAX2Reference(ctx, name); |
| 802 | } |
| 803 | |
| 804 | /** |
| 805 | * characters: |
| 806 | * @ctx: the user data (XML parser context) |
| 807 | * @ch: a xmlChar string |
| 808 | * @len: the number of xmlChar |
| 809 | * |
| 810 | * receiving some chars from the parser. |
| 811 | * DEPRECATED: use xmlSAX2Characters() |
| 812 | */ |
| 813 | void |
| 814 | characters(void *ctx, const xmlChar *ch, int len) |
| 815 | { |
| 816 | DEPRECATED("characters") |
| 817 | xmlSAX2Characters(ctx, ch, len); |
| 818 | } |
| 819 | |
| 820 | /** |
| 821 | * ignorableWhitespace: |
| 822 | * @ctx: the user data (XML parser context) |
| 823 | * @ch: a xmlChar string |
| 824 | * @len: the number of xmlChar |
| 825 | * |
| 826 | * receiving some ignorable whitespaces from the parser. |
| 827 | * UNUSED: by default the DOM building will use characters |
| 828 | * DEPRECATED: use xmlSAX2IgnorableWhitespace() |
| 829 | */ |
| 830 | void |
| 831 | ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch ATTRIBUTE_UNUSED, int len ATTRIBUTE_UNUSED) |
| 832 | { |
| 833 | DEPRECATED("ignorableWhitespace") |
| 834 | } |
| 835 | |
| 836 | /** |
| 837 | * processingInstruction: |
| 838 | * @ctx: the user data (XML parser context) |
| 839 | * @target: the target name |
| 840 | * @data: the PI data's |
| 841 | * |
| 842 | * A processing instruction has been parsed. |
| 843 | * DEPRECATED: use xmlSAX2ProcessingInstruction() |
| 844 | */ |
| 845 | void |
| 846 | processingInstruction(void *ctx, const xmlChar *target, |
| 847 | const xmlChar *data) |
| 848 | { |
| 849 | DEPRECATED("processingInstruction") |
| 850 | xmlSAX2ProcessingInstruction(ctx, target, data); |
| 851 | } |
| 852 | |
| 853 | /** |
| 854 | * globalNamespace: |
| 855 | * @ctx: the user data (XML parser context) |
| 856 | * @href: the namespace associated URN |
| 857 | * @prefix: the namespace prefix |
| 858 | * |
| 859 | * An old global namespace has been parsed. |
| 860 | * DEPRECATED |
| 861 | */ |
| 862 | void |
| 863 | globalNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) |
| 864 | { |
| 865 | DEPRECATED("globalNamespace") |
| 866 | } |
| 867 | |
| 868 | /** |
| 869 | * setNamespace: |
| 870 | * @ctx: the user data (XML parser context) |
| 871 | * @name: the namespace prefix |
| 872 | * |
| 873 | * Set the current element namespace. |
| 874 | * DEPRECATED |
| 875 | */ |
| 876 | |
| 877 | void |
| 878 | setNamespace(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name ATTRIBUTE_UNUSED) |
| 879 | { |
| 880 | DEPRECATED("setNamespace") |
| 881 | } |
| 882 | |
| 883 | /** |
| 884 | * getNamespace: |
| 885 | * @ctx: the user data (XML parser context) |
| 886 | * |
| 887 | * Get the current element namespace. |
| 888 | * DEPRECATED |
| 889 | * |
| 890 | * Returns the xmlNsPtr or NULL if none |
| 891 | */ |
| 892 | |
| 893 | xmlNsPtr |
| 894 | getNamespace(void *ctx ATTRIBUTE_UNUSED) |
| 895 | { |
| 896 | DEPRECATED("getNamespace") |
| 897 | return(NULL); |
| 898 | } |
| 899 | |
| 900 | /** |
| 901 | * checkNamespace: |
| 902 | * @ctx: the user data (XML parser context) |
| 903 | * @namespace: the namespace to check against |
| 904 | * |
| 905 | * Check that the current element namespace is the same as the |
| 906 | * one read upon parsing. |
| 907 | * DEPRECATED |
| 908 | * |
| 909 | * Returns 1 if true 0 otherwise |
| 910 | */ |
| 911 | |
| 912 | int |
| 913 | checkNamespace(void *ctx ATTRIBUTE_UNUSED, xmlChar *namespace ATTRIBUTE_UNUSED) |
| 914 | { |
| 915 | DEPRECATED("checkNamespace") |
| 916 | return(0); |
| 917 | } |
| 918 | |
| 919 | /** |
| 920 | * namespaceDecl: |
| 921 | * @ctx: the user data (XML parser context) |
| 922 | * @href: the namespace associated URN |
| 923 | * @prefix: the namespace prefix |
| 924 | * |
| 925 | * A namespace has been parsed. |
| 926 | * DEPRECATED |
| 927 | */ |
| 928 | void |
| 929 | namespaceDecl(void *ctx ATTRIBUTE_UNUSED, const xmlChar *href ATTRIBUTE_UNUSED, const xmlChar *prefix ATTRIBUTE_UNUSED) |
| 930 | { |
| 931 | DEPRECATED("namespaceDecl") |
| 932 | } |
| 933 | |
| 934 | /** |
| 935 | * comment: |
| 936 | * @ctx: the user data (XML parser context) |
| 937 | * @value: the comment content |
| 938 | * |
| 939 | * A comment has been parsed. |
| 940 | * DEPRECATED: use xmlSAX2Comment() |
| 941 | */ |
| 942 | void |
| 943 | comment(void *ctx, const xmlChar *value) |
| 944 | { |
| 945 | DEPRECATED("comment") |
| 946 | xmlSAX2Comment(ctx, value); |
| 947 | } |
| 948 | |
| 949 | /** |
| 950 | * cdataBlock: |
| 951 | * @ctx: the user data (XML parser context) |
| 952 | * @value: The pcdata content |
| 953 | * @len: the block length |
| 954 | * |
| 955 | * called when a pcdata block has been parsed |
| 956 | * DEPRECATED: use xmlSAX2CDataBlock() |
| 957 | */ |
| 958 | void |
| 959 | cdataBlock(void *ctx, const xmlChar *value, int len) |
| 960 | { |
| 961 | DEPRECATED("cdataBlock") |
| 962 | xmlSAX2CDataBlock(ctx, value, len); |
| 963 | } |
| 964 | |
| 965 | #endif /* LIBXML_LEGACY_ENABLED */ |
| 966 | |