1 * Summary: the XMLReader implementation 2 * Description: API of the XML streaming API based on C# interfaces. 3 * 4 * Copy: See Copyright for the status of this software. 5 * 6 * Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A. 7 8 /if not defined(XML_XMLREADER_H__) 9 /define XML_XMLREADER_H__ 10 11 /include "libxmlrpg/xmlversion" 12 /include "libxmlrpg/xmlTypesC" 13 /include "libxmlrpg/tree" 14 /include "libxmlrpg/xmlIO" 15 16 /if defined(LIBXML_SCHEMAS_ENABLED) 17 /include "libxmlrpg/relaxng" 18 /include "libxmlrpg/xmlschemas" 19 /endif 20 21 * xmlParserSeverities: 22 * 23 * How severe an error callback is when the per-reader error callback API 24 * is used. 25 26 d xmlParserSeverities... 27 d s 10i 0 based(######typedef######) enum 28 d XML_PARSER_SEVERITY_VALIDITY_WARNING... 29 d c 1 30 d XML_PARSER_SEVERITY_VALIDITY_ERROR... 31 d c 2 32 d XML_PARSER_SEVERITY_WARNING... 33 d c 3 34 d XML_PARSER_SEVERITY_ERROR... 35 d c 4 36 37 /if defined(LIBXML_READER_ENABLED) 38 39 * xmlTextReaderMode: 40 * 41 * Internal state values for the reader. 42 43 d xmlTextReaderMode... 44 d s 10i 0 based(######typedef######) enum 45 d XML_TEXTREADER_MODE_INITIAL... 46 d c 0 47 d XML_TEXTREADER_MODE_INTERACTIVE... 48 d c 1 49 d XML_TEXTREADER_MODE_ERROR... 50 d c 2 51 d XML_TEXTREADER_MODE_EOF... 52 d c 3 53 d XML_TEXTREADER_MODE_CLOSED... 54 d c 4 55 d XML_TEXTREADER_MODE_READING... 56 d c 5 57 58 * xmlParserProperties: 59 * 60 * Some common options to use with xmlTextReaderSetParserProp, but it 61 * is better to use xmlParserOption and the xmlReaderNewxxx and 62 * xmlReaderForxxx APIs now. 63 64 d xmlParserProperties... 65 d s 10i 0 based(######typedef######) enum 66 d XML_PARSER_LOADDTD... 67 d c 1 68 d XML_PARSER_DEFAULTATTRS... 69 d c 2 70 d XML_PARSER_VALIDATE... 71 d c 3 72 d XML_PARSER_SUBST_ENTITIES... 73 d c 4 74 75 * xmlReaderTypes: 76 * 77 * Predefined constants for the different types of nodes. 78 79 d xmlReaderTypes s 10i 0 based(######typedef######) enum 80 d XML_READER_TYPE_NONE... 81 d c 0 82 d XML_READER_TYPE_ELEMENT... 83 d c 1 84 d XML_READER_TYPE_ATTRIBUTE... 85 d c 2 86 d XML_READER_TYPE_TEXT... 87 d c 3 88 d XML_READER_TYPE_CDATA... 89 d c 4 90 d XML_READER_TYPE_ENTITY_REFERENCE... 91 d c 5 92 d XML_READER_TYPE_ENTITY... 93 d c 6 94 d XML_READER_TYPE_PROCESSING_INSTRUCTION... 95 d c 7 96 d XML_READER_TYPE_COMMENT... 97 d c 8 98 d XML_READER_TYPE_DOCUMENT... 99 d c 9 100 d XML_READER_TYPE_DOCUMENT_TYPE... 101 d c 10 102 d XML_READER_TYPE_DOCUMENT_FRAGMENT... 103 d c 11 104 d XML_READER_TYPE_NOTATION... 105 d c 12 106 d XML_READER_TYPE_WHITESPACE... 107 d c 13 108 d XML_READER_TYPE_SIGNIFICANT_WHITESPACE... 109 d c 14 110 d XML_READER_TYPE_END_ELEMENT... 111 d c 15 112 d XML_READER_TYPE_END_ENTITY... 113 d c 16 114 d XML_READER_TYPE_XML_DECLARATION... 115 d c 17 116 117 * xmlTextReaderPtr: 118 * 119 * Pointer to an xmlReader context. 120 121 d xmlTextReaderPtr... 122 d s * based(######typedef######) 123 124 * Constructors & Destructor 125 126 d xmlNewTextReader... 127 d pr extproc('xmlNewTextReader') 128 d like(xmlTextReaderPtr) 129 d input value like(xmlParserInputBufferPtr) 130 d URI * value options(*string) const char * 131 132 d xmlNewTextReaderFilename... 133 d pr extproc('xmlNewTextReaderFilename') 134 d like(xmlTextReaderPtr) 135 d URI * value options(*string) const char * 136 137 d xmlFreeTextReader... 138 d pr extproc('xmlFreeTextReader') 139 d reader value like(xmlTextReaderPtr) 140 141 d xmlTextReaderSetup... 142 d pr 10i 0 extproc('xmlTextReaderSetup') 143 d reader value like(xmlTextReaderPtr) 144 d input value like(xmlParserInputBufferPtr) 145 d URL * value options(*string) const char * 146 d encoding * value options(*string) const char * 147 d options 10i 0 value 148 149 * Iterators 150 151 d xmlTextReaderRead... 152 d pr 10i 0 extproc('xmlTextReaderRead') 153 d reader value like(xmlTextReaderPtr) 154 155 /if defined(LIBXML_WRITER_ENABLED) 156 d xmlTextReaderReadInnerXml... 157 d pr * extproc('xmlTextReaderReadInnerXml') xmlChar * 158 d reader value like(xmlTextReaderPtr) 159 160 d xmlTextReaderReadOuterXml... 161 d pr * extproc('xmlTextReaderReadOuterXml') xmlChar * 162 d reader value like(xmlTextReaderPtr) 163 /endif 164 165 d xmlTextReaderReadString... 166 d pr * extproc('xmlTextReaderReadString') xmlChar * 167 d reader value like(xmlTextReaderPtr) 168 169 d xmlTextReaderReadAttributeValue... 170 d pr 10i 0 extproc( 171 d 'xmlTextReaderReadAttributeValue') 172 d reader value like(xmlTextReaderPtr) 173 174 * Attributes of the node 175 176 d xmlTextReaderAttributeCount... 177 d pr 10i 0 extproc( 178 d 'xmlTextReaderAttributeCount') 179 d reader value like(xmlTextReaderPtr) 180 181 d xmlTextReaderDepth... 182 d pr 10i 0 extproc('xmlTextReaderDepth') 183 d reader value like(xmlTextReaderPtr) 184 185 d xmlTextReaderHasAttributes... 186 d pr 10i 0 extproc('xmlTextReaderHasAttributes') 187 d reader value like(xmlTextReaderPtr) 188 189 d xmlTextReaderHasValue... 190 d pr 10i 0 extproc('xmlTextReaderHasValue') 191 d reader value like(xmlTextReaderPtr) 192 193 d xmlTextReaderIsDefault... 194 d pr 10i 0 extproc('xmlTextReaderIsDefault') 195 d reader value like(xmlTextReaderPtr) 196 197 d xmlTextReaderIsEmptyElement... 198 d pr 10i 0 extproc( 199 d 'xmlTextReaderIsEmptyElement') 200 d reader value like(xmlTextReaderPtr) 201 202 d xmlTextReaderNodeType... 203 d pr 10i 0 extproc('xmlTextReaderNodeType') 204 d reader value like(xmlTextReaderPtr) 205 206 d xmlTextReaderQuoteChar... 207 d pr 10i 0 extproc('xmlTextReaderQuoteChar') 208 d reader value like(xmlTextReaderPtr) 209 210 d xmlTextReaderReadState... 211 d pr 10i 0 extproc('xmlTextReaderReadState') 212 d reader value like(xmlTextReaderPtr) 213 214 d xmlTextReaderIsNamespaceDecl... 215 d pr 10i 0 extproc( 216 d 'xmlTextReaderIsNamespaceDecl') 217 d reader value like(xmlTextReaderPtr) 218 219 d xmlTextReaderConstBaseUri... 220 d pr * extproc('xmlTextReaderConstBaseUri') const xmlChar * 221 d reader value like(xmlTextReaderPtr) 222 223 d xmlTextReaderConstLocalName... 224 d pr * extproc( const xmlChar * 225 d 'xmlTextReaderConstLocalName') 226 d reader value like(xmlTextReaderPtr) 227 228 d xmlTextReaderConstName... 229 d pr * extproc('xmlTextReaderConstName') const xmlChar * 230 d reader value like(xmlTextReaderPtr) 231 232 d xmlTextReaderConstNamespaceUri... 233 d pr * extproc( const xmlChar * 234 d 'xmlTextReaderConstNamespaceUri') 235 d reader value like(xmlTextReaderPtr) 236 237 d xmlTextReaderConstPrefix... 238 d pr * extproc('xmlTextReaderConstPrefix') const xmlChar * 239 d reader value like(xmlTextReaderPtr) 240 241 d xmlTextReaderConstXmlLang... 242 d pr * extproc('xmlTextReaderConstXmlLang') const xmlChar * 243 d reader value like(xmlTextReaderPtr) 244 245 d xmlTextReaderConstString... 246 d pr * extproc('xmlTextReaderConstString') const xmlChar * 247 d reader value like(xmlTextReaderPtr) 248 d str * value options(*string) const xmlChar * 249 250 d xmlTextReaderConstValue... 251 d pr * extproc('xmlTextReaderConstValue') const xmlChar * 252 d reader value like(xmlTextReaderPtr) 253 254 * use the Const version of the routine for 255 * better performance and simpler code 256 257 d xmlTextReaderBaseUri... 258 d pr * extproc('xmlTextReaderBaseUri') xmlChar * 259 d reader value like(xmlTextReaderPtr) 260 261 d xmlTextReaderLocalName... 262 d pr * extproc('xmlTextReaderLocalName') xmlChar * 263 d reader value like(xmlTextReaderPtr) 264 265 d xmlTextReaderName... 266 d pr * extproc('xmlTextReaderName') xmlChar * 267 d reader value like(xmlTextReaderPtr) 268 269 d xmlTextReaderNamespaceUri... 270 d pr * extproc('xmlTextReaderNamespaceUri') xmlChar * 271 d reader value like(xmlTextReaderPtr) 272 273 d xmlTextReaderPrefix... 274 d pr * extproc('xmlTextReaderPrefix') xmlChar * 275 d reader value like(xmlTextReaderPtr) 276 277 d xmlTextReaderXmlLang... 278 d pr * extproc('xmlTextReaderXmlLang') xmlChar * 279 d reader value like(xmlTextReaderPtr) 280 281 d xmlTextReaderValue... 282 d pr * extproc('xmlTextReaderValue') xmlChar * 283 d reader value like(xmlTextReaderPtr) 284 285 * Methods of the XmlTextReader 286 287 d xmlTextReaderClose... 288 d pr 10i 0 extproc('xmlTextReaderClose') 289 d reader value like(xmlTextReaderPtr) 290 291 d xmlTextReaderGetAttributeNo... 292 d pr * extproc( xmlChar * 293 d 'xmlTextReaderGetAttributeNo') 294 d reader value like(xmlTextReaderPtr) 295 d no 10i 0 value 296 297 d xmlTextReaderGetAttribute... 298 d pr * extproc('xmlTextReaderGetAttribute') xmlChar * 299 d reader value like(xmlTextReaderPtr) 300 d name * value options(*string) const xmlChar * 301 302 d xmlTextReaderGetAttributeNs... 303 d pr * extproc( xmlChar * 304 d 'xmlTextReaderGetAttributeNs') 305 d reader value like(xmlTextReaderPtr) 306 d localName * value options(*string) const xmlChar * 307 d namespaceURI * value options(*string) const xmlChar * 308 309 d xmlTextReaderGetRemainder... 310 d pr extproc('xmlTextReaderGetRemainder') 311 d like(xmlParserInputBufferPtr) 312 d reader value like(xmlTextReaderPtr) 313 314 d xmlTextReaderLookupNamespace... 315 d pr * extproc( xmlChar * 316 d 'xmlTextReaderLookupNamespace') 317 d reader value like(xmlTextReaderPtr) 318 d prefix * value options(*string) const xmlChar * 319 320 d xmlTextReaderMoveToAttributeNo... 321 d pr 10i 0 extproc( 322 d 'xmlTextReaderMoveToAttributeNo') 323 d reader value like(xmlTextReaderPtr) 324 d no 10i 0 value 325 326 d xmlTextReaderMoveToAttribute... 327 d pr 10i 0 extproc( 328 d 'xmlTextReaderMoveToAttribute') 329 d reader value like(xmlTextReaderPtr) 330 d name * value options(*string) const xmlChar * 331 332 d xmlTextReaderMoveToAttributeNs... 333 d pr 10i 0 extproc( 334 d 'xmlTextReaderMoveToAttributeNs') 335 d reader value like(xmlTextReaderPtr) 336 d localName * value options(*string) const xmlChar * 337 d namespaceURI * value options(*string) const xmlChar * 338 339 d xmlTextReaderMoveToFirstAttribute... 340 d pr 10i 0 extproc( 341 d 'xmlTextReaderMoveToFirstAttribute') 342 d reader value like(xmlTextReaderPtr) 343 344 d xmlTextReaderMoveToNextAttribute... 345 d pr 10i 0 extproc( 346 d 'xmlTextReaderMoveToNextAttribute') 347 d reader value like(xmlTextReaderPtr) 348 349 d xmlTextReaderMoveToElement... 350 d pr 10i 0 extproc('xmlTextReaderMoveToElement') 351 d reader value like(xmlTextReaderPtr) 352 353 d xmlTextReaderNormalization... 354 d pr 10i 0 extproc('xmlTextReaderNormalization') 355 d reader value like(xmlTextReaderPtr) 356 357 d xmlTextReaderConstEncoding... 358 d pr * extproc('xmlTextReaderConstEncoding')const xmlChar * 359 d reader value like(xmlTextReaderPtr) 360 361 * Extensions 362 363 d xmlTextReaderSetParserProp... 364 d pr 10i 0 extproc('xmlTextReaderSetParserProp') 365 d reader value like(xmlTextReaderPtr) 366 d prop 10i 0 value 367 d value 10i 0 value 368 369 d xmlTextReaderGetParserProp... 370 d pr 10i 0 extproc('xmlTextReaderGetParserProp') 371 d reader value like(xmlTextReaderPtr) 372 d prop 10i 0 value 373 374 d xmlTextReaderCurrentNode... 375 d pr extproc('xmlTextReaderCurrentNode') 376 d like(xmlNodePtr) 377 d reader value like(xmlTextReaderPtr) 378 379 d xmlTextReaderGetParserLineNumber... 380 d pr 10i 0 extproc( 381 d 'xmlTextReaderGetParserLineNumber') 382 d reader value like(xmlTextReaderPtr) 383 384 d xmlTextReaderGetParserColumnNumber... 385 d pr 10i 0 extproc( 386 d 'xmlTextReaderGetParserColumnNumber') 387 d reader value like(xmlTextReaderPtr) 388 389 d xmlTextReaderPreserve... 390 d pr extproc('xmlTextReaderPreserve') 391 d like(xmlNodePtr) 392 d reader value like(xmlTextReaderPtr) 393 394 /if defined(LIBXML_PATTERN_ENABLED) 395 d xmlTextReaderPreservePattern... 396 d pr 10i 0 extproc( 397 d 'xmlTextReaderPreservePattern') 398 d reader value like(xmlTextReaderPtr) 399 d pattern * value options(*string) const xmlChar * 400 d namespaces * const xmlChar *(*) 401 /endif LIBXML_PATTERN_ENBLD 402 403 d xmlTextReaderCurrentDoc... 404 d pr extproc('xmlTextReaderCurrentDoc') 405 d like(xmlDocPtr) 406 d reader value like(xmlTextReaderPtr) 407 408 d xmlTextReaderExpand... 409 d pr extproc('xmlTextReaderExpand') 410 d like(xmlNodePtr) 411 d reader value like(xmlTextReaderPtr) 412 413 d xmlTextReaderNext... 414 d pr 10i 0 extproc('xmlTextReaderNext') 415 d reader value like(xmlTextReaderPtr) 416 417 d xmlTextReaderNextSibling... 418 d pr 10i 0 extproc('xmlTextReaderNextSibling') 419 d reader value like(xmlTextReaderPtr) 420 421 d xmlTextReaderIsValid... 422 d pr 10i 0 extproc('xmlTextReaderIsValid') 423 d reader value like(xmlTextReaderPtr) 424 425 /if defined(LIBXML_SCHEMAS_ENABLED) 426 d xmlTextReaderRelaxNGValidate... 427 d pr 10i 0 extproc( 428 d 'xmlTextReaderRelaxNGValidate') 429 d reader value like(xmlTextReaderPtr) 430 d rng * value options(*string) const char * 431 432 d xmlTextReaderRelaxNGValidateCtxt... 433 d pr 10i 0 extproc( 434 d 'xmlTextReaderRelaxNGValidateCtxt') 435 d reader value like(xmlTextReaderPtr) 436 d ctxt value like(xmlRelaxNGValidCtxtPtr) 437 d options 10i 0 value 438 439 d xmlTextReaderRelaxNGSetSchema... 440 d pr 10i 0 extproc( 441 d 'xmlTextReaderRelaxNGSetSchema') 442 d reader value like(xmlTextReaderPtr) 443 d schema value like(xmlRelaxNGPtr) 444 445 d xmlTextReaderSchemaValidate... 446 d pr 10i 0 extproc( 447 d 'xmlTextReaderSchemaValidate') 448 d reader value like(xmlTextReaderPtr) 449 d xsd * value options(*string) const char * 450 451 d xmlTextReaderSchemaValidateCtxt... 452 d pr 10i 0 extproc( 453 d 'xmlTextReaderSchemaValidateCtxt') 454 d reader value like(xmlTextReaderPtr) 455 d ctxt value like(xmlSchemaValidCtxtPtr) 456 d options 10i 0 value 457 458 d xmlTextReaderSetSchema... 459 d pr 10i 0 extproc('xmlTextReaderSetSchema') 460 d reader value like(xmlTextReaderPtr) 461 d schema value like(xmlSchemaPtr) 462 /endif 463 464 d xmlTextReaderConstXmlVersion... 465 d pr * extproc( const xmlChar * 466 d 'xmlTextReaderConstXmlVersion') 467 d reader value like(xmlTextReaderPtr) 468 469 d xmlTextReaderStandalone... 470 d pr 10i 0 extproc('xmlTextReaderStandalone') 471 d reader value like(xmlTextReaderPtr) 472 473 * Index lookup 474 475 d xmlTextReaderByteConsumed... 476 d pr extproc('xmlTextReaderByteConsumed') 477 d like(xmlClong) 478 d reader value like(xmlTextReaderPtr) 479 480 * New more complete APIs for simpler creation and reuse of readers 481 482 d xmlReaderWalker... 483 d pr extproc('xmlReaderWalker') 484 d like(xmlTextReaderPtr) 485 d doc value like(xmlDocPtr) 486 487 d xmlReaderForDoc... 488 d pr extproc('xmlReaderForDoc') 489 d like(xmlTextReaderPtr) 490 d cur * value options(*string) const xmlChar * 491 d URL * value options(*string) const char * 492 d encoding * value options(*string) const char * 493 d options 10i 0 value 494 495 d xmlReaderForFile... 496 d pr extproc('xmlReaderForFile') 497 d like(xmlTextReaderPtr) 498 d filename * value options(*string) const char * 499 d encoding * value options(*string) const char * 500 d options 10i 0 value 501 502 d xmlReaderForMemory... 503 d pr extproc('xmlReaderForMemory') 504 d like(xmlTextReaderPtr) 505 d buffer * value options(*string) const char * 506 d size 10i 0 value 507 d URL * value options(*string) const char * 508 d encoding * value options(*string) const char * 509 d options 10i 0 value 510 511 d xmlReaderForFd pr extproc('xmlReaderForFd') 512 d like(xmlTextReaderPtr) 513 d fd 10i 0 value 514 d URL * value options(*string) const char * 515 d encoding * value options(*string) const char * 516 d options 10i 0 value 517 518 d xmlReaderForIO pr extproc('xmlReaderForIO') 519 d like(xmlTextReaderPtr) 520 d ioread value like(xmlInputReadCallback) 521 d ioclose value like(xmlInputCloseCallback) 522 d ioctx * value void * 523 d URL * value options(*string) const char * 524 d encoding * value options(*string) const char * 525 d options 10i 0 value 526 527 d xmlReaderNewWalker... 528 d pr 10i 0 extproc('xmlReaderNewWalker') 529 d reader value like(xmlTextReaderPtr) 530 d doc value like(xmlDocPtr) 531 532 d xmlReaderNewDoc... 533 d pr 10i 0 extproc('xmlReaderNewDoc') 534 d reader value like(xmlTextReaderPtr) 535 d cur * value options(*string) const xmlChar * 536 d URL * value options(*string) const char * 537 d encoding * value options(*string) const char * 538 d options 10i 0 value 539 540 d xmlReaderNewFile... 541 d pr 10i 0 extproc('xmlReaderNewFile') 542 d reader value like(xmlTextReaderPtr) 543 d filename * value options(*string) const char * 544 d encoding * value options(*string) const char * 545 d options 10i 0 value 546 547 d xmlReaderNewMemory... 548 d pr 10i 0 extproc('xmlReaderNewMemory') 549 d reader value like(xmlTextReaderPtr) 550 d buffer * value options(*string) const char * 551 d size 10i 0 value 552 d URL * value options(*string) const char * 553 d encoding * value options(*string) const char * 554 d options 10i 0 value 555 556 d xmlReaderNewFd pr 10i 0 extproc('xmlReaderNewFd') 557 d reader value like(xmlTextReaderPtr) 558 d fd 10i 0 value 559 d URL * value options(*string) const char * 560 d encoding * value options(*string) const char * 561 d options 10i 0 value 562 563 d xmlReaderNewIO pr 10i 0 extproc('xmlReaderNewIO') 564 d reader value like(xmlTextReaderPtr) 565 d ioread value like(xmlInputReadCallback) 566 d ioclose value like(xmlInputCloseCallback) 567 d ioctx * value void * 568 d URL * value options(*string) const char * 569 d encoding * value options(*string) const char * 570 d options 10i 0 value 571 572 * Error handling extensions 573 574 d xmlTextReaderLocatorPtr... 575 d s * based(######typedef######) void * 576 577 * xmlTextReaderErrorFunc: 578 * @arg: the user argument 579 * @msg: the message 580 * @severity: the severity of the error 581 * @locator: a locator indicating where the error occured 582 * 583 * Signature of an error callback from a reader parser 584 585 d xmlTextReaderErrorFunc... 586 d s * based(######typedef######) 587 d procptr 588 589 d xmlTextReaderLocatorLineNumber... 590 d pr 10i 0 extproc( 591 d 'xmlTextReaderLocatorLineNumber') 592 d locator value like(xmlTextReaderLocatorPtr) 593 594 d xmlTextReaderLocatorBaseURI... 595 d pr * extproc( xmlChar * 596 d 'xmlTextReaderLocatorBaseURI') 597 d locator value like(xmlTextReaderLocatorPtr) 598 599 d xmlTextReaderSetErrorHandler... 600 d pr extproc( 601 d 'xmlTextReaderSetErrorHandler') 602 d reader value like(xmlTextReaderPtr) 603 d f value like(xmlTextReaderErrorFunc) 604 d arg * value void * 605 606 d xmlTextReaderSetStructuredErrorHandler... 607 d pr extproc('xmlTextReaderSetStructuredE- 608 d rrorHandler') 609 d reader value like(xmlTextReaderPtr) 610 d f value like(xmlStructuredErrorFunc) 611 d arg * value void * 612 613 d xmlTextReaderGetErrorHandler... 614 d pr extproc( 615 d 'xmlTextReaderGetErrorHandler') 616 d reader value like(xmlTextReaderPtr) 617 d f like(xmlTextReaderErrorFunc) 618 d arg * void *(*) 619 620 /endif LIBXML_READER_ENABLD 621 /endif XML_XMLREADER_H__ 622