libxmlparser.inc 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  1. (*
  2. * Summary: the core parser module
  3. * Description: Interfaces, constants and types related to the XML parser
  4. *
  5. * Copy: See Copyright for the status of this software.
  6. *
  7. * Author: Daniel Veillard
  8. *)
  9. {$IFDEF POINTER}
  10. xmlParserInputPtr = ^xmlParserInput;
  11. xmlParserInputPtrPtr = ^xmlParserInputPtr;
  12. xmlParserNodeInfoPtr = ^xmlParserNodeInfo;
  13. xmlParserNodeInfoSeqPtr = ^xmlParserNodeInfoSeq;
  14. xmlParserCtxtPtr = ^xmlParserCtxt;
  15. xmlSAXLocatorPtr = ^xmlSAXLocator;
  16. xmlSAXHandlerPtr = ^xmlSAXHandler;
  17. xmlSAXHandlerV1Ptr = ^xmlSAXHandlerV1;
  18. {$ENDIF}
  19. {$IFDEF CONST}
  20. (**
  21. * XML_DEFAULT_VERSION:
  22. *
  23. * The default version of XML used: 1.0
  24. *)
  25. XML_DEFAULT_VERSION = '1.0';
  26. {$ENDIF}
  27. {$IFDEF TYPE}
  28. (**
  29. * xmlParserInput:
  30. *
  31. * An xmlParserInput is an input flow for the XML processor.
  32. * Each entity parsed is associated an xmlParserInput (except the
  33. * few predefined ones). This is the case both for internal entities
  34. * - in which case the flow is already completely in memory - or
  35. * external entities - in which case we use the buf structure for
  36. * progressive reading and I18N conversions to the internal UTF-8 format.
  37. *)
  38. (**
  39. * xmlParserInputDeallocate:
  40. * @str: the string to deallocate
  41. *
  42. * Callback for freeing some parser input allocations.
  43. *)
  44. xmlParserInputDeallocate = procedure(str: xmlCharPtr); EXTDECL;
  45. xmlParserInput = record
  46. (* Input buffer *)
  47. buf : xmlParserInputBufferPtr; (* UTF-8 encoded buffer *)
  48. filename : pchar; (* The file analyzed, if any *)
  49. directory : pchar; (* the directory/base of the file *)
  50. base : xmlCharPtr; (* Base of the array to parse *)
  51. cur : xmlCharPtr; (* Current char being parsed *)
  52. _end : xmlCharPtr; (* end of the array to parse *)
  53. length : cint; (* length if known *)
  54. line : cint; (* Current line *)
  55. col : cint; (* Current column *)
  56. (*
  57. * NOTE: consumed is only tested for equality in the parser code,
  58. * so even if there is an overflow this should not give troubles
  59. * for parsing very large instances.
  60. *)
  61. consumed : culong; (* How many xmlChars already consumed *)
  62. free : xmlParserInputDeallocate; (* function to deallocate the base *)
  63. encoding : xmlCharPtr; (* the encoding string for entity *)
  64. version : xmlCharPtr; (* the version string for entity *)
  65. standalone : cint; (* Was that entity marked standalone *)
  66. id : cint; (* an unique identifier for the entity *)
  67. end;
  68. (**
  69. * xmlParserNodeInfo:
  70. *
  71. * The parser can be asked to collect Node informations, i.e. at what
  72. * place in the file they were detected.
  73. * NOTE: This is off by default and not very well tested.
  74. *)
  75. xmlParserNodeInfo = record
  76. node : xmlNodePtr;
  77. (* Position & line # that text that created the node begins & ends on *)
  78. begin_pos : culong;
  79. begin_line : culong;
  80. end_pos : culong;
  81. end_line : culong;
  82. end;
  83. xmlParserNodeInfoSeq = record
  84. maximum : culong;
  85. length : culong;
  86. buffer : xmlParserNodeInfoPtr;
  87. end;
  88. (**
  89. * xmlParserInputState:
  90. *
  91. * The parser is now working also as a state based parser.
  92. * The recursive one use the state info for entities processing.
  93. *)
  94. xmlParserInputState = (
  95. XML_PARSER_EOF = -1, (* nothing is to be parsed *)
  96. XML_PARSER_START = 0, (* nothing has been parsed *)
  97. XML_PARSER_MISC, (* Misc* before int subset *)
  98. XML_PARSER_PI, (* Within a processing instruction *)
  99. XML_PARSER_DTD, (* within some DTD content *)
  100. XML_PARSER_PROLOG, (* Misc* after internal subset *)
  101. XML_PARSER_COMMENT, (* within a comment *)
  102. XML_PARSER_START_TAG, (* within a start tag *)
  103. XML_PARSER_CONTENT, (* within the content *)
  104. XML_PARSER_CDATA_SECTION, (* within a CDATA section *)
  105. XML_PARSER_END_TAG, (* within a closing tag *)
  106. XML_PARSER_ENTITY_DECL, (* within an entity declaration *)
  107. XML_PARSER_ENTITY_VALUE, (* within an entity value in a decl *)
  108. XML_PARSER_ATTRIBUTE_VALUE, (* within an attribute value *)
  109. XML_PARSER_SYSTEM_LITERAL, (* within a SYSTEM value *)
  110. XML_PARSER_EPILOG, (* the Misc* after the last end tag *)
  111. XML_PARSER_IGNORE, (* within an IGNORED section *)
  112. XML_PARSER_PUBLIC_LITERAL (* within a PUBLIC value *)
  113. );
  114. {$ENDIF}
  115. {$IFDEF CONST}
  116. (**
  117. * XML_DETECT_IDS:
  118. *
  119. * Bit in the loadsubset context field to tell to do ID/REFs lookups.
  120. * Use it to initialize xmlLoadExtDtdDefaultValue.
  121. *)
  122. XML_DETECT_IDS = 2;
  123. (**
  124. * XML_COMPLETE_ATTRS:
  125. *
  126. * Bit in the loadsubset context field to tell to do complete the
  127. * elements attributes lists with the ones defaulted from the DTDs.
  128. * Use it to initialize xmlLoadExtDtdDefaultValue.
  129. *)
  130. XML_COMPLETE_ATTRS = 4;
  131. (**
  132. * XML_SKIP_IDS:
  133. *
  134. * Bit in the loadsubset context field to tell to not do ID/REFs registration.
  135. * Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
  136. *)
  137. XML_SKIP_IDS = 8;
  138. {$ENDIF}
  139. {$IFDEF TYPE}
  140. (**
  141. * xmlParserMode:
  142. *
  143. * A parser can operate in various modes
  144. *)
  145. xmlParserMode = (
  146. XML_PARSE_UNKNOWN = 0,
  147. XML_PARSE_DOM = 1,
  148. XML_PARSE_SAX = 2,
  149. XML_PARSE_PUSH_DOM = 3,
  150. XML_PARSE_PUSH_SAX = 4,
  151. XML_PARSE_READER = 5
  152. );
  153. (**
  154. * xmlParserCtxt:
  155. *
  156. * The parser context.
  157. * NOTE This doesn't completely define the parser state, the (current ?)
  158. * design of the parser uses recursive function calls since this allow
  159. * and easy mapping from the production rules of the specification
  160. * to the actual code. The drawback is that the actual function call
  161. * also reflect the parser state. However most of the parsing routines
  162. * takes as the only argument the parser context pointer, so migrating
  163. * to a state based parser for progressive parsing shouldn't be too hard.
  164. *)
  165. xmlParserCtxt = record
  166. sax : xmlSAXHandlerPtr; (* The SAX handler *)
  167. userData : pointer; (* For SAX interface only, used by DOM build *)
  168. myDoc : xmlDocPtr; (* the document being built *)
  169. wellFormed : cint; (* is the document well formed *)
  170. replaceEntities : cint; (* shall we replace entities ? *)
  171. version : xmlCharPtr; (* the XML version string *)
  172. encoding : xmlCharPtr; (* the declared encoding, if any *)
  173. standalone : cint; (* standalone document *)
  174. html : cint; (* an HTML(1)/Docbook(2) document *)
  175. (* Input stream stack *)
  176. input : xmlParserInputPtr; (* Current input stream *)
  177. inputNr : cint; (* Number of current input streams *)
  178. inputMax : cint; (* Max number of input streams *)
  179. inputTab : xmlParserInputPtrPtr; (* stack of inputs *)
  180. (* Node analysis stack only used for DOM building *)
  181. node : xmlNodePtr; (* Current parsed Node *)
  182. nodeNr : cint; (* Depth of the parsing stack *)
  183. nodeMax : cint; (* Max depth of the parsing stack *)
  184. nodeTab : xmlNodePtrPtr; (* array of nodes *)
  185. record_info : cint; (* Whether node info should be kept *)
  186. node_seq : xmlParserNodeInfoSeq; (* info about each node parsed *)
  187. errNo : cint; (* error code *)
  188. hasExternalSubset : cint; (* reference and external subset *)
  189. hasPErefs : cint; (* the internal subset has PE refs *)
  190. external : cint; (* are we parsing an external entity *)
  191. valid : cint; (* is the document valid *)
  192. validate : cint; (* shall we try to validate ? *)
  193. vctxt : xmlValidCtxt; (* The validity context *)
  194. instate : xmlParserInputState; (* current type of input *)
  195. token : cint; (* next char look-ahead *)
  196. directory : pchar; (* the data directory *)
  197. (* Node name stack *)
  198. name : xmlCharPtr; (* Current parsed Node *)
  199. nameNr : cint; (* Depth of the parsing stack *)
  200. nameMax : cint; (* Max depth of the parsing stack *)
  201. nameTab : xmlCharPtrPtr; (* array of nodes *)
  202. nbChars : culong; (* number of xmlChar processed *)
  203. checkIndex : culong; (* used by progressive parsing lookup *)
  204. keepBlanks : cint; (* ugly but ... *)
  205. disableSAX : cint; (* SAX callbacks are disabled *)
  206. inSubset : cint; (* Parsing is in int 1/ext 2 subset *)
  207. intSubName : xmlCharPtr; (* name of subset *)
  208. extSubURI : xmlCharPtr; (* URI of external subset *)
  209. extSubSystem : xmlCharPtr; (* SYSTEM ID of external subset *)
  210. (* xml:space values *)
  211. space : pcint; (* Should the parser preserve spaces *)
  212. spaceNr : cint; (* Depth of the parsing stack *)
  213. spaceMax : cint; (* Max depth of the parsing stack *)
  214. spaceTab : pcint; (* array of space infos *)
  215. depth : cint; (* to prevent entity substitution loops *)
  216. entity : xmlParserInputPtr; (* used to check entities boundaries *)
  217. charset : cint; (* encoding of the in-memory content
  218. actually an xmlCharEncoding *)
  219. nodelen : cint; (* Those two fields are there to *)
  220. nodemem : cint; (* Speed up large node parsing *)
  221. pedantic : cint; (* signal pedantic warnings *)
  222. _private : pointer; (* For user data, libxml won't touch it *)
  223. loadsubset : cint; (* should the external subset be loaded *)
  224. linenumbers : cint; (* set line number in element content *)
  225. catalogs : pointer; (* document's own catalog *)
  226. recovery : cint; (* run in recovery mode *)
  227. progressive : cint; (* is this a progressive parsing *)
  228. dict : xmlDictPtr; (* dictionnary for the parser *)
  229. atts : xmlCharPtrPtr; (* array for the attributes callbacks *)
  230. maxatts : cint; (* the size of the array *)
  231. docdict : cint; (* use strings from dict to build tree *)
  232. (*
  233. * pre-interned strings
  234. *)
  235. str_xml : xmlCharPtr;
  236. str_xmlns : xmlCharPtr;
  237. str_xml_ns : xmlCharPtr;
  238. (*
  239. * Everything below is used only by the new SAX mode
  240. *)
  241. sax2 : cint; (* operating in the new SAX mode *)
  242. nsNr : cint; (* the number of inherited namespaces *)
  243. nsMax : cint; (* the size of the arrays *)
  244. nsTab : xmlCharPtrPtr; (* the array of prefix/namespace name *)
  245. attallocs : pcint; (* which attribute were allocated *)
  246. pushTab : ppointer; (* array of data for push *)
  247. attsDefault : xmlHashTablePtr; (* defaulted attributes if any *)
  248. attsSpecial : xmlHashTablePtr; (* non-CDATA attributes if any *)
  249. nsWellFormed : cint; (* is the document XML Nanespace okay *)
  250. options : cint; (* Extra options *)
  251. (*
  252. * Those fields are needed only for treaming parsing so far
  253. *)
  254. dictNames : cint; (* Use dictionary names for the tree *)
  255. freeElemsNr : cint; (* number of freed element nodes *)
  256. freeElems : xmlNodePtr; (* List of freed element nodes *)
  257. freeAttrsNr : cint; (* number of freed attributes nodes *)
  258. freeAttrs : xmlAttrPtr; (* List of freed attributes nodes *)
  259. (*
  260. * the complete error informations for the last error.
  261. *)
  262. lastError : xmlError;
  263. parseMode : xmlParserMode; (* the parser mode *)
  264. end;
  265. (**
  266. * xmlSAXLocator:
  267. *
  268. * A SAX Locator.
  269. *)
  270. getPublicIdFunc = function(ctx: pointer): xmlCharPtr; EXTDECL;
  271. getSystemIdFunc = function(ctx: pointer): xmlCharPtr; EXTDECL;
  272. getLineNumberFunc = function(ctx: pointer): cint; EXTDECL;
  273. getColumnNumberFunc = function(ctx: pointer): cint; EXTDECL;
  274. xmlSAXLocator = record
  275. getPublicId : getPublicIdFunc;
  276. getSystemId : getSystemIdFunc;
  277. getLineNumber : getLineNumberFunc;
  278. getColumnNumber : getColumnNumberFunc;
  279. end;
  280. (**
  281. * xmlSAXHandler:
  282. *
  283. * A SAX handler is bunch of callbacks called by the parser when processing
  284. * of the input generate data or structure informations.
  285. *)
  286. (**
  287. * resolveEntitySAXFunc:
  288. * @ctx: the user data (XML parser context)
  289. * @publicId: The public ID of the entity
  290. * @systemId: The system ID of the entity
  291. *
  292. * Callback:
  293. * The entity loader, to control the loading of external entities,
  294. * the application can either:
  295. * - override this resolveEntity() callback in the SAX block
  296. * - or better use the xmlSetExternalEntityLoader() function to
  297. * set up it's own entity resolution routine
  298. *
  299. * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
  300. *)
  301. resolveEntitySAXFunc = function(ctx: pointer; publicID, systemID: xmlCharPtr): xmlParserInputPtr; EXTDECL;
  302. (**
  303. * internalSubsetSAXFunc:
  304. * @ctx: the user data (XML parser context)
  305. * @name: the root element name
  306. * @ExternalID: the external ID
  307. * @SystemID: the SYSTEM ID (e.g. filename or URL)
  308. *
  309. * Callback on internal subset declaration.
  310. *)
  311. internalSubsetSAXFunc = procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
  312. (**
  313. * externalSubsetSAXFunc:
  314. * @ctx: the user data (XML parser context)
  315. * @name: the root element name
  316. * @ExternalID: the external ID
  317. * @SystemID: the SYSTEM ID (e.g. filename or URL)
  318. *
  319. * Callback on external subset declaration.
  320. *)
  321. externalSubsetSAXFunc = procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
  322. (**
  323. * getEntitySAXFunc:
  324. * @ctx: the user data (XML parser context)
  325. * @name: The entity name
  326. *
  327. * Get an entity by name.
  328. *
  329. * Returns the xmlEntityPtr if found.
  330. *)
  331. getEntitySAXFunc = function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
  332. (**
  333. * getParameterEntitySAXFunc:
  334. * @ctx: the user data (XML parser context)
  335. * @name: The entity name
  336. *
  337. * Get a parameter entity by name.
  338. *
  339. * Returns the xmlEntityPtr if found.
  340. *)
  341. getParameterEntitySAXFunc = function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
  342. (**
  343. * entityDeclSAXFunc:
  344. * @ctx: the user data (XML parser context)
  345. * @name: the entity name
  346. * @type: the entity type
  347. * @publicId: The public ID of the entity
  348. * @systemId: The system ID of the entity
  349. * @content: the entity value (without processing).
  350. *
  351. * An entity definition has been parsed.
  352. *)
  353. entityDeclSAXFunc = procedure(ctx: pointer; name: xmlCharPtr; _type: cint; publicId, systemId, content: xmlCharPtr); EXTDECL;
  354. (**
  355. * notationDeclSAXFunc:
  356. * @ctx: the user data (XML parser context)
  357. * @name: The name of the notation
  358. * @publicId: The public ID of the entity
  359. * @systemId: The system ID of the entity
  360. *
  361. * What to do when a notation declaration has been parsed.
  362. *)
  363. notationDeclSAXFunc = procedure(ctx: pointer; name, publicId, systemId: xmlCharPtr); EXTDECL;
  364. (**
  365. * attributeDeclSAXFunc:
  366. * @ctx: the user data (XML parser context)
  367. * @elem: the name of the element
  368. * @fullname: the attribute name
  369. * @type: the attribute type
  370. * @def: the type of default value
  371. * @defaultValue: the attribute default value
  372. * @tree: the tree of enumerated value set
  373. *
  374. * An attribute definition has been parsed.
  375. *)
  376. attributeDeclSAXFunc = procedure(ctx: pointer; elem, fullname: xmlCharPtr; _type, def: cint; defaultValue: xmlCharPtr; tree: xmlEnumerationPtr); EXTDECL;
  377. (**
  378. * elementDeclSAXFunc:
  379. * @ctx: the user data (XML parser context)
  380. * @name: the element name
  381. * @type: the element type
  382. * @content: the element value tree
  383. *
  384. * An element definition has been parsed.
  385. *)
  386. elementDeclSAXFunc = procedure(ctx: pointer; name: xmlCharPtr; _type: cint; content: xmlElementContentPtr); EXTDECL;
  387. (**
  388. * unparsedEntityDeclSAXFunc:
  389. * @ctx: the user data (XML parser context)
  390. * @name: The name of the entity
  391. * @publicId: The public ID of the entity
  392. * @systemId: The system ID of the entity
  393. * @notationName: the name of the notation
  394. *
  395. * What to do when an unparsed entity declaration is parsed.
  396. *)
  397. unparsedEntityDeclSAXFunc = procedure(ctx: pointer; name, publicId, systemId, notationName: xmlCharPtr); EXTDECL;
  398. (**
  399. * setDocumentLocatorSAXFunc:
  400. * @ctx: the user data (XML parser context)
  401. * @loc: A SAX Locator
  402. *
  403. * Receive the document locator at startup, actually xmlDefaultSAXLocator.
  404. * Everything is available on the context, so this is useless in our case.
  405. *)
  406. setDocumentLocatorSAXFunc = procedure(ctx: pointer; loc: xmlSAXLocatorPtr); EXTDECL;
  407. (**
  408. * startDocumentSAXFunc:
  409. * @ctx: the user data (XML parser context)
  410. *
  411. * Called when the document start being processed.
  412. *)
  413. startDocumentSAXFunc = procedure(ctx: pointer); EXTDECL;
  414. (**
  415. * endDocumentSAXFunc:
  416. * @ctx: the user data (XML parser context)
  417. *
  418. * Called when the document end has been detected.
  419. *)
  420. endDocumentSAXFunc = procedure(ctx: pointer); EXTDECL;
  421. (**
  422. * startElementSAXFunc:
  423. * @ctx: the user data (XML parser context)
  424. * @name: The element name, including namespace prefix
  425. * @atts: An array of name/value attributes pairs, NULL terminated
  426. *
  427. * Called when an opening tag has been processed.
  428. *)
  429. startElementSAXFunc = procedure(ctx: pointer; name: xmlCharPtr; atts: xmlCharPtrPtr); EXTDECL;
  430. (**
  431. * endElementSAXFunc:
  432. * @ctx: the user data (XML parser context)
  433. * @name: The element name
  434. *
  435. * Called when the end of an element has been detected.
  436. *)
  437. endElementSAXFunc = procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
  438. (**
  439. * attributeSAXFunc:
  440. * @ctx: the user data (XML parser context)
  441. * @name: The attribute name, including namespace prefix
  442. * @value: The attribute value
  443. *
  444. * Handle an attribute that has been read by the parser.
  445. * The default handling is to convert the attribute into an
  446. * DOM subtree and past it in a new xmlAttr element added to
  447. * the element.
  448. *)
  449. attributeSAXFunc = procedure(ctx: pointer; name, value: xmlCharPtr); EXTDECL;
  450. (**
  451. * referenceSAXFunc:
  452. * @ctx: the user data (XML parser context)
  453. * @name: The entity name
  454. *
  455. * Called when an entity reference is detected.
  456. *)
  457. referenceSAXFunc = procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
  458. (**
  459. * charactersSAXFunc:
  460. * @ctx: the user data (XML parser context)
  461. * @ch: a xmlChar string
  462. * @len: the number of xmlChar
  463. *
  464. * Receiving some chars from the parser.
  465. *)
  466. charactersSAXFunc = procedure(ctx: pointer; ch: xmlCharPtr; len: cint); EXTDECL;
  467. (**
  468. * ignorableWhitespaceSAXFunc:
  469. * @ctx: the user data (XML parser context)
  470. * @ch: a xmlChar string
  471. * @len: the number of xmlChar
  472. *
  473. * Receiving some ignorable whitespaces from the parser.
  474. * UNUSED: by default the DOM building will use characters.
  475. *)
  476. ignorableWhitespaceSAXFunc = procedure(ctx: pointer; ch: xmlCharPtr; len: cint); EXTDECL;
  477. (**
  478. * processingInstructionSAXFunc:
  479. * @ctx: the user data (XML parser context)
  480. * @target: the target name
  481. * @data: the PI data's
  482. *
  483. * A processing instruction has been parsed.
  484. *)
  485. processingInstructionSAXFunc = procedure(ctx: pointer; target, data: xmlCharPtr); EXTDECL;
  486. (**
  487. * commentSAXFunc:
  488. * @ctx: the user data (XML parser context)
  489. * @value: the comment content
  490. *
  491. * A comment has been parsed.
  492. *)
  493. commentSAXFunc = procedure(ctx: pointer; value: xmlCharPtr); EXTDECL;
  494. (**
  495. * cdataBlockSAXFunc:
  496. * @ctx: the user data (XML parser context)
  497. * @value: The pcdata content
  498. * @len: the block length
  499. *
  500. * Called when a pcdata block has been parsed.
  501. *)
  502. cdataBlockSAXFunc = procedure(ctx: pointer; value: xmlCharPtr; len: cint); EXTDECL;
  503. (**
  504. * warningSAXFunc:
  505. * @ctx: an XML parser context
  506. * @msg: the message to display/transmit
  507. * @...: extra parameters for the message display
  508. *
  509. * Display and format a warning messages, callback.
  510. *)
  511. warningSAXFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
  512. (**
  513. * errorSAXFunc:
  514. * @ctx: an XML parser context
  515. * @msg: the message to display/transmit
  516. * @...: extra parameters for the message display
  517. *
  518. * Display and format an error messages, callback.
  519. *)
  520. errorSAXFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
  521. (**
  522. * fatalErrorSAXFunc:
  523. * @ctx: an XML parser context
  524. * @msg: the message to display/transmit
  525. * @...: extra parameters for the message display
  526. *
  527. * Display and format fatal error messages, callback.
  528. * Note: so far fatalError() SAX callbacks are not used, error()
  529. * get all the callbacks for errors.
  530. *)
  531. fatalErrorSAXFunc = procedure(ctx: pointer; msg: pchar); cdecl; varargs;
  532. (**
  533. * isStandaloneSAXFunc:
  534. * @ctx: the user data (XML parser context)
  535. *
  536. * Is this document tagged standalone?
  537. *
  538. * Returns 1 if true
  539. *)
  540. isStandaloneSAXFunc = function(ctx: pointer): cint; EXTDECL;
  541. (**
  542. * hasInternalSubsetSAXFunc:
  543. * @ctx: the user data (XML parser context)
  544. *
  545. * Does this document has an internal subset.
  546. *
  547. * Returns 1 if true
  548. *)
  549. hasInternalSubsetSAXFunc = function(ctx: pointer): cint; EXTDECL;
  550. (**
  551. * hasExternalSubsetSAXFunc:
  552. * @ctx: the user data (XML parser context)
  553. *
  554. * Does this document has an external subset?
  555. *
  556. * Returns 1 if true
  557. *)
  558. hasExternalSubsetSAXFunc = function(ctx: pointer): cint; EXTDECL;
  559. {$ENDIF}
  560. (************************************************************************
  561. * *
  562. * The SAX version 2 API extensions *
  563. * *
  564. ************************************************************************)
  565. (**
  566. * XML_SAX2_MAGIC:
  567. *
  568. * Special constant found in SAX2 blocks initialized fields
  569. *)
  570. {$IFDEF CONST}
  571. XML_SAX2_MAGIC = $DEEDBEAF;
  572. {$ENDIF}
  573. {$IFDEF TYPE}
  574. (**
  575. * startElementNsSAX2Func:
  576. * @ctx: the user data (XML parser context)
  577. * @localname: the local name of the element
  578. * @prefix: the element namespace prefix if available
  579. * @URI: the element namespace name if available
  580. * @nb_namespaces: number of namespace definitions on that node
  581. * @namespaces: pointer to the array of prefix/URI pairs namespace definitions
  582. * @nb_attributes: the number of attributes on that node
  583. * @nb_defaulted: the number of defaulted attributes. The defaulted
  584. * ones are at the end of the array
  585. * @attributes: pointer to the array of (localname/prefix/URI/value/end)
  586. * attribute values.
  587. *
  588. * SAX2 callback when an element start has been detected by the parser.
  589. * It provides the namespace informations for the element, as well as
  590. * the new namespace declarations on the element.
  591. *)
  592. startElementNsSAX2Func = procedure(ctx: pointer; localname, prefix, URI: xmlCharPtr; nb_namespaces: cint;
  593. namespaces: xmlCharPtrPtr; nb_attributes, nb_defaulted: cint; attributes: xmlCharPtrPtr); EXTDECL;
  594. (**
  595. * endElementNsSAX2Func:
  596. * @ctx: the user data (XML parser context)
  597. * @localname: the local name of the element
  598. * @prefix: the element namespace prefix if available
  599. * @URI: the element namespace name if available
  600. *
  601. * SAX2 callback when an element end has been detected by the parser.
  602. * It provides the namespace informations for the element.
  603. *)
  604. endElementNsSAX2Func = procedure(ctx: pointer; localname, prefix, URI: xmlCharPtr); EXTDECL;
  605. xmlSAXHandler = record
  606. internalSubset: internalSubsetSAXFunc;
  607. isStandalone: isStandaloneSAXFunc;
  608. hasInternalSubset: hasInternalSubsetSAXFunc;
  609. hasExternalSubset: hasExternalSubsetSAXFunc;
  610. resolveEntity: resolveEntitySAXFunc;
  611. getEntity: getEntitySAXFunc;
  612. entityDecl: entityDeclSAXFunc;
  613. notationDecl: notationDeclSAXFunc;
  614. attributeDecl: attributeDeclSAXFunc;
  615. elementDecl: elementDeclSAXFunc;
  616. unparsedEntityDecl: unparsedEntityDeclSAXFunc;
  617. setDocumentLocator: setDocumentLocatorSAXFunc;
  618. startDocument: startDocumentSAXFunc;
  619. endDocument: endDocumentSAXFunc;
  620. startElement: startElementSAXFunc;
  621. endElement: endElementSAXFunc;
  622. reference: referenceSAXFunc;
  623. characters: charactersSAXFunc;
  624. ignorableWhitespace: ignorableWhitespaceSAXFunc;
  625. processingInstruction: processingInstructionSAXFunc;
  626. comment: commentSAXFunc;
  627. warning: warningSAXFunc;
  628. error: errorSAXFunc;
  629. fatalError: fatalErrorSAXFunc; (* unused error() get all the errors *)
  630. getParameterEntity: getParameterEntitySAXFunc;
  631. cdataBlock: cdataBlockSAXFunc;
  632. externalSubset: externalSubsetSAXFunc;
  633. initialized: cuint;
  634. (* The following fields are extensions available only on version 2 *)
  635. _private: pointer;
  636. startElementNs: startElementNsSAX2Func;
  637. endElementNs: endElementNsSAX2Func;
  638. serror: xmlStructuredErrorFunc;
  639. end;
  640. (*
  641. * SAX Version 1
  642. *)
  643. xmlSAXHandlerV1 = record
  644. internalSubset: internalSubsetSAXFunc;
  645. isStandalone: isStandaloneSAXFunc;
  646. hasInternalSubset: hasInternalSubsetSAXFunc;
  647. hasExternalSubset: hasExternalSubsetSAXFunc;
  648. resolveEntity: resolveEntitySAXFunc;
  649. getEntity: getEntitySAXFunc;
  650. entityDecl: entityDeclSAXFunc;
  651. notationDecl: notationDeclSAXFunc;
  652. attributeDecl: attributeDeclSAXFunc;
  653. elementDecl: elementDeclSAXFunc;
  654. unparsedEntityDecl: unparsedEntityDeclSAXFunc;
  655. setDocumentLocator: setDocumentLocatorSAXFunc;
  656. startDocument: startDocumentSAXFunc;
  657. endDocument: endDocumentSAXFunc;
  658. startElement: startElementSAXFunc;
  659. endElement: endElementSAXFunc;
  660. reference: referenceSAXFunc;
  661. characters: charactersSAXFunc;
  662. ignorableWhitespace: ignorableWhitespaceSAXFunc;
  663. processingInstruction: processingInstructionSAXFunc;
  664. comment: commentSAXFunc;
  665. warning: warningSAXFunc;
  666. error: errorSAXFunc;
  667. fatalError: fatalErrorSAXFunc; (* unused error() get all the errors *)
  668. getParameterEntity: getParameterEntitySAXFunc;
  669. cdataBlock: cdataBlockSAXFunc;
  670. externalSubset: externalSubsetSAXFunc;
  671. initialized: cuint;
  672. end;
  673. (**
  674. * xmlExternalEntityLoader:
  675. * @URL: The System ID of the resource requested
  676. * @ID: The Public ID of the resource requested
  677. * @context: the XML parser context
  678. *
  679. * External entity loaders types.
  680. *
  681. * Returns the entity input parser.
  682. *)
  683. xmlExternalEntityLoader = function(URL, ID: pchar; context: xmlParserCtxtPtr): xmlParserInputPtr; EXTDECL;
  684. (**
  685. * xmlParserOption:
  686. *
  687. * This is the set of XML parser options that can be passed down
  688. * to the xmlReadDoc() and similar calls.
  689. *)
  690. xmlParserOption = type cint;
  691. {$ENDIF}
  692. {$IFDEF CONST}
  693. XML_PARSE_RECOVER = (1 shl 0); (* recover on errors *)
  694. XML_PARSE_NOENT = (1 shl 1); (* substitute entities *)
  695. XML_PARSE_DTDLOAD = (1 shl 2); (* load the external subset *)
  696. XML_PARSE_DTDATTR = (1 shl 3); (* default DTD attributes *)
  697. XML_PARSE_DTDVALID = (1 shl 4); (* validate with the DTD *)
  698. XML_PARSE_NOERROR = (1 shl 5); (* suppress error reports *)
  699. XML_PARSE_NOWARNING = (1 shl 6); (* suppress warning reports *)
  700. XML_PARSE_PEDANTIC = (1 shl 7); (* pedantic error reporting *)
  701. XML_PARSE_NOBLANKS = (1 shl 8); (* remove blank nodes *)
  702. XML_PARSE_SAX1 = (1 shl 9); (* use the SAX1 interface internally *)
  703. XML_PARSE_XINCLUDE = (1 shl 10);(* Implement XInclude substitition *)
  704. XML_PARSE_NONET = (1 shl 11);(* Forbid network access *)
  705. XML_PARSE_NODICT = (1 shl 12);(* Do not reuse the context dictionnary *)
  706. XML_PARSE_NSCLEAN = (1 shl 13);(* remove redundant namespaces declarations *)
  707. XML_PARSE_NOCDATA = (1 shl 14);(* merge CDATA as text nodes *)
  708. XML_PARSE_NOXINCNODE = (1 shl 15);(* do not generate XINCLUDE START/END nodes *)
  709. XML_PARSE_COMPACT = (1 shl 16); (* compact small text nodes); no modification of
  710. the tree allowed afterwards (will possibly
  711. crash if you try to modify the tree) *)
  712. {$ENDIF}
  713. {$IFDEF TYPE}
  714. xmlFeature = (
  715. XML_WITH_THREAD = 1,
  716. XML_WITH_TREE = 2,
  717. XML_WITH_OUTPUT = 3,
  718. XML_WITH_PUSH = 4,
  719. XML_WITH_READER = 5,
  720. XML_WITH_PATTERN = 6,
  721. XML_WITH_WRITER = 7,
  722. XML_WITH_SAX1 = 8,
  723. XML_WITH_FTP = 9,
  724. XML_WITH_HTTP = 10,
  725. XML_WITH_VALID = 11,
  726. XML_WITH_HTML = 12,
  727. XML_WITH_LEGACY = 13,
  728. XML_WITH_C14N = 14,
  729. XML_WITH_CATALOG = 15,
  730. XML_WITH_XPATH = 16,
  731. XML_WITH_XPTR = 17,
  732. XML_WITH_XINCLUDE = 18,
  733. XML_WITH_ICONV = 19,
  734. XML_WITH_ISO8859X = 20,
  735. XML_WITH_UNICODE = 21,
  736. XML_WITH_REGEXP = 22,
  737. XML_WITH_AUTOMATA = 23,
  738. XML_WITH_EXPR = 24,
  739. XML_WITH_SCHEMAS = 25,
  740. XML_WITH_SCHEMATRON = 26,
  741. XML_WITH_MODULES = 27,
  742. XML_WITH_DEBUG = 28,
  743. XML_WITH_DEBUG_MEM = 29,
  744. XML_WITH_DEBUG_RUN = 30,
  745. XML_WITH_ZLIB = 31,
  746. XML_WITH_NONE = 99999 (* just to be sure of allocation size *)
  747. );
  748. {$ENDIF}
  749. {$IFDEF FUNCTION}
  750. (*
  751. * Init/Cleanup
  752. *)
  753. procedure xmlInitParser; EXTDECL; external xml2lib;
  754. procedure xmlCleanupParser; EXTDECL; external xml2lib;
  755. (*
  756. * Input functions
  757. *)
  758. function xmlParserInputRead(_in: xmlParserInputPtr; len: cint): cint; EXTDECL; external xml2lib;
  759. function xmlParserInputGrow(_in: xmlParserInputPtr; len: cint): cint; EXTDECL; external xml2lib;
  760. (*
  761. * Basic parsing Interfaces
  762. *)
  763. {$IFDEF LIBXML_SAX1_ENABLED}
  764. function xmlParseDoc(cur: xmlCharPtr): xmlDocPtr; EXTDECL; external xml2lib;
  765. function xmlParseFile(filename: pchar): xmlDocPtr; EXTDECL; external xml2lib;
  766. function xmlParseMemory(buffer: pchar; size: cint): xmlDocPtr; EXTDECL; external xml2lib;
  767. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  768. function xmlSubstituteEntitiesDefault(val: cint): cint; EXTDECL; external xml2lib;
  769. function xmlKeepBlanksDefault(val: cint): cint; EXTDECL; external xml2lib;
  770. procedure xmlStopParser(ctxt: xmlParserCtxtPtr); EXTDECL; external xml2lib;
  771. function xmlPedanticParserDefault(val: cint): cint; EXTDECL; external xml2lib;
  772. function xmlLineNumbersDefault(val: cint): cint; EXTDECL; external xml2lib;
  773. {$IFDEF LIBXML_SAX1_ENABLED}
  774. (*
  775. * Recovery mode
  776. *)
  777. function xmlRecoverDoc(cur: xmlCharPtr): xmlDocPtr; EXTDECL; external xml2lib;
  778. function xmlRecoverMemory(buffer: pchar; size: cint): xmlDocPtr; EXTDECL; external xml2lib;
  779. function xmlRecoverFile(filename: pchar): xmlDocPtr; EXTDECL; external xml2lib;
  780. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  781. (*
  782. * Less common routines and SAX interfaces
  783. *)
  784. function xmlParseDocument(ctxt: xmlParserCtxtPtr): cint; EXTDECL; external xml2lib;
  785. function xmlParseExtParsedEnt(ctxt: xmlParserCtxtPtr): cint; EXTDECL; external xml2lib;
  786. {$IFDEF LIBXML_SAX1_ENABLED}
  787. function xmlSAXUserParseFile(sax: xmlSAXHandlerPtr; user_data: pointer; filename: pchar): cint; EXTDECL; external xml2lib;
  788. function xmlSAXUserParseMemory(sax: xmlSAXHandlerPtr; user_data: pointer; buffer: pchar; size: cint): cint; EXTDECL; external xml2lib;
  789. function xmlSAXParseDoc(sax: xmlSAXHandlerPtr; cur: xmlCharPtr; recovery: cint): xmlDocPtr; EXTDECL; external xml2lib;
  790. function xmlSAXParseMemory(sax: xmlSAXHandlerPtr; buffer: pchar; size: cint; recovery: cint): xmlDocPtr; EXTDECL; external xml2lib;
  791. function xmlSAXParseMemoryWithData(sax: xmlSAXHandlerPtr; buffer: pchar; size: cint; recovery: cint; data: pointer): xmlDocPtr; EXTDECL; external xml2lib;
  792. function xmlSAXParseFile(sax: xmlSAXHandlerPtr; filename: pchar; recovery: cint): xmlDocPtr; EXTDECL; external xml2lib;
  793. function xmlSAXParseFileWithData(sax: xmlSAXHandlerPtr; filename: pchar; recovery: cint; data: pointer): xmlDocPtr; EXTDECL; external xml2lib;
  794. function xmlSAXParseEntity(sax: xmlSAXHandlerPtr; filename: pchar): xmlDocPtr; EXTDECL; external xml2lib;
  795. function xmlParseEntity(filename: pchar): xmlDocPtr; EXTDECL; external xml2lib;
  796. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  797. {$IFDEF LIBXML_VALID_ENABLED}
  798. function xmlSAXParseDTD(sax: xmlSAXHandlerPtr; ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL; external xml2lib;
  799. function xmlParseDTD(ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL; external xml2lib;
  800. function xmlIOParseDTD(sax: xmlSAXHandlerPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding): xmlDtdPtr; EXTDECL; external xml2lib;
  801. {$ENDIF} (* LIBXML_VALID_ENABLE *)
  802. {$IFDEF LIBXML_SAX1_ENABLED}
  803. function xmlParseBalancedChunkMemory(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer; depth: cint; _string: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL; external xml2lib;
  804. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  805. function xmlParseInNodeContext(node: xmlNodePtr; data: pchar; datalen, options: cint; lst: xmlNodePtrPtr): xmlParserErrors; EXTDECL; external xml2lib;
  806. {$IFDEF LIBXML_SAX1_ENABLED}
  807. function xmlParseBalancedChunkMemoryRecover(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer;
  808. depth: cint; _string: xmlCharPtr; lst: xmlNodePtrPtr; recover: cint): cint; EXTDECL; external xml2lib;
  809. function xmlParseExternalEntity(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer;
  810. depth: cint; URL, ID: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL; external xml2lib;
  811. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  812. function xmlParseCtxtExternalEntity(ctx: xmlParserCtxtPtr; URL, ID: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL; external xml2lib;
  813. (*
  814. * Parser contexts handling.
  815. *)
  816. function xmlNewParserCtxt: xmlParserCtxtPtr; EXTDECL; external xml2lib;
  817. function xmlInitParserCtxt(ctxt: xmlParserCtxtPtr): cint; EXTDECL; external xml2lib;
  818. procedure xmlClearParserCtxt(ctxt: xmlParserCtxtPtr); EXTDECL; external xml2lib;
  819. procedure xmlFreeParserCtxt(ctxt: xmlParserCtxtPtr); EXTDECL; external xml2lib;
  820. {$IFDEF LIBXML_SAX1_ENABLED}
  821. procedure xmlSetupParserForBuffer(ctxt: xmlParserCtxtPtr; buffer: xmlCharPtr; filename: pchar); EXTDECL; external xml2lib;
  822. {$ENDIF} (* LIBXML_SAX1_ENABLED *)
  823. function xmlCreateDocParserCtxt(cur: xmlCharPtr): xmlParserCtxtPtr; EXTDECL; external xml2lib;
  824. {$IFDEF LIBXML_LEGACY_ENABLED}
  825. (*
  826. * Reading/setting optional parsing features.
  827. *)
  828. function xmlGetFeaturesList(var len: cint; var result: pchar): cint; EXTDECL; external xml2lib;
  829. function xmlGetFeature(ctxt: xmlParserCtxtPtr; name: pchar; result: pointer): cint; EXTDECL; external xml2lib;
  830. function xmlSetFeature(ctxt: xmlParserCtxtPtr; name: pchar; value: pointer): cint; EXTDECL; external xml2lib;
  831. {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
  832. {$IFDEF LIBXML_PUSH_ENABLED}
  833. (*
  834. * Interfaces for the Push mode.
  835. *)
  836. function xmlCreatePushParserCtxt(sax: xmlSAXHandlerPtr; user_data: pointer; chunk: pchar; size: cint; filename: pchar): xmlParserCtxtPtr; EXTDECL; external xml2lib;
  837. function xmlParseChunk(ctxt: xmlParserCtxtPtr; chunk: pchar; size, terminate: cint): cint; EXTDECL; external xml2lib;
  838. {$ENDIF} (* LIBXML_PUSH_ENABLED *)
  839. (*
  840. * Special I/O mode.
  841. *)
  842. function xmlCreateIOParserCtxt(sax: xmlSAXHandlerPtr; user_data: pointer; ioread: xmlInputReadCallback;
  843. ioclose: xmlInputCloseCallback; ioctx: pointer; enc: xmlCharEncoding): xmlParserCtxtPtr; EXTDECL; external xml2lib;
  844. function xmlNewIOInputStream(ctxt: xmlParserCtxtPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding): xmlParserInputPtr; EXTDECL; external xml2lib;
  845. (*
  846. * Node infos.
  847. *)
  848. function xmlParserFindNodeInfo(ctxt: xmlParserCtxtPtr; node: xmlNodePtr): xmlParserNodeInfoPtr; EXTDECL; external xml2lib;
  849. procedure xmlInitNodeInfoSeq(seq: xmlParserNodeInfoSeqPtr); EXTDECL; external xml2lib;
  850. procedure xmlClearNodeInfoSeq(seq: xmlParserNodeInfoSeqPtr); EXTDECL; external xml2lib;
  851. function xmlParserFindNodeInfoIndex(seq: xmlParserNodeInfoSeqPtr; node: xmlNodePtr): culong; EXTDECL; external xml2lib;
  852. procedure xmlParserAddNodeInfo(ctxt: xmlParserCtxtPtr; info: xmlParserNodeInfoPtr); EXTDECL; external xml2lib;
  853. (*
  854. * External entities handling actually implemented in xmlIO.
  855. *)
  856. procedure xmlSetExternalEntityLoader(f: xmlExternalEntityLoader); EXTDECL; external xml2lib;
  857. function xmlGetExternalEntityLoader(): xmlExternalEntityLoader; EXTDECL; external xml2lib;
  858. function xmlLoadExternalEntity(URL, ID: pchar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; EXTDECL; external xml2lib;
  859. (*
  860. * Index lookup, actually implemented in the encoding module
  861. *)
  862. function xmlByteConsumed(ctxt: xmlParserCtxtPtr): culong; EXTDECL; external xml2lib;
  863. (*
  864. * New set of simpler/more flexible APIs
  865. *)
  866. procedure xmlCtxtReset(ctxt: xmlParserCtxtPtr); EXTDECL; external xml2lib;
  867. function xmlCtxtResetPush(ctxt: xmlParserCtxtPtr; chunk: pchar; size: cint; filename, encoding: pchar): cint; EXTDECL; external xml2lib;
  868. function xmlCtxtUseOptions(ctxt: xmlParserCtxtPtr; options: cint): cint; EXTDECL; external xml2lib;
  869. function xmlReadDoc(cur: xmlCharPtr; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  870. function xmlReadFile(filename, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  871. function xmlReadMemory(buffer: pchar; size: cint; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  872. function xmlReadFd(fd: cint; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  873. function xmlReadIO(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  874. function xmlCtxtReadDoc(ctxt: xmlParserCtxtPtr; cur: xmlCharPtr; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  875. function xmlCtxtReadFile(ctxt: xmlParserCtxtPtr; filename, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  876. function xmlCtxtReadMemory(ctxt: xmlParserCtxtPtr; buffer: pchar; size: cint; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  877. function xmlCtxtReadFd(ctxt: xmlParserCtxtPtr; fd: cint; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  878. function xmlCtxtReadIO(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pchar; URL, encoding: pchar; options: cint): xmlDocPtr; EXTDECL; external xml2lib;
  879. (*
  880. * Library wide options
  881. *)
  882. (**
  883. * xmlFeature:
  884. *
  885. * Used to examine the existance of features that can be enabled
  886. * or disabled at compile-time.
  887. * They used to be called XML_FEATURE_xxx but this clashed with Expat
  888. *)
  889. function xmlHasFeature(feature: xmlFeature): cint; EXTDECL; external xml2lib;
  890. {$ENDIF}