Browse Source

libxml: update nad fix libxml2 headers, added dynamic loading capability, libxslt and libexslt headers.

michalgw 2 weeks ago
parent
commit
fdf9113398
89 changed files with 14053 additions and 632 deletions
  1. 61 0
      packages/libxml/examples/parse1.pas
  2. 77 0
      packages/libxml/examples/parse2.pas
  3. 66 0
      packages/libxml/examples/parse3.pas
  4. 122 0
      packages/libxml/examples/parse4.pas
  5. 1206 0
      packages/libxml/examples/testWriter.pas
  6. 257 0
      packages/libxml/examples/xpath1.pas
  7. 185 0
      packages/libxml/examples/xpath2.pas
  8. 127 2
      packages/libxml/fpmake.pp
  9. 3 0
      packages/libxml/namespaced/Api.XML.Exslt.pas
  10. 3 0
      packages/libxml/namespaced/Api.XML.ExsltDyn.pas
  11. 3 0
      packages/libxml/namespaced/Api.XML.Xml2Dyn.pas
  12. 3 0
      packages/libxml/namespaced/Api.XML.Xslt.pas
  13. 3 0
      packages/libxml/namespaced/Api.XML.XsltDyn.pas
  14. 5 0
      packages/libxml/namespaces.lst
  15. 76 9
      packages/libxml/src/HTMLparser.inc
  16. 23 0
      packages/libxml/src/HTMLtree.inc
  17. 52 0
      packages/libxml/src/SAX.inc
  18. 58 1
      packages/libxml/src/SAX2.inc
  19. 24 0
      packages/libxml/src/attributes.inc
  20. 30 4
      packages/libxml/src/c14n.inc
  21. 61 2
      packages/libxml/src/catalog.inc
  22. 65 62
      packages/libxml/src/chvalid.inc
  23. 39 1
      packages/libxml/src/dict.inc
  24. 84 0
      packages/libxml/src/documents.inc
  25. 39 0
      packages/libxml/src/encoding.inc
  26. 36 1
      packages/libxml/src/entities.inc
  27. 64 0
      packages/libxml/src/exslt.inc
  28. 59 0
      packages/libxml/src/exslt.pas
  29. 131 0
      packages/libxml/src/exsltdyn.pas
  30. 228 0
      packages/libxml/src/extensions.inc
  31. 55 0
      packages/libxml/src/extra.inc
  32. 84 0
      packages/libxml/src/fpcfunctions.inc
  33. 69 0
      packages/libxml/src/functions.inc
  34. 385 79
      packages/libxml/src/globals.inc
  35. 55 7
      packages/libxml/src/hash.inc
  36. 61 0
      packages/libxml/src/imports.inc
  37. 35 0
      packages/libxml/src/keys.inc
  38. 168 1
      packages/libxml/src/libxmlparser.inc
  39. 38 2
      packages/libxml/src/list.inc
  40. 191 0
      packages/libxml/src/macros.inc
  41. 46 0
      packages/libxml/src/namespaces.inc
  42. 45 1
      packages/libxml/src/nanoftp.inc
  43. 23 1
      packages/libxml/src/nanohttp.inc
  44. 57 0
      packages/libxml/src/numbersInternals.inc
  45. 21 1
      packages/libxml/src/pattern.inc
  46. 31 0
      packages/libxml/src/preproc.inc
  47. 42 1
      packages/libxml/src/relaxng.inc
  48. 58 46
      packages/libxml/src/schemasInternals.inc
  49. 55 0
      packages/libxml/src/schematron.inc
  50. 85 0
      packages/libxml/src/security.inc
  51. 43 0
      packages/libxml/src/templates.inc
  52. 25 1
      packages/libxml/src/threads.inc
  53. 120 0
      packages/libxml/src/transform.inc
  54. 335 13
      packages/libxml/src/tree.inc
  55. 26 3
      packages/libxml/src/uri.inc
  56. 119 1
      packages/libxml/src/valid.inc
  57. 99 0
      packages/libxml/src/variables.inc
  58. 23 2
      packages/libxml/src/xinclude.inc
  59. 20 0
      packages/libxml/src/xlink.inc
  60. 26 1
      packages/libxml/src/xml2.inc
  61. 3 300
      packages/libxml/src/xml2.pas
  62. 3706 0
      packages/libxml/src/xml2dyn.pas
  63. 34 0
      packages/libxml/src/xml2h.inc
  64. 98 0
      packages/libxml/src/xmlIO.inc
  65. 25 0
      packages/libxml/src/xmlautomata.inc
  66. 70 6
      packages/libxml/src/xmlerror.inc
  67. 42 0
      packages/libxml/src/xmlmemory.inc
  68. 7 0
      packages/libxml/src/xmlmodule.inc
  69. 133 0
      packages/libxml/src/xmlreader.inc
  70. 69 11
      packages/libxml/src/xmlregexp.inc
  71. 21 4
      packages/libxml/src/xmlsave.inc
  72. 65 4
      packages/libxml/src/xmlschemas.inc
  73. 38 0
      packages/libxml/src/xmlschemastypes.inc
  74. 43 0
      packages/libxml/src/xmlstring.inc
  75. 172 0
      packages/libxml/src/xmlunicode.inc
  76. 63 13
      packages/libxml/src/xmlversion.inc
  77. 195 0
      packages/libxml/src/xmlwriter.inc
  78. 135 50
      packages/libxml/src/xpath.inc
  79. 177 1
      packages/libxml/src/xpathInternals.inc
  80. 32 1
      packages/libxml/src/xpointer.inc
  81. 117 0
      packages/libxml/src/xslt.inc
  82. 111 0
      packages/libxml/src/xslt.pas
  83. 1811 0
      packages/libxml/src/xsltInternals.inc
  84. 45 0
      packages/libxml/src/xslt_item_common_fields.inc
  85. 40 0
      packages/libxml/src/xsltconfig.inc
  86. 733 0
      packages/libxml/src/xsltdyn.pas
  87. 58 0
      packages/libxml/src/xsltlocale.inc
  88. 73 0
      packages/libxml/src/xsltpattern.inc
  89. 307 0
      packages/libxml/src/xsltutils.inc

+ 61 - 0
packages/libxml/examples/parse1.pas

@@ -0,0 +1,61 @@
+(**
+ * section: Parsing
+ * synopsis: Parse an XML file to a tree and free it
+ * purpose: Demonstrate the use of xmlReadFile() to read an XML file
+ *          into a tree and xmlFreeDoc() to free the resulting tree
+ * usage: parse1 test1.xml
+ * test: parse1 test1.xml
+ * author: Daniel Veillard
+ * copy: see Copyright for the status of this software.
+ *)
+
+program parse1;
+
+{$mode objfpc}
+
+uses
+  xml2,
+  exutils;
+
+{**
+ * example1Func:
+ * @filename: a filename or an URL
+ *
+ * Parse the resource and free the resulting tree
+ *}
+procedure example1Func(const filename: PAnsiChar);
+var
+  doc: xmlDocPtr; (* the resulting document tree *)
+begin
+  doc := xmlReadFile(filename, nil, 0);
+  if (doc = nil) then
+  begin
+    printfn('Failed to parse %s', [filename]);
+    Exit;
+  end;
+  xmlFreeDoc(doc);
+end;
+
+begin
+  if ParamCount <> 1 then
+    Halt(1);
+
+  (*
+   * this initialize the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+  LIBXML_TEST_VERSION;
+
+  example1Func(PAnsiChar(ParamStr(1)));
+
+  (*
+   * Cleanup function for the XML library.
+   *)
+  xmlCleanupParser();
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.
+

+ 77 - 0
packages/libxml/examples/parse2.pas

@@ -0,0 +1,77 @@
+(**
+ * section: Parsing
+ * synopsis: Parse and validate an XML file to a tree and free the result
+ * purpose: Create a parser context for an XML file, then parse and validate
+ *          the file, creating a tree, check the validation result
+ *          and xmlFreeDoc() to free the resulting tree.
+ * usage: parse2 test2.xml
+ * test: parse2 test2.xml
+ * author: Daniel Veillard
+ * copy: see Copyright for the status of this software.
+ *)
+
+program parse2;
+
+{$mode objfpc}
+
+uses
+  xml2,
+  exutils;
+
+(**
+ * exampleFunc:
+ * @filename: a filename or an URL
+ *
+ * Parse and validate the resource and free the resulting tree
+ *)
+procedure exampleFunc(const filename: PAnsiChar);
+var
+  ctxt: xmlParserCtxtPtr; (* the parser context *)
+  doc: xmlDocPtr; (* the resulting document tree *)
+begin
+  (* create a parser context *)
+  ctxt := xmlNewParserCtxt();
+  if ctxt = Nil then
+  begin
+    printfn('Failed to allocate parser context');
+    Exit;
+  end;
+  (* parse the file, activating the DTD validation option *)
+  doc := xmlCtxtReadFile(ctxt, filename, Nil, XML_PARSE_DTDVALID);
+  (* check if parsing succeeded *)
+  if doc = Nil then
+    printfn('Failed to parse %s', [filename])
+  else
+  begin
+    (* check if validation succeeded *)
+    if ctxt^.valid = 0 then
+      printfn('Failed to validate %s', [filename]);
+    (* free up the resulting document *)
+    xmlFreeDoc(doc);
+  end;
+  (* free up the parser context *)
+  xmlFreeParserCtxt(ctxt);
+end;
+
+begin
+  if ParamCount <> 1 then
+    Halt(1);
+
+  (*
+   * this initialize the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+  LIBXML_TEST_VERSION;
+
+  exampleFunc(PAnsiChar(ParamStr(1)));
+
+  (*
+   * Cleanup function for the XML library.
+   *)
+  xmlCleanupParser();
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.

+ 66 - 0
packages/libxml/examples/parse3.pas

@@ -0,0 +1,66 @@
+(**
+ * section: Parsing
+ * synopsis: Parse an XML document in memory to a tree and free it
+ * purpose: Demonstrate the use of xmlReadMemory() to read an XML file
+ *          into a tree and xmlFreeDoc() to free the resulting tree
+ * usage: parse3
+ * test: parse3
+ * author: Daniel Veillard
+ * copy: see Copyright for the status of this software.
+ *)
+
+program parse3;
+
+{$mode objfpc}
+
+uses
+  xml2,
+  exutils;
+
+const
+  document = '<doc/>';
+
+(**
+ * example3Func:
+ * @content: the content of the document
+ * @length: the length in bytes
+ *
+ * Parse the in memory document and free the resulting tree
+ *)
+
+procedure example3Func(const content: PAnsiChar; length: Integer);
+var
+  doc: xmlDocPtr; (* the resulting document tree *)
+begin
+  (*
+   * The document being in memory, it have no base per RFC 2396,
+   * and the "noname.xml" argument will serve as its base.
+   *)
+  doc := xmlReadMemory(content, length, 'noname.xml', Nil, 0);
+  if doc = Nil then
+  begin
+    printfn('Failed to parse document');
+    Exit;
+  end;
+  xmlFreeDoc(doc);
+end;
+
+begin
+  (*
+   * this initialize the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+  LIBXML_TEST_VERSION;
+
+  example3Func(document, 6);
+
+  (*
+   * Cleanup function for the XML library.
+   *)
+  xmlCleanupParser();
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.

+ 122 - 0
packages/libxml/examples/parse4.pas

@@ -0,0 +1,122 @@
+(**
+ * section: Parsing
+ * synopsis: Parse an XML document chunk by chunk to a tree and free it
+ * purpose: Demonstrate the use of xmlCreatePushParserCtxt() and
+ *          xmlParseChunk() to read an XML file progressively
+ *          into a tree and xmlFreeDoc() to free the resulting tree
+ * usage: parse4 test3.xml
+ * test: parse4 test3.xml
+ * author: Daniel Veillard
+ * copy: see Copyright for the status of this software.
+ *)
+
+program parse4;
+
+{$mode objfpc}
+
+uses
+  xml2,
+  exutils,
+  ctypes;
+
+procedure processDoc(readerPtr: xmlTextReaderPtr);
+var
+  ret: cint;
+  docPtr: xmlDocPtr;
+  URL: PAnsiChar;
+begin
+  ret := xmlTextReaderRead(readerPtr);
+  while ret = 1 do
+    ret := xmlTextReaderRead(readerPtr);
+
+  (*
+   * One can obtain the document pointer to get interesting
+   * information about the document like the URL, but one must also
+   * be sure to clean it up at the end (see below).
+   *)
+  docPtr := xmlTextReaderCurrentDoc(readerPtr);
+  if docPtr = Nil then
+  begin
+    printfn('failed to obtain document');
+    Exit;
+  end;
+
+  URL := docPtr^.URL;
+  if URL = Nil then
+    printfn('Failed to obtain URL');
+
+  if ret <> 0 then
+  begin
+    printfn('%s: Failed to parse', [URL]);
+    Exit;
+  end;
+
+  printfn('%s: Processed ok', [URL]);
+end;
+
+var
+  readerPtr: xmlTextReaderPtr;
+  i: cint;
+  docPtr: xmlDocPtr;
+
+begin
+  if ParamCount < 1 then
+    Halt(1);
+
+  (*
+   * this initialises the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+  LIBXML_TEST_VERSION;
+
+  (*
+   * Create a new reader for the first file and process the
+   * document.
+   *)
+  readerPtr := xmlReaderForFile(PAnsiChar(ParamStr(1)), Nil, 0);
+  if readerPtr = Nil then
+  begin
+    printfn('%s: failed to create reader', [ParamStr(1)]);
+    Halt(1);
+  end;
+  processDoc(readerPtr);
+
+  (*
+   * The reader can be reused for subsequent files.
+   *)
+  for i := 2 to ParamCount do
+  begin
+    xmlReaderNewFile(readerPtr, PAnsiChar(ParamStr(i)), Nil, 0);
+    if readerPtr = Nil then
+    begin
+      printfn('%s: failed to create reader', [ParamStr(i)]);
+      Halt(1);
+    end;
+    processDoc(readerPtr);
+  end;
+
+  (*
+   * Since we've called xmlTextReaderCurrentDoc, we now have to
+   * clean up after ourselves.  We only have to do this the last
+   * time, because xmlReaderNewFile calls xmlCtxtReset which takes
+   * care of it.
+   *)
+  docPtr := xmlTextReaderCurrentDoc(readerPtr);
+  if docPtr <> Nil then
+    xmlFreeDoc(docPtr);
+
+  (*
+   * Clean up the reader.
+   *)
+  xmlFreeTextReader(readerPtr);
+
+  (*
+   * Cleanup function for the XML library.
+   *)
+  xmlCleanupParser();
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.

+ 1206 - 0
packages/libxml/examples/testWriter.pas

@@ -0,0 +1,1206 @@
+(**
+ * section: xmlWriter
+ * synopsis: use various APIs for the xmlWriter
+ * purpose: tests a number of APIs for the xmlWriter, especially
+ *          the various methods to write to a filename, to a memory
+ *          buffer, to a new document, or to a subtree. It shows how to
+ *          do encoding string conversions too. The resulting
+ *          documents are then serialized.
+ * usage: testWriter
+ * test: testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done
+ * author: Alfred Mickautsch
+ * copy: see Copyright for the status of this software.
+ *)
+
+program testWriter;
+
+{$mode objfpc}
+
+uses
+  ctypes,
+  xml2,
+  exutils,
+  SysUtils,
+  Strings;
+
+const
+  MY_ENCODING = 'ISO-8859-1';
+
+(**
+ * ConvertInput:
+ * @in: string in a given encoding
+ * @encoding: the encoding used
+ *
+ * Converts @in into UTF-8 for processing with libxml2 APIs
+ *
+ * Returns the converted UTF-8 string, or NULL in case of error.
+ *)
+function ConvertInput(const inp, encoding: PAnsiChar): xmlCharPtr;
+var
+  ret: cint;
+  size: cint;
+  out_size: cint;
+  temp: cint;
+  handler: xmlCharEncodingHandlerPtr;
+begin
+  Result := Nil;
+
+  if inp = Nil then
+    Exit;
+
+  handler := xmlFindCharEncodingHandler(encoding);
+
+  if handler = Nil then
+  begin
+    printfn('ConvertInput: no encoding handler found for ''%s''',
+      [specialize IfThen<PAnsiChar>(encoding <> Nil, encoding, '')]);
+    Exit;
+  end;
+
+  size := strlen(inp) + 1;
+  out_size := size * 2 - 1;
+  Result := xmlCharPtr(xmlMalloc(out_size));
+
+  if Result <> nil then
+  begin
+    temp := size - 1;
+    ret := handler^.input(Result, @out_size, inp, @temp);
+    if (ret < 0) or (temp - size + 1 <> 0) then
+    begin
+      if ret < 0 then
+        printfn('ConvertInput: conversion wasn''t successful.')
+      else
+        printfn('ConvertInput: conversion wasn''t successful. converted: %i octets.',
+          [temp]);
+
+      xmlFree(Result);
+      Result := Nil;
+    end else
+    begin
+      Result := xmlCharPtr(xmlRealloc(Result, out_size + 1));
+      Result[out_size] := #0;  (*null terminating out *)
+    end;
+  end else
+    printf('ConvertInput: no mem');
+end;
+
+(**
+ * testXmlwriterFilename:
+ * @uri: the output URI
+ *
+ * test the xmlWriter interface when writing to a new file
+ *)
+procedure testXmlwriterFilename(const uri: PAnsiChar);
+var
+  rc: cint;
+  writer: xmlTextWriterPtr;
+  tmp: xmlCharPtr;
+begin
+  (* Create a new XmlWriter for uri, with no compression. *)
+  writer := xmlNewTextWriterFilename(uri, 0);
+  if writer = Nil then
+  begin
+    printfn('testXmlwriterFilename: Error creating the xml writer');
+    Exit;
+  end;
+
+  (* Start the document with the xml default for the version,
+   * encoding ISO 8859-1 and the default for the standalone
+   * declaration. *)
+  rc := xmlTextWriterStartDocument(writer, Nil, MY_ENCODING, Nil);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartDocument');
+    Exit;
+  end;
+
+  (* Start an element named "EXAMPLE". Since thist is the first
+   * element, this will be the root element of the document. *)
+  rc := xmlTextWriterStartElement(writer, 'EXAMPLE');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write a comment as child of EXAMPLE.
+   * Please observe, that the input to the xmlTextWriter functions
+   * HAS to be in UTF-8, even if the output XML is encoded
+   * in iso-8859-1 *)
+  tmp := ConvertInput('This is a comment with special chars: <'#$E4#$F6#$FC'>',
+    MY_ENCODING);
+  rc := xmlTextWriterWriteComment(writer, tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named "ORDER" as child of EXAMPLE. *)
+  rc := xmlTextWriterStartElement(writer, 'ORDER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Add an attribute with name "version" and value "1.0" to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'version', '1.0');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Add an attribute with name "xml:lang" and value "de" to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'xml:lang', 'de');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Write a comment as child of ORDER *)
+  tmp := ConvertInput('<'#$E4#$F6#$FC'>', MY_ENCODING);
+  rc := xmlTextWriterWriteFormatComment(writer,
+    'This is another comment with special chars: %s', [tmp]);
+  if (rc < 0) then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteFormatComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named "HEADER" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'HEADER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "X_ORDER_ID" as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'X_ORDER_ID', '%010d', [53535]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named "CUSTOMER_ID" as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'CUSTOMER_ID', '%d', [1010]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named "NAME_1" as child of HEADER. *)
+  tmp := ConvertInput('M'#$FC'ller', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_1', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Write an element named "NAME_2" as child of HEADER. *)
+  tmp := ConvertInput('J'#$F6'rg', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_2', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Close the element named HEADER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRIES" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRIES');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRY" as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "ARTICLE" as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named "ENTRY_NO" as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [10]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRY" as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "ARTICLE" as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test 2>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named "ENTRY_NO" as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [20]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRIES. *)
+  rc := xmlTextWriterEndElement(writer);
+  if (rc < 0) then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "FOOTER" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'FOOTER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "TEXT" as child of FOOTER. *)
+  rc := xmlTextWriterWriteElement(writer, 'TEXT', 'This is a text.');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Close the element named FOOTER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Here we could close the elements ORDER and EXAMPLE using the
+   * function xmlTextWriterEndElement, but since we do not want to
+   * write any other elements, we simply call xmlTextWriterEndDocument,
+   * which will do all the work. *)
+  rc := xmlTextWriterEndDocument(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterFilename: Error at xmlTextWriterEndDocument');
+    Exit;
+  end;
+
+  xmlFreeTextWriter(writer);
+end;
+
+(**
+ * testXmlwriterMemory:
+ * @file: the output file
+ *
+ * test the xmlWriter interface when writing to memory
+ *)
+procedure testXmlwriterMemory(const _file: PAnsiChar);
+var
+  rc: cint;
+  writer: xmlTextWriterPtr;
+  buf: xmlBufferPtr;
+  tmp: xmlCharPtr;
+  fp: THandle;
+begin
+  (* Create a new XML buffer, to which the XML document will be
+   * written *)
+  buf := xmlBufferCreate();
+  if buf = Nil then
+  begin
+    printfn('testXmlwriterMemory: Error creating the xml buffer');
+    Exit;
+  end;
+
+  (* Create a new XmlWriter for memory, with no compression.
+   * Remark: there is no compression for this kind of xmlTextWriter *)
+  writer := xmlNewTextWriterMemory(buf, 0);
+  if writer = Nil then
+  begin
+    printfn('testXmlwriterMemory: Error creating the xml writer');
+    Exit;
+  end;
+
+  (* Start the document with the xml default for the version,
+   * encoding ISO 8859-1 and the default for the standalone
+   * declaration. *)
+  rc := xmlTextWriterStartDocument(writer, Nil, MY_ENCODING, Nil);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartDocument');
+    Exit;
+  end;
+
+  (* Start an element named "EXAMPLE". Since thist is the first
+   * element, this will be the root element of the document. *)
+  rc := xmlTextWriterStartElement(writer, 'EXAMPLE');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write a comment as child of EXAMPLE.
+   * Please observe, that the input to the xmlTextWriter functions
+   * HAS to be in UTF-8, even if the output XML is encoded
+   * in iso-8859-1 *)
+  tmp := ConvertInput('This is a comment with special chars: <'#$E4#$F6#$FC'>',
+    MY_ENCODING);
+  rc := xmlTextWriterWriteComment(writer, tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named "ORDER" as child of EXAMPLE. *)
+  rc := xmlTextWriterStartElement(writer, 'ORDER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Add an attribute with name "version" and value "1.0" to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'version', '1.0');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Add an attribute with name "xml:lang" and value "de" to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'xml:lang', 'de');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Write a comment as child of ORDER *)
+  tmp := ConvertInput('<'#$E4#$F6#$FC'>', MY_ENCODING);
+  rc := xmlTextWriterWriteFormatComment(writer,
+    'This is another comment with special chars: %s', [tmp]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteFormatComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named "HEADER" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'HEADER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement\n');
+    Exit;
+  end;
+
+  (* Write an element named "X_ORDER_ID" as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'X_ORDER_ID', '%010d', [53535]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named "CUSTOMER_ID" as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'CUSTOMER_ID', '%d', [1010]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement\n');
+    Exit;
+  end;
+
+  (* Write an element named "NAME_1" as child of HEADER. *)
+  tmp := ConvertInput('M'#$FC'ller', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_1', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Write an element named "NAME_2" as child of HEADER. *)
+  tmp := ConvertInput('J'#$F6'rg', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_2', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Close the element named HEADER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRIES" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRIES');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRY" as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "ARTICLE" as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named "ENTRY_NO" as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [10]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "ENTRY" as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "ARTICLE" as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test 2>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteElement\n');
+    Exit;
+  end;
+
+  (* Write an element named "ENTRY_NO" as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [20]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRIES. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named "FOOTER" as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'FOOTER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named "TEXT" as child of FOOTER. *)
+  rc := xmlTextWriterWriteElement(writer, 'TEXT', 'This is a text.');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Close the element named FOOTER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Here we could close the elements ORDER and EXAMPLE using the
+   * function xmlTextWriterEndElement, but since we do not want to
+   * write any other elements, we simply call xmlTextWriterEndDocument,
+   * which will do all the work. *)
+  rc := xmlTextWriterEndDocument(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterMemory: Error at xmlTextWriterEndDocument');
+    Exit;
+  end;
+
+  xmlFreeTextWriter(writer);
+
+  fp := FileCreate(_file);
+  FileWrite(fp, buf^.content^, strlen(buf^.content));
+  FileClose(fp);
+
+  xmlBufferFree(buf);
+end;
+
+(**
+ * testXmlwriterDoc:
+ * @file: the output file
+ *
+ * test the xmlWriter interface when creating a new document
+ *)
+procedure testXmlwriterDoc(const _file: PAnsiChar);
+var
+  rc: cint;
+  writer: xmlTextWriterPtr;
+  tmp: xmlCharPtr;
+  doc: xmlDocPtr;
+begin
+  (* Create a new XmlWriter for DOM, with no compression. *)
+  writer := xmlNewTextWriterDoc(doc, 0);
+  if writer = Nil then
+  begin
+    printfn('testXmlwriterDoc: Error creating the xml writer');
+    Exit;
+  end;
+
+  (* Start the document with the xml default for the version,
+   * encoding ISO 8859-1 and the default for the standalone
+   * declaration. *)
+  rc := xmlTextWriterStartDocument(writer, Nil, MY_ENCODING, Nil);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartDocument');
+    Exit;
+  end;
+
+  (* Start an element named 'EXAMPLE'. Since thist is the first
+   * element, this will be the root element of the document. *)
+  rc := xmlTextWriterStartElement(writer, 'EXAMPLE');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write a comment as child of EXAMPLE.
+   * Please observe, that the input to the xmlTextWriter functions
+   * HAS to be in UTF-8, even if the output XML is encoded
+   * in iso-8859-1 *)
+  tmp := ConvertInput('This is a comment with special chars: <'#$E4#$F6#$FC'>',
+    MY_ENCODING);
+  rc := xmlTextWriterWriteComment(writer, tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named 'ORDER' as child of EXAMPLE. *)
+  rc := xmlTextWriterStartElement(writer, 'ORDER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Add an attribute with name 'version' and value '1.0' to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'version', '1.0');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Add an attribute with name 'xml:lang' and value 'de' to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'xml:lang', 'de');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Write a comment as child of ORDER *)
+  tmp := ConvertInput('<'#$E4#$F6#$FC'>', MY_ENCODING);
+  rc := xmlTextWriterWriteFormatComment(writer,
+    'This is another comment with special chars: %s', [tmp]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteFormatComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named 'HEADER' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'HEADER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'X_ORDER_ID' as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'X_ORDER_ID', '%010d', [53535]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named 'CUSTOMER_ID' as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'CUSTOMER_ID', '%d', [1010]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named 'NAME_1' as child of HEADER. *)
+  tmp := ConvertInput('M'#$FC'ller', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_1', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Write an element named 'NAME_2' as child of HEADER. *)
+  tmp := ConvertInput('J'#$F6'rg', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_2', tmp);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Close the element named HEADER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRIES' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRIES');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRY' as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ARTICLE' as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ENTRY_NO' as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [10]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRY' as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ARTICLE' as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test 2>');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ENTRY_NO' as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [20]);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRIES. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'FOOTER' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'FOOTER');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'TEXT' as child of FOOTER. *)
+  rc := xmlTextWriterWriteElement(writer, 'TEXT', 'This is a text.');
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Close the element named FOOTER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Here we could close the elements ORDER and EXAMPLE using the
+   * function xmlTextWriterEndElement, but since we do not want to
+   * write any other elements, we simply call xmlTextWriterEndDocument,
+   * which will do all the work. *)
+  rc := xmlTextWriterEndDocument(writer);
+  if rc < 0 then
+  begin
+    printfn('testXmlwriterDoc: Error at xmlTextWriterEndDocument');
+    Exit;
+  end;
+
+  xmlFreeTextWriter(writer);
+
+  xmlSaveFileEnc(_file, doc, MY_ENCODING);
+
+  xmlFreeDoc(doc);
+end;
+
+(**
+ * testXmlwriterTree:
+ * @file: the output file
+ *
+ * test the xmlWriter interface when writing to a subtree
+ *)
+procedure testXmlwriterTree(const _file: PAnsiChar);
+var
+  rc: cint;
+  writer: xmlTextWriterPtr;
+  doc: xmlDocPtr;
+  node: xmlNodePtr;
+  tmp: xmlCharPtr;
+begin
+  (* Create a new XML DOM tree, to which the XML document will be
+   * written *)
+  doc := xmlNewDoc(XML_DEFAULT_VERSION);
+  if doc = Nil then
+  begin
+    printf('testXmlwriterTree: Error creating the xml document tree');
+    Exit;
+  end;
+
+  (* Create a new XML node, to which the XML document will be
+   * appended *)
+  node := xmlNewDocNode(doc, Nil, 'EXAMPLE', Nil);
+  if node = Nil then
+  begin
+    printf('testXmlwriterTree: Error creating the xml node');
+    Exit;
+  end;
+
+  (* Make ELEMENT the root node of the tree *)
+  xmlDocSetRootElement(doc, node);
+
+  (* Create a new XmlWriter for DOM tree, with no compression. *)
+  writer := xmlNewTextWriterTree(doc, node, 0);
+  if writer = Nil then
+  begin
+    printf('testXmlwriterTree: Error creating the xml writer');
+    Exit;
+  end;
+
+  (* Start the document with the xml default for the version,
+   * encoding ISO 8859-1 and the default for the standalone
+   * declaration. *)
+  rc := xmlTextWriterStartDocument(writer, Nil, MY_ENCODING, Nil);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartDocument');
+    Exit;
+  end;
+
+  (* Write a comment as child of EXAMPLE.
+   * Please observe, that the input to the xmlTextWriter functions
+   * HAS to be in UTF-8, even if the output XML is encoded
+   * in iso-8859-1 *)
+  tmp := ConvertInput('This is a comment with special chars: <'#$E4#$F6#$FC'>',
+    MY_ENCODING);
+  rc := xmlTextWriterWriteComment(writer, tmp);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named 'ORDER' as child of EXAMPLE. *)
+  rc := xmlTextWriterStartElement(writer, 'ORDER');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Add an attribute with name 'version' and value '1.0' to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'version', '1.0');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Add an attribute with name 'xml:lang' and value 'de' to ORDER. *)
+  rc := xmlTextWriterWriteAttribute(writer, 'xml:lang', 'de');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteAttribute');
+    Exit;
+  end;
+
+  (* Write a comment as child of ORDER *)
+  tmp := ConvertInput('<'#$E4#$F6#$FC'>', MY_ENCODING);
+  rc := xmlTextWriterWriteFormatComment(writer,
+    'This is another comment with special chars: %s', [tmp]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteFormatComment');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Start an element named 'HEADER' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'HEADER');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'X_ORDER_ID' as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'X_ORDER_ID', '%010d', [53535]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named 'CUSTOMER_ID' as child of HEADER. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'CUSTOMER_ID', '%d', [1010]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Write an element named 'NAME_1' as child of HEADER. *)
+  tmp := ConvertInput('M'#$FC'ller', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_1', tmp);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Write an element named 'NAME_2' as child of HEADER. *)
+  tmp := ConvertInput('J'#$F6'rg', MY_ENCODING);
+  rc := xmlTextWriterWriteElement(writer, 'NAME_2', tmp);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+  if tmp <> Nil then
+    xmlFree(tmp);
+
+  (* Close the element named HEADER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRIES' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRIES');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRY' as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ARTICLE' as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test>');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ENTRY_NO' as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [10]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'ENTRY' as child of ENTRIES. *)
+  rc := xmlTextWriterStartElement(writer, 'ENTRY');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ARTICLE' as child of ENTRY. *)
+  rc := xmlTextWriterWriteElement(writer, 'ARTICLE', '<Test 2>');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Write an element named 'ENTRY_NO' as child of ENTRY. *)
+  rc := xmlTextWriterWriteFormatElement(writer, 'ENTRY_NO', '%d', [20]);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteFormatElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRY. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Close the element named ENTRIES. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Start an element named 'FOOTER' as child of ORDER. *)
+  rc := xmlTextWriterStartElement(writer, 'FOOTER');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterStartElement');
+    Exit;
+  end;
+
+  (* Write an element named 'TEXT' as child of FOOTER. *)
+  rc := xmlTextWriterWriteElement(writer, 'TEXT', 'This is a text.');
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterWriteElement');
+    Exit;
+  end;
+
+  (* Close the element named FOOTER. *)
+  rc := xmlTextWriterEndElement(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndElement');
+    Exit;
+  end;
+
+  (* Here we could close the elements ORDER and EXAMPLE using the
+   * function xmlTextWriterEndElement, but since we do not want to
+   * write any other elements, we simply call xmlTextWriterEndDocument,
+   * which will do all the work. *)
+  rc := xmlTextWriterEndDocument(writer);
+  if rc < 0 then
+  begin
+    printf('testXmlwriterTree: Error at xmlTextWriterEndDocument');
+    Exit;
+  end;
+
+  xmlFreeTextWriter(writer);
+
+  xmlSaveFileEnc(_file, doc, MY_ENCODING);
+
+  xmlFreeDoc(doc);
+end;
+
+
+begin
+  (*
+   * this initialize the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+  LIBXML_TEST_VERSION;
+
+  (* first, the file version *)
+  testXmlwriterFilename('writer1.tmp');
+
+  (* next, the memory version *)
+  testXmlwriterMemory('writer2.tmp');
+
+  (* next, the DOM version *)
+  testXmlwriterDoc('writer3.tmp');
+
+  (* next, the tree version *)
+  testXmlwriterTree('writer4.tmp');
+
+  (*
+   * Cleanup function for the XML library.
+   *)
+  xmlCleanupParser();
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.
+

+ 257 - 0
packages/libxml/examples/xpath1.pas

@@ -0,0 +1,257 @@
+(**
+ * section: 	XPath
+ * synopsis: 	Evaluate XPath expression and prints result node set.
+ * purpose: 	Shows how to evaluate XPath expression and register
+ *          	known namespaces in XPath context.
+ * usage:	xpath1 <xml-file> <xpath-expr> [<known-ns-list>]
+ * test:	xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res
+ * author: 	Aleksey Sanin
+ * copy: 	see Copyright for the status of this software.
+ *)
+
+program xpath1;
+
+{$mode objfpc}
+
+uses
+  ctypes,
+  xml2,
+  exutils,
+  SysUtils;
+
+(**
+ * usage:
+ * @name:		the program name.
+ *
+ * Prints usage information.
+ *)
+procedure usage(const name: String);
+begin
+  //assert(name <> '');
+
+  printfn('Usage: %s <xml-file> <xpath-expr> [<known-ns-list>]', [name]);
+  printfn('where <known-ns-list> is a list of known namespaces');
+  printfn('in "<prefix1>=<href1> <prefix2>=href2> ..." format');
+end;
+
+(**
+ * print_xpath_nodes:
+ * @nodes:		the nodes set.
+ * @output:		the output file handle.
+ *
+ * Prints the @nodes content to @output.
+ *)
+procedure print_xpath_nodes(nodes: xmlNodeSetPtr; var output: TextFile);
+var
+  cur: xmlNodePtr;
+  size: cint;
+  i: cint;
+  ns: xmlNsPtr;
+begin
+  //assert(output);
+  if nodes <> Nil then
+    size := nodes^.nodeNr
+  else
+    size := 0;
+
+  WriteLn(output, Format('Result (%d nodes):', [size]));
+  for i := 0 to size - 1 do
+  begin
+    assert(nodes^.nodeTab[i] <> Nil);
+
+    if nodes^.nodeTab[i]^._type = XML_NAMESPACE_DECL then
+    begin
+      ns := xmlNsPtr(nodes^.nodeTab[i]);
+      cur := xmlNodePtr(ns^.next);
+      if cur^.ns <> nil then
+        WriteLn(output, Format('= namespace "%s"="%s" for node %s:%s',
+          [ns^.prefix, ns^.href, cur^.ns^.href, cur^.name]))
+      else
+        WriteLn(output, Format('= namespace "%s"="%s" for node %s',
+          [ns^.prefix, ns^.href, cur^.name]));
+    end
+    else if nodes^.nodeTab[i]^._type = XML_ELEMENT_NODE then
+    begin
+      cur := nodes^.nodeTab[i];
+      if cur^.ns <> Nil then
+        WriteLn(output, Format('= element node "%s:%s"',
+          [cur^.ns^.href, cur^.name]))
+      else
+    	WriteLn(output, Format('= element node "%s"', [cur^.name]));
+    end
+    else
+    begin
+      cur := nodes^.nodeTab[i];
+      WriteLn(output, Format('= node "%s": type %d', [cur^.name, cur^._type]));
+    end;
+  end;
+end;
+
+(**
+ * register_namespaces:
+ * @xpathCtx:		the pointer to an XPath context.
+ * @nsList:		the list of known namespaces in
+ *			"<prefix1>=<href1> <prefix2>=href2> ..." format.
+ *
+ * Registers namespaces from @nsList in @xpathCtx.
+ *
+ * Returns 0 on success and a negative value otherwise.
+ *)
+function register_namespaces(xpathCtx: xmlXPathContextPtr; const nsList: xmlCharPtr): cint;
+var
+  nsListDup: xmlCharPtr;
+  prefix: xmlCharPtr;
+  href: xmlCharPtr;
+  next: xmlCharPtr;
+begin
+  assert(xpathCtx <> Nil);
+  assert(nsList <> Nil);
+
+  nsListDup := xmlStrdup(nsList);
+  if nsListDup = Nil then
+  begin
+    printfn('Error: unable to strdup namespaces list');
+    Exit(-1);
+  end;
+
+  next := nsListDup;
+  while next <> Nil do
+  begin
+    (* skip spaces *)
+    while next^ = ' ' do
+      Inc(next);
+    if next^ = #0 then
+      break;
+
+    (* find prefix *)
+    prefix := next;
+    next := xmlCharPtr(xmlStrchr(next, '='));
+    if next = Nil then
+    begin
+      printfn('Error: invalid namespaces list format');
+      xmlFree(nsListDup);
+      Exit(-1);
+    end;
+    next^ := #0;
+    Inc(next);
+
+    (* find href *)
+    href := next;
+    next := xmlCharPtr(xmlStrchr(next, ' '));
+    if next <> Nil then
+    begin
+      next^ := #0;
+      Inc(next);
+    end;
+
+    (* do register namespace *)
+    if xmlXPathRegisterNs(xpathCtx, prefix, href) <> 0 then
+    begin
+      printfn('Error: unable to register NS with prefix="%s" and href="%s"', [prefix, href]);
+      xmlFree(nsListDup);
+      Exit(-1);
+    end;
+  end;
+
+  xmlFree(nsListDup);
+  Result := 0;
+end;
+
+(**
+ * execute_xpath_expression:
+ * @filename:		the input XML filename.
+ * @xpathExpr:		the xpath expression for evaluation.
+ * @nsList:		the optional list of known namespaces in
+ *			"<prefix1>=<href1> <prefix2>=href2> ..." format.
+ *
+ * Parses input XML file, evaluates XPath expression and prints results.
+ *
+ * Returns 0 on success and a negative value otherwise.
+ *)
+function execute_xpath_expression(const filename: PAnsiChar; const xpathExpr, nsList: xmlCharPtr): cint;
+var
+  doc: xmlDocPtr;
+  xpathCtx: xmlXPathContextPtr;
+  xpathObj: xmlXPathObjectPtr;
+begin
+
+  assert(filename <> Nil);
+  assert(xpathExpr <> Nil);
+
+  (* Load XML document *)
+  doc := xmlParseFile(filename);
+  if doc = Nil then
+  begin
+    printfn('Error: unable to parse file "%s"', [filename]);
+    Exit(-1);
+  end;
+
+  (* Create xpath evaluation context *)
+  xpathCtx := xmlXPathNewContext(doc);
+  if xpathCtx = Nil then
+  begin
+    printfn('Error: unable to create new XPath context');
+    xmlFreeDoc(doc);
+    Exit(-1);
+  end;
+
+  (* Register namespaces from list (if any) *)
+  if (nsList <> Nil) and (register_namespaces(xpathCtx, nsList) < 0) then
+  begin
+    printfn('Error: failed to register namespaces list "%s"', [nsList]);
+    xmlXPathFreeContext(xpathCtx);
+    xmlFreeDoc(doc);
+    Exit(-1);
+  end;
+
+  (* Evaluate xpath expression *)
+  xpathObj := xmlXPathEvalExpression(xpathExpr, xpathCtx);
+  if xpathObj = Nil then
+  begin
+    printfn('Error: unable to evaluate xpath expression "%s"', [xpathExpr]);
+    xmlXPathFreeContext(xpathCtx);
+    xmlFreeDoc(doc);
+    Exit(-1);
+  end;
+
+  (* Print results *)
+  print_xpath_nodes(xpathObj^.nodesetval, StdOut);
+
+  (* Cleanup *)
+  xmlXPathFreeObject(xpathObj);
+  xmlXPathFreeContext(xpathCtx);
+  xmlFreeDoc(doc);
+
+  Result := 0;
+end;
+
+begin
+  (* Parse command line and process file *)
+  if (ParamCount < 2) or (ParamCount > 3) then
+  begin
+    printfn('Error: wrong number of arguments.');
+    usage(ParamStr(0));
+    Halt(-1);
+  end;
+
+  (* Init libxml *)
+  xmlInitParser();
+  LIBXML_TEST_VERSION;
+
+  (* Do the main job *)
+  if execute_xpath_expression(PAnsiChar(ParamStr(1)), PAnsiChar(ParamStr(2)),
+    specialize IfThen<PAnsiChar>(argc > 2, PAnsiChar(ParamStr(3)), Nil)) < 0 then
+  begin
+    usage(ParamStr(0));
+    Halt(-1);
+  end;
+
+  (* Shutdown libxml *)
+  xmlCleanupParser();
+
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.
+

+ 185 - 0
packages/libxml/examples/xpath2.pas

@@ -0,0 +1,185 @@
+(**
+ * section: 	XPath
+ * synopsis: 	Load a document, locate subelements with XPath, modify
+ *              said elements and save the resulting document.
+ * purpose: 	Shows how to make a full round-trip from a load/edit/save
+ * usage:	xpath2 <xml-file> <xpath-expr> <new-value>
+ * test:	xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res
+ * author: 	Aleksey Sanin and Daniel Veillard
+ * copy: 	see Copyright for the status of this software.
+ *)
+
+program xpath2;
+
+{$mode objfpc}
+
+uses
+  ctypes,
+  xml2,
+  exutils,
+  SysUtils;
+
+(**
+ * usage:
+ * @name:		the program name.
+ *
+ * Prints usage information.
+ *)
+procedure usage(const name: String);
+begin
+  //assert(name);
+
+  printfn('Usage: %s <xml-file> <xpath-expr> <value>', [name]);
+end;
+
+(**
+ * update_xpath_nodes:
+ * @nodes:		the nodes set.
+ * @value:		the new value for the node(s)
+ *
+ * Prints the @nodes content to @output.
+ *)
+procedure update_xpath_nodes(nodes: xmlNodeSetPtr; const value: xmlCharPtr);
+var
+  size: cint;
+  i: cint;
+begin
+  assert(value <> Nil);
+  if nodes <> nil then
+    size := nodes^.nodeNr
+  else
+    size := 0;
+
+  (*
+   * NOTE: the nodes are processed in reverse order, i.e. reverse document
+   *       order because xmlNodeSetContent can actually free up descendant
+   *       of the node and such nodes may have been selected too ! Handling
+   *       in reverse order ensure that descendant are accessed first, before
+   *       they get removed. Mixing XPath and modifications on a tree must be
+   *       done carefully !
+   *)
+  for i := size - 1 downto 0 do
+  begin
+    assert(nodes^.nodeTab[i] <> Nil);
+
+    xmlNodeSetContent(nodes^.nodeTab[i], value);
+    (*
+     * All the elements returned by an XPath query are pointers to
+     * elements from the tree *except* namespace nodes where the XPath
+     * semantic is different from the implementation in libxml2 tree.
+     * As a result when a returned node set is freed when
+     * xmlXPathFreeObject() is called, that routine must check the
+     * element type. But node from the returned set may have been removed
+     * by xmlNodeSetContent() resulting in access to freed data.
+     * This can be exercised by running
+     *       valgrind xpath2 test3.xml '//discarded' discarded
+     * There is 2 ways around it:
+     *   - make a copy of the pointers to the nodes from the result set
+     *     then call xmlXPathFreeObject() and then modify the nodes
+     * or
+     *   - remove the reference to the modified nodes from the node set
+     *     as they are processed, if they are not namespace nodes.
+     *)
+    if nodes^.nodeTab[i]^._type <> XML_NAMESPACE_DECL then
+      nodes^.nodeTab[i] := Nil;
+  end;
+end;
+
+(**
+ * example4:
+ * @filename:		the input XML filename.
+ * @xpathExpr:		the xpath expression for evaluation.
+ * @value:		the new node content.
+ *
+ * Parses input XML file, evaluates XPath expression and update the nodes
+ * then print the result.
+ *
+ * Returns 0 on success and a negative value otherwise.
+ *)
+function example4(const filename: PAnsiChar; const xpathExpr, value: xmlCharPtr): cint;
+var
+  doc: xmlDocPtr;
+  xpathCtx: xmlXPathContextPtr;
+  xpathObj: xmlXPathObjectPtr;
+  mem: xmlCharPtr;
+  memLen: Integer;
+begin
+  assert(filename <> Nil);
+  assert(xpathExpr <> Nil);
+  assert(value <> Nil);
+
+  (* Load XML document *)
+  doc := xmlParseFile(filename);
+  if doc = Nil then
+  begin
+    printfn('Error: unable to parse file "%s"', [filename]);
+    Exit(-1);
+  end;
+
+  (* Create xpath evaluation context *)
+  xpathCtx := xmlXPathNewContext(doc);
+  if xpathCtx = Nil then
+  begin
+    printfn('Error: unable to create new XPath context');
+    xmlFreeDoc(doc);
+    Exit(-1);
+  end;
+
+  (* Evaluate xpath expression *)
+  xpathObj := xmlXPathEvalExpression(xpathExpr, xpathCtx);
+  if xpathObj = Nil then
+  begin
+    printfn('Error: unable to evaluate xpath expression "%s"', [xpathExpr]);
+    xmlXPathFreeContext(xpathCtx);
+    xmlFreeDoc(doc);
+    Exit(-1);
+  end;
+
+  (* update selected nodes *)
+  update_xpath_nodes(xpathObj^.nodesetval, value);
+
+
+  (* Cleanup of XPath data *)
+  xmlXPathFreeObject(xpathObj);
+  xmlXPathFreeContext(xpathCtx);
+
+  (* dump the resulting document *)
+  xmlDocDumpMemory(doc, mem, memLen);
+  WriteLn(mem);
+  xmlFree(mem);
+
+  (* free the document *)
+  xmlFreeDoc(doc);
+
+  Result := 0;
+end;
+
+begin
+  (* Parse command line and process file *)
+  if ParamCount <> 3 then
+  begin
+    printfn('Error: wrong number of arguments.');
+    usage(ParamStr(0));
+    Halt(-1);
+  end;
+
+  (* Init libxml *)
+  xmlInitParser();
+  LIBXML_TEST_VERSION;
+
+  (* Do the main job *)
+  if example4(PAnsiChar(ParamStr(1)), PAnsiChar(ParamStr(2)), PAnsiChar(ParamStr(3))) <> 0 then
+  begin
+    usage(ParamStr(0));
+    Halt(-1);
+  end;
+
+  (* Shutdown libxml *)
+  xmlCleanupParser();
+
+  (*
+   * this is to debug memory for regression tests
+   *)
+  xmlMemoryDump();
+end.
+

+ 127 - 2
packages/libxml/fpmake.pp

@@ -18,7 +18,7 @@ begin
     P.Directory:=ADirectory;
 {$endif ALLPACKAGES}
     P.Version:='3.3.1';
-    P.OSes := [freebsd,linux,win32];
+    P.OSes := [freebsd,linux,win32,win64];
     P.SourcePath.Add('src');
     P.IncludePath.Add('src');
     P.Dependencies.Add('rtl-objpas');
@@ -26,6 +26,7 @@ begin
   T:=P.Targets.AddUnit('xml2.pas');
   with T.Dependencies do
     begin
+      AddInclude('xml2h.inc');
       AddInclude('xml2.inc');
       AddInclude('xinclude.inc');
       AddInclude('xpointer.inc');
@@ -73,6 +74,62 @@ begin
       AddInclude('xmlschemastypes.inc');
       AddInclude('c14n.inc');
       AddInclude('schematron.inc');
+      AddInclude('fpcfunctions.inc');
+      AddInclude('macros.inc');
+    end;
+
+  T:=P.Targets.AddUnit('xml2dyn.pas');
+  with T.Dependencies do
+    begin
+      AddInclude('xml2h.inc');
+      AddInclude('xml2.inc');
+      AddInclude('xinclude.inc');
+      AddInclude('xpointer.inc');
+      AddInclude('HTMLparser.inc');
+      AddInclude('schemasInternals.inc');
+      AddInclude('SAX2.inc');
+      AddInclude('xmlversion.inc');
+      AddInclude('globals.inc');
+      AddInclude('nanoftp.inc');
+      AddInclude('SAX.inc');
+      AddInclude('uri.inc');
+      AddInclude('debugXML.inc');
+      AddInclude('xmlunicode.inc');
+      AddInclude('xmlIO.inc');
+      AddInclude('xmlsave.inc');
+      AddInclude('HTMLtree.inc');
+      AddInclude('parserInternals.inc');
+      AddInclude('chvalid.inc');
+      AddInclude('xmlwriter.inc');
+      AddInclude('relaxng.inc');
+      AddInclude('threads.inc');
+      AddInclude('list.inc');
+      AddInclude('encoding.inc');
+      AddInclude('catalog.inc');
+      AddInclude('pattern.inc');
+      AddInclude('xmlregexp.inc');
+      AddInclude('xmlerror.inc');
+      AddInclude('xpath.inc');
+      AddInclude('xmlautomata.inc');
+      AddInclude('entities.inc');
+      AddInclude('xmlreader.inc');
+      AddInclude('xmlstring.inc');
+      AddInclude('xmlmemory.inc');
+      AddInclude('xmlmodule.inc');
+      AddInclude('xmlschemas.inc');
+      AddInclude('hash.inc');
+      AddInclude('nanohttp.inc');
+      AddInclude('libxmlparser.inc');
+      AddInclude('tree.inc');
+      AddInclude('dict.inc');
+      AddInclude('xlink.inc');
+      AddInclude('valid.inc');
+      AddInclude('xpathInternals.inc');
+      AddInclude('xmlschemastypes.inc');
+      AddInclude('c14n.inc');
+      AddInclude('schematron.inc');
+      AddInclude('fpcfunctions.inc');
+      AddInclude('macros.inc');
     end;
 
   T:=P.Targets.AddUnit('xmlxsdparser.pas');
@@ -81,14 +138,82 @@ begin
   T:=P.Targets.AddUnit('xmlxsd.pas');
   T.ResourceStrings := True;
 
+  T:=P.Targets.AddUnit('xslt.pas');
+  with T.Dependencies do
+    begin
+      AddInclude('xsltlocale.inc');
+      AddInclude('xsltInternals.inc');
+      AddInclude('xslt_item_common_fields.inc');
+      AddInclude('xsltpattern.inc');
+      AddInclude('numbersInternals.inc');
+      AddInclude('documents.inc');
+      AddInclude('extensions.inc');
+      AddInclude('security.inc');
+      AddInclude('xsltutils.inc');
+      AddInclude('extra.inc');
+      AddInclude('keys.inc');
+      AddInclude('namespaces.inc');
+      AddInclude('variables.inc');
+      AddInclude('xslt.inc');
+      AddInclude('xsltconfig.inc');
+      AddInclude('attributes.inc');
+      AddInclude('functions.inc');
+      AddInclude('imports.inc');
+      AddInclude('preproc.inc');
+      AddInclude('templates.inc');
+      AddInclude('transform.inc');
+    end;
+
+  T:=P.Targets.AddUnit('xsltdyn.pas');
+  with T.Dependencies do
+    begin
+      AddInclude('xsltlocale.inc');
+      AddInclude('xsltInternals.inc');
+      AddInclude('xslt_item_common_fields.inc');
+      AddInclude('xsltpattern.inc');
+      AddInclude('numbersInternals.inc');
+      AddInclude('documents.inc');
+      AddInclude('extensions.inc');
+      AddInclude('security.inc');
+      AddInclude('xsltutils.inc');
+      AddInclude('extra.inc');
+      AddInclude('keys.inc');
+      AddInclude('namespaces.inc');
+      AddInclude('variables.inc');
+      AddInclude('xslt.inc');
+      AddInclude('xsltconfig.inc');
+      AddInclude('attributes.inc');
+      AddInclude('functions.inc');
+      AddInclude('imports.inc');
+      AddInclude('preproc.inc');
+      AddInclude('templates.inc');
+      AddInclude('transform.inc');
+    end;
+
+  T:=P.Targets.AddUnit('exslt.pas');
+  with T.Dependencies do
+    AddInclude('exslt.inc');
+
+  T:=P.Targets.AddUnit('exsltdyn.pas');
+  with T.Dependencies do
+    AddInclude('exslt.inc');
+
     P.ExamplePath.Add('examples');
     P.Targets.AddExampleProgram('reader1.pas');
+    P.Targets.AddExampleProgram('reader2.pas');
     P.Targets.AddExampleProgram('io2.pas');
     P.Targets.AddExampleProgram('io1.pas');
     P.Targets.AddExampleProgram('tree1.pas');
     P.Targets.AddExampleProgram('tree2.pas');
-    P.Targets.AddExampleProgram('exutils.pas');
     P.Targets.AddExampleProgram('reader2.pas');
+    P.Targets.AddExampleProgram('parse1.pas');
+    P.Targets.AddExampleProgram('parse2.pas');
+    P.Targets.AddExampleProgram('parse3.pas');
+    P.Targets.AddExampleProgram('parse4.pas');
+    P.Targets.AddExampleProgram('testWriter.pas');
+    P.Targets.AddExampleProgram('xpath1.pas');
+    P.Targets.AddExampleProgram('xpath2.pas');
+    P.Targets.AddExampleUnit('exutils.pas');
     P.Sources.AddExampleFiles('examples/*',P.Directory,false,'.');
 
 

+ 3 - 0
packages/libxml/namespaced/Api.XML.Exslt.pas

@@ -0,0 +1,3 @@
+unit Api.XML.Exslt;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i exslt.pas}

+ 3 - 0
packages/libxml/namespaced/Api.XML.ExsltDyn.pas

@@ -0,0 +1,3 @@
+unit Api.XML.ExsltDyn;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i exsltdyn.pas}

+ 3 - 0
packages/libxml/namespaced/Api.XML.Xml2Dyn.pas

@@ -0,0 +1,3 @@
+unit Api.XML.Xml2Dyn;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i xml2dyn.pas}

+ 3 - 0
packages/libxml/namespaced/Api.XML.Xslt.pas

@@ -0,0 +1,3 @@
+unit Api.XML.Xslt;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i xslt.pas}

+ 3 - 0
packages/libxml/namespaced/Api.XML.XsltDyn.pas

@@ -0,0 +1,3 @@
+unit Api.XML.XsltDyn;
+{$DEFINE FPC_DOTTEDUNITS}
+{$i xsltdyn.pas}

+ 5 - 0
packages/libxml/namespaces.lst

@@ -2,4 +2,9 @@ src/xmlxsdparser.pas=namespaced/Api.XML.Xsdparser.pas
 {s*:src/}=namespaced/
 {i+:src/}
 src/xml2.pas=namespaced/Api.XML.Xml2.pas
+src/xml2dyn.pas=namespaced/Api.XML.Xml2Dyn.pas
 src/xmlxsd.pas=namespaced/Api.XML.Xsd.pas
+src/xslt.pas=namespaced/Api.XML.Xslt.pas
+src/xsltdyn.pas=namespaced/Api.XML.XsltDyn.pas
+src/exslt.pas=namespaced/Api.XML.Exslt.pas
+src/exsltdyn.pas=namespaced/Api.XML.ExsltDyn.pas

+ 76 - 9
packages/libxml/src/HTMLparser.inc

@@ -111,6 +111,43 @@ function htmlParseChunk(ctxt: htmlParserCtxtPtr; chunk: PAnsiChar; size, termina
 procedure htmlFreeParserCtxt(ctxt: htmlParserCtxtPtr); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * There is only few public functions.
+ *)
+  htmlTagLookup: function(tag: xmlCharPtr): htmlElemDescPtr; EXTDECL;
+  htmlEntityLookup: function(tag: xmlCharPtr): htmlEntityDescPtr; EXTDECL;
+  htmlEntityValueLookup: function(value: cuint): htmlEntityDescPtr; EXTDECL;
+
+  htmlIsAutoClosed: function(doc: htmlDocPtr; elem: htmlNodePtr): cint; EXTDECL;
+  htmlAutoCloseTag: function(doc: htmlDocPtr; name: xmlCharPtr; elem: htmlNodePtr): cint; EXTDECL;
+  htmlParseEntityRef: function(ctxt: htmlParserCtxtPtr; str: xmlCharPtrPtr): htmlEntityDescPtr; EXTDECL;
+
+  htmlParseCharRef: function(ctxt: htmlParserCtxtPtr): cint; EXTDECL;
+  htmlParseElement: function(ctxt: htmlParserCtxtPtr): cint; EXTDECL;
+  htmlNewParserCtxt: function: htmlParserCtxtPtr; EXTDECL;
+  htmlCreateMemoryParserCtxt: function(buffer: PAnsiChar; size: cint): htmlParserCtxtPtr; EXTDECL;
+
+  htmlParseDocument: function(doc: htmlDocPtr; elem: htmlNodePtr): cint; EXTDECL;
+  htmlSAXParseDoc: function(cur: xmlCharPtr; encoding: PAnsiChar; sax: htmlSAXHandlerPtr; userdata: pointer): htmlDocPtr; EXTDECL;
+  htmlParseDoc: function(cur: xmlCharPtr; encoding: PAnsiChar): htmlDocPtr; EXTDECL;
+  htmlSAXParseFile: function(filename, encoding: PAnsiChar; sax: htmlSAXHandlerPtr; userdata: pointer): htmlDocPtr; EXTDECL;
+  htmlParseFile: function(filename, encoding: PAnsiChar): htmlDocPtr; EXTDECL;
+  UTF8ToHtml: function(_out: pointer; outlen: cint; _in: pointer; inlen: cint): cint; EXTDECL;
+  htmlEncodeEntities: function(_out: pointer; outlen: cint; _in: pointer; inlen, quoteChar: cint): cint; EXTDECL;
+  htmlIsScriptAttribute: function(name: xmlCharPtr): cint; EXTDECL;
+  htmlHandleOmittedElem: function(val: cint): cint; EXTDECL;
+
+{$IFDEF LIBXML_PUSH_ENABLED}
+(**
+ * Interfaces for the Push mode.
+ *)
+  htmlCreatePushParserCtxt: function(sax: htmlSAXHandlerPtr; userdata: pointer; chunk: PAnsiChar; size: cint; filename: PAnsiChar; enc: xmlCharEncoding): htmlParserCtxtPtr; EXTDECL;
+  htmlParseChunk: function(ctxt: htmlParserCtxtPtr; chunk: PAnsiChar; size, terminate: cint): htmlParserCtxtPtr; EXTDECL;
+{$ENDIF} (* LIBXML_PUSH_ENABLED *)
+  htmlFreeParserCtxt: procedure(ctxt: htmlParserCtxtPtr); EXTDECL;
+{$ENDIF}
+
 {$IFDEF TYPE}
   htmlParserOption = type cint;
 {$ENDIF}
@@ -124,18 +161,21 @@ procedure htmlFreeParserCtxt(ctxt: htmlParserCtxtPtr); EXTDECL; external xml2lib
  * This is the set of XML parser options that can be passed down
  * to the xmlReadDoc() and similar calls.
  *)
-  HTML_PARSE_RECOVER  = 1 shl 0; (* Relaxed parsing *)
-  HTML_PARSE_NOERROR	= 1 shl 5;	(* suppress error reports *)
-  HTML_PARSE_NOWARNING= 1 shl 6;	(* suppress warning reports *)
-  HTML_PARSE_PEDANTIC	= 1 shl 7;	(* pedantic error reporting *)
-  HTML_PARSE_NOBLANKS	= 1 shl 8;	(* remove blank nodes *)
-  HTML_PARSE_NONET	= 1 shl 11;(* Forbid network access *)
-  HTML_PARSE_COMPACT  = 1 shl 16; (* compact small text nodes *)
+  HTML_PARSE_RECOVER    = (1 shl 0); (* Relaxed parsing *)
+  HTML_PARSE_NODEFDTD   = (1 shl 2); (* do not default a doctype if not found *)
+  HTML_PARSE_NOERROR    = (1 shl 5); (* suppress error reports *)
+  HTML_PARSE_NOWARNING  = (1 shl 6); (* suppress warning reports *)
+  HTML_PARSE_PEDANTIC	= (1 shl 7); (* pedantic error reporting *)
+  HTML_PARSE_NOBLANKS	= (1 shl 8); (* remove blank nodes *)
+  HTML_PARSE_NONET	= (1 shl 11);(* Forbid network access *)
+  HTML_PARSE_NOIMPLIED  = (1 shl 13);(* Do not add implied html/body... elements *)
+  HTML_PARSE_COMPACT    = (1 shl 16);(* compact small text nodes *)
+  HTML_PARSE_IGNORE_ENC = (1 shl 21);(* ignore internal document encoding hint *)
 {$ENDIF}
 
 {$IFDEF FUNCTION}
 procedure htmlCtxtReset(ctxt: htmlParserCtxtPtr); EXTDECL; external xml2lib;
-function htmlParseChunk(ctxt: htmlParserCtxtPtr; options: cint): cint; EXTDECL; external xml2lib;
+function htmlCtxtUseOptions(ctxt: htmlParserCtxtPtr; options: cint): cint; EXTDECL; external xml2lib;
 function htmlReadDoc(cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL; external xml2lib;
 function htmlReadFile(URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL; external xml2lib;
 function htmlReadMemory(buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL; external xml2lib;
@@ -148,6 +188,21 @@ function htmlCtxtReadFd(ctxt: xmlParserCtxtPtr; fd: cint; URL, encoding: PAnsiCh
 function htmlCtxtReadIO(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  htmlCtxtReset: procedure(ctxt: htmlParserCtxtPtr); EXTDECL;
+  htmlCtxtUseOptions: function(ctxt: htmlParserCtxtPtr; options: cint): cint; EXTDECL;
+  htmlReadDoc: function(cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlReadFile: function(URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlReadMemory: function(buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlReadFd: function(fd: cint; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlReadIO: function(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlCtxtReadDoc: function(ctxt: xmlParserCtxtPtr; cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlCtxtReadFile: function(ctxt: xmlParserCtxtPtr; filename, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlCtxtReadMemory: function(ctxt: xmlParserCtxtPtr; buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlCtxtReadFd: function(ctxt: xmlParserCtxtPtr; fd: cint; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+  htmlCtxtReadIO: function(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): htmlDocPtr; EXTDECL;
+{$ENDIF}
+
 {$IFDEF TYPE}
   htmlStatus = type cint;
 {$ENDIF}
@@ -167,9 +222,21 @@ function htmlCtxtReadIO(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; io
 *)
 function htmlAttrAllowed(desc: htmlElemDescPtr; str: xmlCharPtr; val: cint): htmlStatus; EXTDECL; external xml2lib;
 function htmlElementAllowedHere(desc: htmlElemDescPtr; str: xmlCharPtr): cint; EXTDECL; external xml2lib;
-function htmlAttrAllowed(desc1, desc2: htmlElemDescPtr): htmlStatus; EXTDECL; external xml2lib;
+function htmlElementStatusHere(desc1, desc2: htmlElemDescPtr): htmlStatus; EXTDECL; external xml2lib;
 function htmlNodeStatus(node: htmlNodePtr; val: cint): htmlStatus; EXTDECL; external xml2lib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(* Using htmlElemDesc rather than name here, to emphasise the fact
+   that otherwise there's a lookup overhead
+*)
+  htmlAttrAllowed: function(desc: htmlElemDescPtr; str: xmlCharPtr; val: cint): htmlStatus; EXTDECL;
+  htmlElementAllowedHere: function(desc: htmlElemDescPtr; str: xmlCharPtr): cint; EXTDECL;
+  htmlElementStatusHere: function(desc1, desc2: htmlElemDescPtr): htmlStatus; EXTDECL;
+  htmlNodeStatus: function(node: htmlNodePtr; val: cint): htmlStatus; EXTDECL;
+{$ENDIF}
 
+{$IFDEF MACRO}
 (**
  * htmlDefaultSubelement:
  * @elt: HTML element

+ 23 - 0
packages/libxml/src/HTMLtree.inc

@@ -71,4 +71,27 @@ procedure htmlNodeDumpOutput(buf: xmlOutputBufferPtr; doc: xmlDocPtr; cur: xmlNo
 function htmlIsBooleanAttr(name: xmlCharPtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  htmlNewDoc: function(URI, ExternalID: xmlCharPtr): htmlDocPtr; EXTDECL;
+  htmlNewDocNoDtD: function(URI, ExternalID: xmlCharPtr): htmlDocPtr; EXTDECL;
+  htmlGetMetaEncoding: function(doc: htmlDocPtr): xmlCharPtr; EXTDECL;
+  htmlSetMetaEncoding: function(doc: htmlDocPtr; encoding: xmlCharPtr): cint; EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  htmlDocDumpMemory: procedure(cur: xmlDocPtr; mem: xmlCharPtrPtr; size: pcint); EXTDECL;
+  htmlDocDumpMemoryFormat: procedure(cur: xmlDocPtr; mem: xmlCharPtrPtr; size: pcint; format: cint); EXTDECL;
+  htmlDocDump: procedure(f: PFILE; cur: xmlDocPtr); EXTDECL;
+  htmlSaveFile: function(filename: PAnsiChar; doc: htmlDocPtr): cint; EXTDECL;
+  htmlNodeDump: function(buf: xmlBufferPtr; doc: htmlDocPtr; cur: xmlNodePtr): cint; EXTDECL;
+  htmlNodeDumpFile: procedure(_out: PFILE; doc: xmlDocPtr; cur: xmlNodePtr); EXTDECL;
+  htmlNodeDumpFileFormat: function(_out: PFILE; doc: htmlDocPtr; cur: xmlNodePtr; encoding: PAnsiChar; format: cint): cint; EXTDECL;
+  htmlSaveFileEnc: function(filename: PAnsiChar; cur: htmlDocPtr; encoding: PAnsiChar): cint; EXTDECL;
+  htmlSaveFileFormat: function(filename: PAnsiChar; cur: htmlDocPtr; encoding: PAnsiChar; format: cint): cint; EXTDECL;
+  htmlNodeDumpFormatOutput: procedure(buf: xmlOutputBufferPtr; doc: xmlDocPtr; cur: xmlNodePtr; encoding: PAnsiChar; format: cint); EXTDECL;
+  htmlDocContentDumpOutput: procedure(buf: xmlOutputBufferPtr; cur: xmlNodePtr; encoding: PAnsiChar); EXTDECL;
+  htmlDocContentDumpFormatOutput: procedure(buf: xmlOutputBufferPtr; cur: xmlNodePtr; encoding: PAnsiChar; format: cint); EXTDECL;
+  htmlNodeDumpOutput: procedure(buf: xmlOutputBufferPtr; doc: xmlDocPtr; cur: xmlNodePtr; encoding: PAnsiChar); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  htmlIsBooleanAttr: function(name: xmlCharPtr): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_HTML_ENABLED *)

+ 52 - 0
packages/libxml/src/SAX.inc

@@ -62,4 +62,56 @@ procedure initdocbDefaultSAXHandler(hdlr: xmlSAXHandlerV1Ptr); EXTDECL; external
 {$ENDIF} (* LIBXML_SAX1_ENABLED *)
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  getPublicId: function(ctx: pointer): xmlCharPtr; EXTDECL;
+  getSystemId: function(ctx: pointer): xmlCharPtr; EXTDECL;
+  setDocumentLocator: procedure(ctx: pointer; loc: xmlSAXLocatorPtr); EXTDECL;
+
+  getLineNumber: function(ctx: pointer): cint; EXTDECL;
+  getColumnNumber: function(ctx: pointer): cint; EXTDECL;
+
+  isStandalone: function(ctx: pointer): cint; EXTDECL;
+  hasInternalSubset: function(ctx: pointer): cint; EXTDECL;
+  hasExternalSubset: function(ctx: pointer): cint; EXTDECL;
+
+  internalSubset: procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  externalSubset: procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  getEntity: function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  getParameterEntity: function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  resolveEntity: function(ctx: pointer; publicId, systemId: xmlCharPtr): xmlParserInputPtr; EXTDECL;
+
+  entityDecl: procedure(ctx: pointer; name: xmlCharPtr; _type: cint; content, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  attributeDecl: procedure(ctx: pointer; elem, fullname: xmlCharPtr; _type, def: cint; defaultValue: xmlCharPtr; tree: xmlEnumerationPtr); EXTDECL;
+  elementDecl: procedure(ctx: pointer; name: xmlCharPtr; _type: cint; content: xmlElementContentPtr); EXTDECL;
+  notationDecl: procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  unparsedEntityDecl: procedure(ctx: pointer; name, publicId, systemId, notationName: xmlCharPtr); EXTDECL;
+
+  startDocument: procedure(ctx: pointer); EXTDECL;
+  endDocument: procedure(ctx: pointer); EXTDECL;
+  attribute: procedure(ctx: pointer; fullname, value: xmlCharPtr); EXTDECL;
+  startElement: procedure(ctx: pointer; fullname: xmlCharPtr; atts: xmlCharPtrPtr); EXTDECL;
+  endElement: procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
+  reference: procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
+  characters: procedure(ctx: pointer; ch: xmlCharPtr; len: cint); EXTDECL;
+  ignorableWhitespace: procedure(ctx: pointer; ch: xmlCharPtr; len: cint); EXTDECL;
+  processingInstruction: procedure(ctx: pointer; target, data: xmlCharPtr); EXTDECL;
+  globalNamespace: procedure(ctx: pointer; href, prefix: xmlCharPtr); EXTDECL;
+  setNamespace: procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
+  getNamespace: function(ctx: pointer): xmlNsPtr; EXTDECL;
+  checkNamespace: function(ctx: pointer; nameSpace: xmlCharPtr): cint; EXTDECL;
+  namespaceDecl: procedure(ctx: pointer; href, prefix: xmlCharPtr); EXTDECL;
+  comment: procedure(ctx: pointer; value: xmlCharPtr); EXTDECL;
+  cdataBlock: procedure(ctx: pointer; value: xmlCharPtr; len: cint); EXTDECL;
+
+{$IFDEF LIBXML_SAX1_ENABLED}
+  initxmlDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerV1Ptr; warning: cint); EXTDECL;
+{$IFDEF LIBXML_HTML_ENABLED}
+  inithtmlDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerV1Ptr); EXTDECL;
+{$ENDIF}
+{$IFDEF LIBXML_DOCB_ENABLED}
+  initdocbDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerV1Ptr); EXTDECL;
+{$ENDIF}
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_LEGACY_ENABLED *)

+ 58 - 1
packages/libxml/src/SAX2.inc

@@ -11,7 +11,7 @@
 {$IFDEF FUNCTION}
 function xmlSAX2GetPublicId(ctx: pointer): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlSAX2GetSystemId(ctx: pointer): xmlCharPtr; EXTDECL; external xml2lib;
-procedure xmlSAX2GetSystemId(ctx: pointer; loc: xmlSAXLocatorPtr); EXTDECL; external xml2lib;
+procedure xmlSAX2SetDocumentLocator(ctx: pointer; loc: xmlSAXLocatorPtr); EXTDECL; external xml2lib;
 
 function xmlSAX2GetLineNumber(ctx: pointer): cint; EXTDECL; external xml2lib;
 function xmlSAX2GetColumnNumber(ctx: pointer): cint; EXTDECL; external xml2lib;
@@ -64,3 +64,60 @@ procedure docbDefaultSAXHandlerInit; EXTDECL; external xml2lib;
 {$ENDIF}
 procedure xmlDefaultSAXHandlerInit; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlSAX2GetPublicId: function(ctx: pointer): xmlCharPtr; EXTDECL;
+  xmlSAX2GetSystemId: function(ctx: pointer): xmlCharPtr; EXTDECL;
+  xmlSAX2SetDocumentLocator: procedure(ctx: pointer; loc: xmlSAXLocatorPtr); EXTDECL;
+
+  xmlSAX2GetLineNumber: function(ctx: pointer): cint; EXTDECL;
+  xmlSAX2GetColumnNumber: function(ctx: pointer): cint; EXTDECL;
+
+  xmlSAX2IsStandalone: function(ctx: pointer): cint; EXTDECL;
+  xmlSAX2HasInternalSubset: function(ctx: pointer): cint; EXTDECL;
+  xmlSAX2HasExternalSubset: function(ctx: pointer): cint; EXTDECL;
+
+  xmlSAX2InternalSubset: procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  xmlSAX2ExternalSubset: procedure(ctx: pointer; name, ExternalID, SystemID: xmlCharPtr); EXTDECL;
+  xmlSAX2GetEntity: function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlSAX2GetParameterEntity: function(ctx: pointer; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlSAX2ResolveEntity: function(ctx: pointer; publicId, systemId: xmlCharPtr): xmlParserInputPtr; EXTDECL;
+
+  xmlSAX2EntityDecl: procedure(ctx: pointer; name: xmlCharPtr; _type: cint; publicId, systemId, content: xmlCharPtr); EXTDECL;
+  xmlSAX2AttributeDecl: procedure(ctx: pointer; elem, fullname: xmlCharPtr; _type, def: cint; defaultValue: xmlCharPtr; tree: xmlEnumerationPtr); EXTDECL;
+  xmlSAX2ElementDecl: procedure(ctx: pointer; name: xmlCharPtr; _type: cint; content: xmlElementContentPtr); EXTDECL;
+  xmlSAX2NotationDecl: procedure(ctx: pointer; name, publicId, systemId: xmlCharPtr); EXTDECL;
+  xmlSAX2UnparsedEntityDecl: procedure(ctx: pointer; name, publicId, systemId, notationName: xmlCharPtr); EXTDECL;
+
+  xmlSAX2StartDocument: procedure(ctx: pointer); EXTDECL;
+  xmlSAX2EndDocument: procedure(ctx: pointer); EXTDECL;
+
+{$IF defined(LIBXML_SAX1_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+  xmlSAX2StartElement: procedure(ctx: pointer; filename: xmlCharPtr; atts: xmlCharPtrPtr); EXTDECL;
+  xmlSAX2EndElement: procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED *)
+  xmlSAX2StartElementNs: procedure(ctx: pointer; localname, prefix, URI: xmlCharPtr; nb_namespaces: cint; namespaces: xmlCharPtrPtr;
+    nb_attributes, nb_defaulted: cint; attributes: xmlCharPtrPtr); EXTDECL;
+  xmlSAX2EndElementNs: procedure(ctx: pointer; localname, prefix, URI: xmlCharPtr); EXTDECL;
+  xmlSAX2Reference: procedure(ctx: pointer; name: xmlCharPtr); EXTDECL;
+  xmlSAX2Characters: procedure(ctx: pointer; name: xmlCharPtr; len: cint); EXTDECL;
+  xmlSAX2IgnorableWhitespace: procedure(ctx: pointer; name: xmlCharPtr; len: cint); EXTDECL;
+  xmlSAX2ProcessingInstruction: procedure(ctx: pointer; target, data: xmlCharPtr); EXTDECL;
+  xmlSAX2Comment: procedure(ctx: pointer; value: xmlCharPtr); EXTDECL;
+  xmlSAX2CDataBlock: procedure(ctx: pointer; value: xmlCharPtr; len: cint); EXTDECL;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSAXDefaultVersion: function(version: cint): cint; EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+
+  xmlSAXVersion: function(hdlr: xmlSAXHandlerPtr; version: cint): cint; EXTDECL;
+  xmlSAX2InitDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerPtr; warning: cint); EXTDECL;
+{$IFDEF LIBXML_HTML_ENABLED}
+  xmlSAX2InitHtmlDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerPtr); EXTDECL;
+  htmlDefaultSAXHandlerInit: procedure; EXTDECL;
+{$ENDIF}
+{$IFDEF LIBXML_DOCB_ENABLED}
+  xmlSAX2InitDocbDefaultSAXHandler: procedure(hdlr: xmlSAXHandlerPtr); EXTDECL;
+  docbDefaultSAXHandlerInit: procedure; EXTDECL;
+{$ENDIF}
+  xmlDefaultSAXHandlerInit: procedure; EXTDECL;
+{$ENDIF}

+ 24 - 0
packages/libxml/src/attributes.inc

@@ -0,0 +1,24 @@
+(*
+ * Summary: interface for the XSLT attribute handling
+ * Description: this module handles the specificities of attribute
+ *              and attribute groups processing.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF FUNCTION}
+procedure xsltParseStylesheetAttributeSet(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltFreeAttributeSetsHashes(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+procedure xsltApplyAttributeSet(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; const attributes: xmlCharPtr); EXTDECL; external xsltlib;
+procedure xsltResolveStylesheetAttributeSet(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xsltParseStylesheetAttributeSet: procedure(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL;
+  xsltFreeAttributeSetsHashes: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltApplyAttributeSet: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; const attributes: xmlCharPtr); EXTDECL;
+  xsltResolveStylesheetAttributeSet: procedure(style: xsltStylesheetPtr); EXTDECL;
+{$ENDIF}
+

+ 30 - 4
packages/libxml/src/c14n.inc

@@ -44,6 +44,18 @@
  *)
 
 {$IFDEF TYPE}
+(*
+ * xmlC14NMode:
+ *
+ * Predefined values for C14N modes
+ *
+ *)
+  xmlC14NMode = (
+    XML_C14N_1_0           = 0, { Original C14N 1.0 spec }
+    XML_C14N_EXCLUSIVE_1_0 = 1, { Exclusive C14N 1.0 spec }
+    XML_C14N_1_1           = 2  { C14N 1.1 spec }
+  );
+
 (**
  * This is the core C14N function
  *)
@@ -52,17 +64,31 @@
 {$ENDIF}
 
 {$IFDEF FUNCTION}
-function xmlC14NDocSaveTo(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+function xmlC14NDocSaveTo(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
   with_comments: cint; buf: xmlOutputBufferPtr): cint; EXTDECL; external xml2lib;
 
-function xmlC14NDocDumpMemory(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+function xmlC14NDocDumpMemory(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
   with_comments: cint; doc_txt_ptr: xmlCharPtrPtr): cint; EXTDECL; external xml2lib;
 
-function xmlC14NDocSave(doc: xmlDocPtr; nodes: xmlNodeSetPtr; exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+function xmlC14NDocSave(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
   with_comments: cint; filename: PAnsiChar; compression: cint): cint; EXTDECL; external xml2lib;
 
 function xmlC14NExecute(doc: xmlDocPtr; is_visible_callback: xmlC14NIsVisibleCallback; user_data: pointer;
-  exclusive: cint; inclusive_ns_prefixes: xmlCharPtrPtr; with_comments: cint; buf: xmlOutputBufferPtr): cint; EXTDECL; external xml2lib;
+  mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr; with_comments: cint; buf: xmlOutputBufferPtr): cint; EXTDECL; external xml2lib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlC14NDocSaveTo: function(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+    with_comments: cint; buf: xmlOutputBufferPtr): cint; EXTDECL;
+
+  xmlC14NDocDumpMemory: function(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+    with_comments: cint; doc_txt_ptr: xmlCharPtrPtr): cint; EXTDECL;
+
+  xmlC14NDocSave: function(doc: xmlDocPtr; nodes: xmlNodeSetPtr; mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr;
+    with_comments: cint; filename: PAnsiChar; compression: cint): cint; EXTDECL;
+
+  xmlC14NExecute: function(doc: xmlDocPtr; is_visible_callback: xmlC14NIsVisibleCallback; user_data: pointer;
+    mode: cint; inclusive_ns_prefixes: xmlCharPtrPtr; with_comments: cint; buf: xmlOutputBufferPtr): cint; EXTDECL;
 {$ENDIF}
 
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)

+ 61 - 2
packages/libxml/src/catalog.inc

@@ -29,7 +29,7 @@
  *
  * The specific XML Catalog Processing Instuction name.
  *)
-  XML_CATALOG_PI: xmlCharPtr = 'urn:oasis:names:tc:entity:xmlns:xml:catalog';
+  XML_CATALOG_PI: xmlCharPtr = 'oasis-xml-catalog';
 {$ENDIF}
 
 {$IFDEF POINTER}
@@ -63,7 +63,8 @@
 function xmlNewCatalog(sgml: cint): xmlCatalogPtr; EXTDECL; external xml2lib;
 function xmlLoadACatalog(filename: PAnsiChar): xmlCatalogPtr; EXTDECL; external xml2lib;
 function xmlLoadSGMLSuperCatalog(filename: PAnsiChar): xmlCatalogPtr; EXTDECL; external xml2lib;
-function xmlLoadACatalog(catal: xmlCatalogPtr): cint; EXTDECL; external xml2lib;
+function xmlConvertSGMLCatalog(catal: xmlCatalogPtr): cint; EXTDECL; external xml2lib;
+//function xmlLoadACatalog(catal: xmlCatalogPtr): cint; EXTDECL; external xml2lib;
 function xmlACatalogAdd(catal: xmlCatalogPtr; _type, orig, replace: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlACatalogRemove(catal: xmlCatalogPtr; value: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlACatalogResolve(catal: xmlCatalogPtr; pubID, sysID: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
@@ -112,4 +113,62 @@ function xmlCatalogSetDefaultPrefer(prefer: xmlCatalogPrefer): cint; EXTDECL; ex
 procedure xmlCatalogSetDefaults(allow: xmlCatalogAllow); EXTDECL; external xml2lib;
 function xmlCatalogGetDefaults: xmlCatalogAllow; EXTDECL; external xml2lib;
 {$ENDIF}
+{$IFDEF FUNCTIONVAR}
+(*
+ * Operations on a given catalog.
+ *)
+  xmlNewCatalog: function(sgml: cint): xmlCatalogPtr; EXTDECL;
+  xmlLoadACatalog: function(filename: PAnsiChar): xmlCatalogPtr; EXTDECL;
+  xmlLoadSGMLSuperCatalog: function(filename: PAnsiChar): xmlCatalogPtr; EXTDECL;
+  xmlConvertSGMLCatalog: function(catal: xmlCatalogPtr): cint; EXTDECL;
+  //xmlLoadACatalog: function(catal: xmlCatalogPtr): cint; EXTDECL;
+  xmlACatalogAdd: function(catal: xmlCatalogPtr; _type, orig, replace: xmlCharPtr): cint; EXTDECL;
+  xmlACatalogRemove: function(catal: xmlCatalogPtr; value: xmlCharPtr): cint; EXTDECL;
+  xmlACatalogResolve: function(catal: xmlCatalogPtr; pubID, sysID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlACatalogResolveSystem: function(catal: xmlCatalogPtr; sysID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlACatalogResolvePublic: function(catal: xmlCatalogPtr; pubID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlACatalogResolveURI: function(catal: xmlCatalogPtr; URI: xmlCharPtr): xmlCharPtr; EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlACatalogDump: procedure(catal: xmlCatalogPtr; _out: PFILE); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlFreeCatalog: procedure(catal: xmlCatalogPtr); EXTDECL;
+  xmlCatalogIsEmpty: function(catal: xmlCatalogPtr): cint; EXTDECL;
+
+(*
+ * Global operations.
+ *)
+  xmlInitializeCatalog: procedure; EXTDECL;
+  xmlLoadCatalog: function(filename: PAnsiChar): cint; EXTDECL;
+  xmlLoadCatalogs: function(paths: PAnsiChar): cint; EXTDECL;
+  xmlCatalogCleanup: procedure; EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlCatalogDump: procedure(_out: PFILE); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlCatalogResolve: function(pubID, sysID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCatalogResolveSystem: function(sysID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCatalogResolvePublic: function (pubID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCatalogResolveURI: function(URI: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCatalogAdd: function(_type, orig, replace: xmlCharPtr): cint; EXTDECL;
+  xmlCatalogRemove: function(value: xmlCharPtr): cint; EXTDECL;
+  xmlParseCatalogFile: function(filename: PAnsiChar): xmlDocPtr; EXTDECL;
+  xmlCatalogConvert: function: cint; EXTDECL;
+
+(*
+ * Strictly minimal interfaces for per-document catalogs used
+ * by the parser.
+ *)
+  xmlCatalogFreeLocal: procedure(catalogs: pointer); EXTDECL;
+  xmlCatalogAddLocal: function(catalogs: pointer; URL: xmlCharPtr): pointer; EXTDECL;
+  xmlCatalogLocalResolve: function(catalogs: pointer; pubID, sysID: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCatalogLocalResolveURI: function(catalogs: pointer; URI: xmlCharPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * Preference settings.
+ *)
+  xmlCatalogSetDebug: function(level: cint): cint; EXTDECL;
+  xmlCatalogSetDefaultPrefer: function(prefer: xmlCatalogPrefer): cint; EXTDECL;
+  xmlCatalogSetDefaults: procedure(allow: xmlCatalogAllow); EXTDECL;
+  xmlCatalogGetDefaults: function: xmlCatalogAllow; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_CATALOG_ENABLED *)

+ 65 - 62
packages/libxml/src/chvalid.inc

@@ -45,7 +45,16 @@
  * Range checking routine
  *)
 function xmlCharInRange(val: cint; group: xmlChRangeGroupPtr): cbool; EXTDECL; external xml2lib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(**
+ * Range checking routine
+ *)
+  xmlCharInRange: function(val: cint; group: xmlChRangeGroupPtr): cbool; EXTDECL;
+{$ENDIF}
 
+{$IFDEF MACRO}
 (**
  * xmlIsBaseChar_ch:
  * @c: AnsiChar to validate
@@ -62,15 +71,6 @@ function xmlIsBaseChar_ch(c: cint): cbool;
  *)
 function xmlIsBaseCharQ(c: cint): cbool;
 
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsBaseCharGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsBaseCharGroup: xmlChRangeGroupPtr = @xmlIsBaseCharGroup;
-{$ELSE}
-var
-  __xmlIsBaseCharGroup: xmlChRangeGroupPtr;
-{$ENDIF}
-
 (**
  * xmlIsBlank_ch:
  * @c: AnsiChar to validate
@@ -103,15 +103,6 @@ function xmlIsChar_ch(c: cint): cbool;
  *)
 function xmlIsCharQ(c: cint): cbool;
 
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsCharGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsCharGroup: xmlChRangeGroupPtr = @xmlIsCharGroup;
-{$ELSE}
-var
-  __xmlIsCharGroup: xmlChRangeGroupPtr;
-{$ENDIF}
-
 (**
  * xmlIsCombiningQ:
  * @c: AnsiChar to validate
@@ -120,15 +111,6 @@ var
  *)
 function xmlIsCombiningQ(c: cint): cbool;
 
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsCombiningGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsCombiningGroup: xmlChRangeGroupPtr = @xmlIsCombiningGroup;
-{$ELSE}
-var
-  __xmlIsCombiningGroup: xmlChRangeGroupPtr;
-{$ENDIF}
-
 (**
  * xmlIsDigit_ch:
  * @c: AnsiChar to validate
@@ -145,15 +127,6 @@ function xmlIsDigit_ch(c: cint): cbool;
  *)
 function xmlIsDigitQ(c: cint): cbool;
 
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsDigitGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsDigitGroup: xmlChRangeGroupPtr = @xmlIsDigitGroup;
-{$ELSE}
-var
-  __xmlIsDigitGroup: xmlChRangeGroupPtr;
-{$ENDIF}
-
 (**
  * xmlIsExtender_ch:
  * @c: AnsiChar to validate
@@ -170,15 +143,6 @@ function xmlIsExtender_ch(c: cint): cbool;
  *)
 function xmlIsExtenderQ(c: cint): cbool;
 
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsExtenderGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsExtenderGroup: xmlChRangeGroupPtr = @xmlIsExtenderGroup;
-{$ELSE}
-var
-  __xmlIsExtenderGroup: xmlChRangeGroupPtr;
-{$ENDIF}
-
 (**
  * xmlIsIdeographicQ:
  * @c: AnsiChar to validate
@@ -187,23 +151,6 @@ var
  *)
 function xmlIsIdeographicQ(c: cint): cbool;
 
-type
-  pchar_tab = ^char_tab;
-  char_tab = array[0..255] of cbool;
-
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlIsIdeographicGroup: xmlChRangeGroup; cvar; external;
-  __xmlIsIdeographicGroup: xmlChRangeGroupPtr = @xmlIsIdeographicGroup;
-  
-  xmlIsPubidChar_tab: char_tab; cvar; external;
-  __xmlIsPubidChar_tab: pchar_tab = @xmlIsPubidChar_tab;
-{$ELSE}
-var
-  __xmlIsIdeographicGroup: xmlChRangeGroupPtr;
-  __xmlIsPubidChar_tab: pchar_tab;
-{$ENDIF}
-
 (**
  * xmlIsPubidChar_ch:
  * @c: AnsiChar to validate
@@ -219,7 +166,9 @@ function xmlIsPubidChar_ch(c: cint): cbool;
  * Automatically generated by genChRanges.py
  *)
 function xmlIsPubidCharQ(c: cint): cbool;
+{$ENDIF}
 
+{$IFDEF FUNCTION}
 function xmlIsBaseChar(ch: cuint): cbool; EXTDECL; external xml2lib;
 function xmlIsBlank(ch: cuint): cbool; EXTDECL; external xml2lib;
 function xmlIsChar(ch: cuint): cbool; EXTDECL; external xml2lib;
@@ -229,3 +178,57 @@ function xmlIsExtender(ch: cuint): cbool; EXTDECL; external xml2lib;
 function xmlIsIdeographic(ch: cuint): cbool; EXTDECL; external xml2lib;
 function xmlIsPubidChar(ch: cuint): cbool; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlIsBaseChar: function(ch: cuint): cbool; EXTDECL;
+  xmlIsBlank: function(ch: cuint): cbool; EXTDECL;
+  xmlIsChar: function(ch: cuint): cbool; EXTDECL;
+  xmlIsCombining: function(ch: cuint): cbool; EXTDECL;
+  xmlIsDigit: function(ch: cuint): cbool; EXTDECL;
+  xmlIsExtender: function(ch: cuint): cbool; EXTDECL;
+  xmlIsIdeographic: function(ch: cuint): cbool; EXTDECL;
+  xmlIsPubidChar: function(ch: cuint): cbool; EXTDECL;
+{$ENDIF}
+
+{$IFDEF EXTVAR}
+
+type
+  pchar_tab = ^char_tab;
+  char_tab = array[0..255] of cbool;
+
+{$IFNDEF NO_EXTERNAL_VARS}
+var
+  xmlIsBaseCharGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsBaseCharGroup: xmlChRangeGroupPtr = @xmlIsBaseCharGroup;
+
+  xmlIsCharGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsCharGroup: xmlChRangeGroupPtr = @xmlIsCharGroup;
+
+  xmlIsCombiningGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsCombiningGroup: xmlChRangeGroupPtr = @xmlIsCombiningGroup;
+
+  xmlIsDigitGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsDigitGroup: xmlChRangeGroupPtr = @xmlIsDigitGroup;
+
+  xmlIsExtenderGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsExtenderGroup: xmlChRangeGroupPtr = @xmlIsExtenderGroup;
+
+  xmlIsIdeographicGroup: xmlChRangeGroup; cvar; external;
+  __xmlIsIdeographicGroup: xmlChRangeGroupPtr = @xmlIsIdeographicGroup;
+
+  xmlIsPubidChar_tab: char_tab; cvar; external;
+  __xmlIsPubidChar_tab: pchar_tab = @xmlIsPubidChar_tab;
+
+{$ELSE}
+var
+  __xmlIsBaseCharGroup: xmlChRangeGroupPtr;
+  __xmlIsCharGroup: xmlChRangeGroupPtr;
+  __xmlIsCombiningGroup: xmlChRangeGroupPtr;
+  __xmlIsDigitGroup: xmlChRangeGroupPtr;
+  __xmlIsExtenderGroup: xmlChRangeGroupPtr;
+  __xmlIsIdeographicGroup: xmlChRangeGroupPtr;
+  __xmlIsPubidChar_tab: pchar_tab;
+{$ENDIF}
+
+{$ENDIF}
+

+ 39 - 1
packages/libxml/src/dict.inc

@@ -20,10 +20,17 @@
 {$ENDIF}
 
 {$IFDEF FUNCTION}
+(*
+ * Initializer
+ *)
+function xmlInitializeDict: cint; EXTDECL; external xml2lib;
+
 (*
  * Constructor and destructor.
  *)
 function xmlDictCreate: xmlDictPtr; EXTDECL; external xml2lib;
+function xmlDictSetLimit(dict: xmlDictPtr; limit: csize_t): csize_t; EXTDECL; external xml2lib;
+function xmlDictGetUsage(dict: xmlDictPtr): csize_t; EXTDECL; external xml2lib;
 function xmlDictCreateSub(sub: xmlDictPtr): xmlDictPtr; EXTDECL; external xml2lib;
 function xmlDictReference(dict: xmlDictPtr): cint; EXTDECL; external xml2lib;
 procedure xmlDictFree(dict: xmlDictPtr); EXTDECL; external xml2lib;
@@ -35,10 +42,41 @@ function xmlDictLookup(dict: xmlDictPtr; name: xmlCharPtr; len: cint): xmlCharPt
 function xmlDictExists(dict: xmlDictPtr; name: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlDictQLookup(dict: xmlDictPtr; prefix, name: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlDictOwns(dict: xmlDictPtr; str: xmlCharPtr): cint; EXTDECL; external xml2lib;
-function xmlDictOwns(dict: xmlDictPtr): cint; EXTDECL; external xml2lib;
+function xmlDictSize(dict: xmlDictPtr): cint; EXTDECL; external xml2lib;
 
 (*
  * Cleanup function
  *)
 procedure xmlDictCleanup; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Initializer
+ *)
+  xmlInitializeDict: function: cint; EXTDECL;
+
+(*
+ * Constructor and destructor.
+ *)
+  xmlDictCreate: function: xmlDictPtr; EXTDECL;
+  xmlDictSetLimit: function(dict: xmlDictPtr; limit: csize_t): csize_t; EXTDECL;
+  xmlDictGetUsage: function(dict: xmlDictPtr): csize_t; EXTDECL;
+  xmlDictCreateSub: function(sub: xmlDictPtr): xmlDictPtr; EXTDECL;
+  xmlDictReference: function(dict: xmlDictPtr): cint; EXTDECL;
+  xmlDictFree: procedure(dict: xmlDictPtr); EXTDECL;
+
+(*
+ * Lookup of entry in the dictionnary.
+ *)
+  xmlDictLookup: function(dict: xmlDictPtr; name: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlDictExists: function(dict: xmlDictPtr; name: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlDictQLookup: function(dict: xmlDictPtr; prefix, name: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlDictOwns: function(dict: xmlDictPtr; str: xmlCharPtr): cint; EXTDECL;
+  xmlDictSize: function(dict: xmlDictPtr): cint; EXTDECL;
+
+(*
+ * Cleanup function
+ *)
+  xmlDictCleanup: procedure; EXTDECL;
+{$ENDIF}

+ 84 - 0
packages/libxml/src/documents.inc

@@ -0,0 +1,84 @@
+(*
+ * Summary: interface for the document handling
+ * Description: implements document loading and cache (multiple
+ *              document() reference for the same resources must
+ *              be equal.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF FUNCTION}
+function xsltNewDocument(ctxt: xsltTransformContextPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL; external xsltlib;
+function xsltLoadDocument(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr): xsltDocumentPtr; EXTDECL; external xsltlib;
+function xsltFindDocument(ctxt: xsltTransformContextPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL; external xsltlib;
+procedure xsltFreeDocuments(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+function xsltLoadStyleDocument(style: xsltStylesheetPtr; const URI: xmlCharPtr): xsltDocumentPtr; EXTDECL; external xsltlib;
+function xsltNewStyleDocument(style: xsltStylesheetPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL; external xsltlib;
+procedure xsltFreeStyleDocuments(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltNewDocument: function(ctxt: xsltTransformContextPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL;
+  xsltLoadDocument: function(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr): xsltDocumentPtr; EXTDECL;
+  xsltFindDocument: function(ctxt: xsltTransformContextPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL;
+  xsltFreeDocuments: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltLoadStyleDocument: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): xsltDocumentPtr; EXTDECL;
+  xsltNewStyleDocument: function(style: xsltStylesheetPtr; doc: xmlDocPtr): xsltDocumentPtr; EXTDECL;
+  xsltFreeStyleDocuments: procedure(style: xsltStylesheetPtr); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+(*
+ * Hooks for document loading
+ *)
+
+{$IFDEF TYPE}
+(**
+ * xsltLoadType:
+ *
+ * Enum defining the kind of loader requirement.
+ *)
+  xsltLoadType = (
+    XSLT_LOAD_START = 0,          (* loading for a top stylesheet *)
+    XSLT_LOAD_STYLESHEET,         (* loading for a stylesheet include/import *)
+    XSLT_LOAD_DOCUMENT            (* loading document at transformation time *)
+  );
+
+(**
+ * xsltDocLoaderFunc:
+ * @URI: the URI of the document to load
+ * @dict: the dictionary to use when parsing that document
+ * @options: parsing options, a set of xmlParserOption
+ * @ctxt: the context, either a stylesheet or a transformation context
+ * @type: the xsltLoadType indicating the kind of loading required
+ *
+ * An xsltDocLoaderFunc is a signature for a function which can be
+ * registered to load document not provided by the compilation or
+ * transformation API themselve, for example when an xsl:import,
+ * xsl:include is found at compilation time or when a document()
+ * call is made at runtime.
+ *
+ * Returns the pointer to the document (which will be modified and
+ * freed by the engine later), or NULL in case of error.
+ *)
+  xsltDocLoaderFunc = function(const URI: xmlCharPtr;
+    dict: xmlDictPtr;
+    options: cint;
+    ctxt: Pointer;
+    &type: xsltLoadType): xmlDocPtr; EXTDECL;
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+procedure xsltSetLoaderFunc(f: xsltDocLoaderFunc); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltSetLoaderFunc: procedure(f: xsltDocLoaderFunc); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF EXTVAR}
+(* the loader may be needed by extension libraries so it is exported *)
+var
+  xsltDocDefaultLoader: xsltDocLoaderFunc;
+{$ENDIF}

+ 39 - 0
packages/libxml/src/encoding.inc

@@ -163,3 +163,42 @@ function UTF8Toisolat1(_out: PAnsiChar; outlen: pcint; _in: PAnsiChar; inlen: pc
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
 function isolat1ToUTF8(_out: PAnsiChar; outlen: pcint; _in: PAnsiChar; inlen: pcint): cint; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Interfaces for encoding handlers.
+ *)
+  xmlInitCharEncodingHandlers: procedure; EXTDECL;
+  xmlCleanupCharEncodingHandlers: procedure; EXTDECL;
+  xmlRegisterCharEncodingHandler: procedure(handler: xmlCharEncodingHandlerPtr); EXTDECL;
+  xmlGetCharEncodingHandler: function(enc: xmlCharEncoding): xmlCharEncodingHandlerPtr; EXTDECL;
+  xmlFindCharEncodingHandler: function(name: PAnsiChar): xmlCharEncodingHandlerPtr; EXTDECL;
+  xmlNewCharEncodingHandler: function(name: PAnsiChar; input: xmlCharEncodingInputFunc; output: xmlCharEncodingOutputFunc): xmlCharEncodingHandlerPtr; EXTDECL;
+
+(*
+ * Interfaces for encoding names and aliases.
+ *)
+  xmlAddEncodingAlias: function(name: PAnsiChar; alias: PAnsiChar): cint; EXTDECL;
+  xmlDelEncodingAlias: function(alias: PAnsiChar): cint; EXTDECL;
+  xmlGetEncodingAlias: function(alias: PAnsiChar): PAnsiChar; EXTDECL;
+  xmlCleanupEncodingAliases: procedure; EXTDECL;
+  xmlParseCharEncoding: function(name: PAnsiChar): xmlCharEncoding; EXTDECL;
+  xmlGetCharEncodingName: function(enc: xmlCharEncoding): PAnsiChar; EXTDECL;
+
+(*
+ * Interfaces directly used by the parsers.
+ *)
+  xmlDetectCharEncoding: function(_in: PAnsiChar; len: cint): xmlCharEncoding; EXTDECL;
+  xmlCharEncOutFunc: function(handler: xmlCharEncodingHandlerPtr; _out, _in: xmlBufferPtr): cint; EXTDECL;
+  xmlCharEncInFunc: function(handler: xmlCharEncodingHandlerPtr; _out, _in: xmlBufferPtr): cint; EXTDECL;
+  xmlCharEncFirstLine: function(handler: xmlCharEncodingHandlerPtr; _out, _in: xmlBufferPtr): cint; EXTDECL;
+  xmlCharEncCloseFunc: function(handler: xmlCharEncodingHandlerPtr): cint; EXTDECL;
+
+(*
+ * Export a few useful functions
+ *)
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  UTF8Toisolat1: function(_out: PAnsiChar; outlen: pcint; _in: PAnsiChar; inlen: pcint): cint; EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  isolat1ToUTF8: function(_out: PAnsiChar; outlen: pcint; _in: PAnsiChar; inlen: pcint): cint; EXTDECL;
+{$ENDIF}

+ 36 - 1
packages/libxml/src/entities.inc

@@ -69,6 +69,7 @@
 {$IFDEF LIBXML_LEGACY_ENABLED}
 procedure xmlInitializePredefinedEntities; EXTDECL; external xml2lib;
 {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+function xmlNewEntity(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
 function xmlAddDocEntity(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
 function xmlAddDtdEntity(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
 function xmlGetPredefinedEntity(name: xmlCharPtr): xmlEntityPtr; EXTDECL; external xml2lib;
@@ -92,4 +93,38 @@ procedure xmlDumpEntityDecl(buf: xmlBufferPtr; ent: xmlEntityPtr); EXTDECL; exte
 {$IFDEF LIBXML_LEGACY_ENABLED}
 procedure xmlCleanupPredefinedEntities; EXTDECL; external xml2lib;
 {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
-{$ENDIF}
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * External functions:
+ *)
+
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlInitializePredefinedEntities: procedure; EXTDECL;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlNewEntity: function(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlAddDocEntity: function(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlAddDtdEntity: function(doc: xmlDocPtr; name: xmlCharPtr; _type: cint; ExternalID, SystemID, content: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlGetPredefinedEntity: function(name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlGetDocEntity: function(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlGetDtdEntity: function(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+  xmlGetParameterEntity: function(doc: xmlDocPtr; name: xmlCharPtr): xmlEntityPtr; EXTDECL;
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlEncodeEntities: function(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlEncodeEntitiesReentrant: function(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlEncodeSpecialChars: function(doc: xmlDocPtr; input: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlCreateEntitiesTable: function: xmlEntitiesTablePtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyEntitiesTable: function(table: xmlEntitiesTablePtr): xmlEntitiesTablePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeEntitiesTable: procedure(table: xmlEntitiesTablePtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpEntitiesTable: procedure(buf: xmlBufferPtr; table: xmlEntitiesTablePtr); EXTDECL;
+  xmlDumpEntityDecl: procedure(buf: xmlBufferPtr; ent: xmlEntityPtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlCleanupPredefinedEntities: procedure; EXTDECL;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+{$ENDIF}

+ 64 - 0
packages/libxml/src/exslt.inc

@@ -0,0 +1,64 @@
+{$IFNDEF NO_EXTERNAL_VARS}
+var
+  exsltLibraryVersion: PAnsiChar; external exsltlib;
+  exsltLibexsltVersion: cint; external exsltlib;
+  exsltLibxsltVersion: cint; external exsltlib;
+  exsltLibxmlVersion: cint; external exsltlib;
+{$ENDIF}
+
+const
+  (**
+   * EXSLT_COMMON_NAMESPACE:
+   *
+   * Namespace for EXSLT common functions
+   *)
+  EXSLT_COMMON_NAMESPACE = 'http://exslt.org/common';
+  (**
+   * EXSLT_CRYPTO_NAMESPACE:
+   *
+   * Namespace for EXSLT crypto functions
+   *)
+  EXSLT_CRYPTO_NAMESPACE = 'http://exslt.org/crypto';
+  (**
+   * EXSLT_MATH_NAMESPACE:
+   *
+   * Namespace for EXSLT math functions
+   *)
+  EXSLT_MATH_NAMESPACE = 'http://exslt.org/math';
+  (**
+   * EXSLT_SETS_NAMESPACE:
+   *
+   * Namespace for EXSLT set functions
+   *)
+  EXSLT_SETS_NAMESPACE = 'http://exslt.org/sets';
+  (**
+   * EXSLT_FUNCTIONS_NAMESPACE:
+   *
+   * Namespace for EXSLT functions extension functions
+   *)
+  EXSLT_FUNCTIONS_NAMESPACE = 'http://exslt.org/functions';
+  (**
+   * EXSLT_STRINGS_NAMESPACE:
+   *
+   * Namespace for EXSLT strings functions
+   *)
+  EXSLT_STRINGS_NAMESPACE = 'http://exslt.org/strings';
+  (**
+   * EXSLT_DATE_NAMESPACE:
+   *
+   * Namespace for EXSLT date functions
+   *)
+  EXSLT_DATE_NAMESPACE = 'http://exslt.org/dates-and-times';
+  (**
+   * EXSLT_DYNAMIC_NAMESPACE:
+   *
+   * Namespace for EXSLT dynamic functions
+   *)
+  EXSLT_DYNAMIC_NAMESPACE = 'http://exslt.org/dynamic';
+
+  (**
+   * SAXON_NAMESPACE:
+   *
+   * Namespace for SAXON extensions functions
+   *)
+  SAXON_NAMESPACE = 'http://icl.com/saxon';

+ 59 - 0
packages/libxml/src/exslt.pas

@@ -0,0 +1,59 @@
+{$IFNDEF FPC_DOTTEDUNITS}
+unit exslt;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$mode ObjFPC}
+{$H+}
+{$macro on}
+
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses
+  Api.XML.Xml2,
+  System.CTypes;
+{$ELSE}
+uses
+  xml2, ctypes;
+{$ENDIF}
+
+const
+{$IF Defined(WINDOWS)}
+  exsltlib = 'libexslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ELSEIF Defined(UNIX)}
+  exsltlib = 'libexslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+{$ELSE}
+  {$MESSAGE ERROR 'Platform not supported right now'}
+{$IFEND}
+
+{$I exslt.inc}
+
+procedure exsltCommonRegister; EXTDECL; external exsltlib;
+{$IFDEF EXSLT_CRYPTO_ENABLED}
+procedure exsltCryptoRegister; EXTDECL; external exsltlib;
+{$ENDIF}
+procedure exsltMathRegister; EXTDECL; external exsltlib;
+procedure exsltSetsRegister; EXTDECL; external exsltlib;
+procedure exsltFuncRegister; EXTDECL; external exsltlib;
+procedure exsltStrRegister; EXTDECL; external exsltlib;
+procedure exsltDateRegister; EXTDECL; external exsltlib;
+procedure exsltSaxonRegister; EXTDECL; external exsltlib;
+procedure exsltDynRegister; EXTDECL; external exsltlib;
+
+procedure exsltRegisterAll; EXTDECL; external exsltlib;
+
+function exsltDateXpathCtxtRegister(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL; external exsltlib;
+function exsltMathXpathCtxtRegister(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL; external exsltlib;
+function exsltSetsXpathCtxtRegister(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL; external exsltlib;
+function exsltStrXpathCtxtRegister(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL; external exsltlib;
+
+implementation
+
+end.
+

+ 131 - 0
packages/libxml/src/exsltdyn.pas

@@ -0,0 +1,131 @@
+{$IFNDEF FPC_DOTTEDUNITS}
+unit exsltdyn;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$mode ObjFPC}
+{$H+}
+{$macro on}
+
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses
+  Api.XML.Xml2Dyn,
+  System.CTypes;
+{$ELSE}
+uses
+  xml2dyn, ctypes;
+{$ENDIF}
+
+const
+{$IF Defined(WINDOWS)}
+  exsltlib = 'libexslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ELSEIF Defined(UNIX)}
+  exsltlib = 'libexslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+{$ELSE}
+  {$MESSAGE ERROR 'Platform not supported right now'}
+{$IFEND}
+
+{$IFNDEF NO_EXTERNAL_VARS}
+{$DEFINE NO_EXTERNAL_VARS}
+{$ENDIF}
+
+{$I exslt.inc}
+
+var
+  exsltCommonRegister: procedure; EXTDECL;
+{$IFDEF EXSLT_CRYPTO_ENABLED}
+  exsltCryptoRegister: procedure; EXTDECL;
+{$ENDIF}
+  exsltMathRegister: procedure; EXTDECL;
+  exsltSetsRegister: procedure; EXTDECL;
+  exsltFuncRegister: procedure; EXTDECL;
+  exsltStrRegister: procedure; EXTDECL;
+  exsltDateRegister: procedure; EXTDECL;
+  exsltSaxonRegister: procedure; EXTDECL;
+  exsltDynRegister: procedure; EXTDECL;
+
+  exsltRegisterAll: procedure; EXTDECL;
+
+  exsltDateXpathCtxtRegister: function(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL;
+  exsltMathXpathCtxtRegister: function(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL;
+  exsltSetsXpathCtxtRegister: function(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL;
+  exsltStrXpathCtxtRegister: function(ctxt: xmlXPathContextPtr; const prefix: xmlCharPtr): cint; EXTDECL;
+
+var
+  LibExsltHandle: TLibHandle = NilHandle;
+
+function LoadExsltLib(ALibName: String = ''): Boolean;
+procedure FreeLibExslt;
+
+implementation
+
+function LoadExsltLib(ALibName: String): Boolean;
+begin
+  if ALibName = '' then
+    ALibName := exsltlib;
+
+  LibExsltHandle := LoadLibrary(ALibName);
+
+  if LibExsltHandle <> NilHandle then
+  begin
+    Pointer(exsltCommonRegister) := GetProcAddress(LibExsltHandle, 'exsltCommonRegister');
+  {$IFDEF EXSLT_CRYPTO_ENABLED}
+    Pointer(exsltCryptoRegister) := GetProcAddress(LibExsltHandle, 'exsltCryptoRegister');
+  {$ENDIF}
+    Pointer(exsltMathRegister) := GetProcAddress(LibExsltHandle, 'exsltMathRegister');
+    Pointer(exsltSetsRegister) := GetProcAddress(LibExsltHandle, 'exsltSetsRegister');
+    Pointer(exsltFuncRegister) := GetProcAddress(LibExsltHandle, 'exsltFuncRegister');
+    Pointer(exsltStrRegister) := GetProcAddress(LibExsltHandle, 'exsltStrRegister');
+    Pointer(exsltDateRegister) := GetProcAddress(LibExsltHandle, 'exsltDateRegister');
+    Pointer(exsltSaxonRegister) := GetProcAddress(LibExsltHandle, 'exsltSaxonRegister');
+    Pointer(exsltDynRegister) := GetProcAddress(LibExsltHandle, 'exsltDynRegister');
+
+    Pointer(exsltRegisterAll) := GetProcAddress(LibExsltHandle, 'exsltRegisterAll');
+
+    Pointer(exsltDateXpathCtxtRegister) := GetProcAddress(LibExsltHandle, 'exsltDateXpathCtxtRegister');
+    Pointer(exsltMathXpathCtxtRegister) := GetProcAddress(LibExsltHandle, 'exsltMathXpathCtxtRegister');
+    Pointer(exsltSetsXpathCtxtRegister) := GetProcAddress(LibExsltHandle, 'exsltSetsXpathCtxtRegister');
+    Pointer(exsltStrXpathCtxtRegister) := GetProcAddress(LibExsltHandle, 'exsltStrXpathCtxtRegister');
+
+    Result := True;
+  end
+  else
+    Result := False;
+end;
+
+procedure FreeLibExslt;
+begin
+  if LibExsltHandle = NilHandle then
+    Exit;
+  FreeLibrary(LibExsltHandle);
+  LibExsltHandle := NilHandle;
+
+  exsltCommonRegister := nil;
+{$IFDEF EXSLT_CRYPTO_ENABLED}
+  exsltCryptoRegister := nil;
+{$ENDIF}
+  exsltMathRegister := nil;
+  exsltSetsRegister := nil;
+  exsltFuncRegister := nil;
+  exsltStrRegister := nil;
+  exsltDateRegister := nil;
+  exsltSaxonRegister := nil;
+  exsltDynRegister := nil;
+
+  exsltRegisterAll := nil;
+
+  exsltDateXpathCtxtRegister := nil;
+  exsltMathXpathCtxtRegister := nil;
+  exsltSetsXpathCtxtRegister := nil;
+  exsltStrXpathCtxtRegister := nil;
+end;
+
+end.
+

+ 228 - 0
packages/libxml/src/extensions.inc

@@ -0,0 +1,228 @@
+(*
+ * Summary: interface for the extension support
+ * Description: This provide the API needed for simple and module
+ *              extension support.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+
+(**
+ * Extension Modules API.
+ *)
+
+{$IFDEF FUNCTION}
+(**
+ * xsltInitGlobals:
+ *
+ * Initialize the global variables for extensions
+ *
+ *)
+
+procedure xsltInitGlobals; EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(**
+ * xsltInitGlobals:
+ *
+ * Initialize the global variables for extensions
+ *
+ *)
+
+  xsltInitGlobals: procedure; EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF TYPE}
+  (**
+   * xsltStyleExtInitFunction:
+   * @ctxt:  an XSLT stylesheet
+   * @URI:  the namespace URI for the extension
+   *
+   * A function called at initialization time of an XSLT extension module.
+   *
+   * Returns a pointer to the module specific data for this transformation.
+   *)
+  xsltStyleExtInitFunction = function(style: xsltStylesheetPtr; const URI: xmlCharPtr): Pointer; EXTDECL;
+
+  (**
+   * xsltStyleExtShutdownFunction:
+   * @ctxt:  an XSLT stylesheet
+   * @URI:  the namespace URI for the extension
+   * @data:  the data associated to this module
+   *
+   * A function called at shutdown time of an XSLT extension module.
+   *)
+  xsltStyleExtShutdownFunction = procedure(style: xsltStylesheetPtr; const URI: xmlCharPtr; data: Pointer); EXTDECL;
+
+  (**
+   * xsltExtInitFunction:
+   * @ctxt:  an XSLT transformation context
+   * @URI:  the namespace URI for the extension
+   *
+   * A function called at initialization time of an XSLT extension module.
+   *
+   * Returns a pointer to the module specific data for this transformation.
+   *)
+  xsltExtInitFunction = function(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr): Pointer; EXTDECL;
+
+  (**
+   * xsltExtShutdownFunction:
+   * @ctxt:  an XSLT transformation context
+   * @URI:  the namespace URI for the extension
+   * @data:  the data associated to this module
+   *
+   * A function called at shutdown time of an XSLT extension module.
+   *)
+  xsltExtShutdownFunction = procedure(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr; data: Pointer); EXTDECL;
+
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+function xsltRegisterExtModule(const URI: xmlCharPtr; initFunc: xsltExtInitFunction; shutdownFunc: xsltExtShutdownFunction): cint; EXTDECL; external xsltlib;
+function xsltRegisterExtModuleFull(const URI: xmlCharPtr; initFunc: xsltExtInitFunction; shutdownFunc: xsltExtShutdownFunction; styleInitFunc: xsltStyleExtInitFunction; styleShutdownFunc: xsltStyleExtShutdownFunction): cint; EXTDECL; external xsltlib;
+function xsltUnregisterExtModule(const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltGetExtData(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr): Pointer; EXTDECL; external xsltlib;
+function xsltStyleGetExtData(style: xsltStylesheetPtr; const URI: xmlCharPtr): Pointer; EXTDECL; external xsltlib;
+{$IFDEF XSLT_REFACTORED}
+function xsltStyleStylesheetLevelGetExtData(style: xsltStylesheetPtr; const URI: xmlCharPtr): Pointer; EXTDECL; external xsltlib;
+{$ENDIF}
+procedure xsltShutdownCtxtExts(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+procedure xsltShutdownExts(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+function xsltXPathGetTransformContext(ctxt: xmlXPathParserContextPtr): xsltTransformContextPtr; EXTDECL; external xsltlib;
+
+(*
+ * extension functions
+ *)
+function xsltRegisterExtModuleFunction(const name: xmlCharPtr; const URI: xmlCharPtr; &function: xmlXPathFunction): cint; EXTDECL; external xsltlib;
+function xsltExtModuleFunctionLookup(const name: xmlCharPtr; const URI: xmlCharPtr): xmlXPathFunction; EXTDECL; external xsltlib;
+function xsltUnregisterExtModuleFunction(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltRegisterExtModule: function(const URI: xmlCharPtr; initFunc: xsltExtInitFunction; shutdownFunc: xsltExtShutdownFunction): cint; EXTDECL;
+  xsltRegisterExtModuleFull: function(const URI: xmlCharPtr; initFunc: xsltExtInitFunction; shutdownFunc: xsltExtShutdownFunction; styleInitFunc: xsltStyleExtInitFunction; styleShutdownFunc: xsltStyleExtShutdownFunction): cint; EXTDECL;
+  xsltUnregisterExtModule: function(const URI: xmlCharPtr): cint; EXTDECL;
+  xsltGetExtData: function(ctxt: xsltTransformContextPtr; const URI: xmlCharPtr): Pointer; EXTDECL;
+  xsltStyleGetExtData: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): Pointer; EXTDECL;
+{$IFDEF XSLT_REFACTORED}
+  xsltStyleStylesheetLevelGetExtData: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): Pointer; EXTDECL;
+{$ENDIF}
+  xsltShutdownCtxtExts: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltShutdownExts: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltXPathGetTransformContext: function(ctxt: xmlXPathParserContextPtr): xsltTransformContextPtr; EXTDECL;
+
+(*
+ * extension functions
+ *)
+  xsltRegisterExtModuleFunction: function(const name: xmlCharPtr; const URI: xmlCharPtr; &function: xmlXPathFunction): cint; EXTDECL;
+  xsltExtModuleFunctionLookup: function(const name: xmlCharPtr; const URI: xmlCharPtr): xmlXPathFunction; EXTDECL;
+  xsltUnregisterExtModuleFunction: function(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF TYPE}
+(*
+ * extension elements
+ *)
+  xsltPreComputeFunction = function(style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction): xsltElemPreCompPtr; EXTDECL;
+{$ENDIF}
+
+{$IFDEF FUNCTION}
+function xsltNewElemPreComp(style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction): xsltElemPreCompPtr; EXTDECL; external xsltlib;
+procedure xsltInitElemPreComp(comp: xsltElemPreCompPtr; style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction; freeFunc: xsltElemPreCompDeallocator); EXTDECL; external xsltlib;
+function xsltRegisterExtModuleElement(const name: xmlCharPtr; const URI: xmlCharPtr; precomp: xsltPreComputeFunction; transform: xsltTransformFunction): cint; EXTDECL; external xsltlib;
+function xsltExtElementLookup(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr): xsltTransformFunction; EXTDECL; external xsltlib;
+function xsltExtModuleElementLookup(const name: xmlCharPtr; const URI: xmlCharPtr): xsltTransformFunction; EXTDECL; external xsltlib;
+function xsltExtModuleElementPreComputeLookup(const name: xmlCharPtr; const URI: xmlCharPtr): xsltPreComputeFunction; EXTDECL; external xsltlib;
+function xsltUnregisterExtModuleElement(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltNewElemPreComp: function(style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction): xsltElemPreCompPtr; EXTDECL;
+  xsltInitElemPreComp: procedure(comp: xsltElemPreCompPtr; style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction; freeFunc: xsltElemPreCompDeallocator); EXTDECL;
+  xsltRegisterExtModuleElement: function(const name: xmlCharPtr; const URI: xmlCharPtr; precomp: xsltPreComputeFunction; transform: xsltTransformFunction): cint; EXTDECL;
+  xsltExtElementLookup: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr): xsltTransformFunction; EXTDECL;
+  xsltExtModuleElementLookup: function(const name: xmlCharPtr; const URI: xmlCharPtr): xsltTransformFunction; EXTDECL;
+  xsltExtModuleElementPreComputeLookup: function(const name: xmlCharPtr; const URI: xmlCharPtr): xsltPreComputeFunction; EXTDECL;
+  xsltUnregisterExtModuleElement: function(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF TYPE}
+(*
+ * top-level elements
+ *)
+  xsltTopLevelFunction = procedure(style: xsltStylesheetPtr; inst: xmlNodePtr); EXTDECL;
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+function xsltRegisterExtModuleTopLevel(const name: xmlCharPtr; const URI: xmlCharPtr; &function: xsltTopLevelFunction): cint; EXTDECL; external xsltlib;
+function xsltExtModuleTopLevelLookup(const name: xmlCharPtr; const URI: xmlCharPtr): xsltTopLevelFunction; EXTDECL; external xsltlib;
+function xsltUnregisterExtModuleTopLevel(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+
+(* These 2 functions are deprecated for use within modules. *)
+function xsltRegisterExtFunction(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr; &function: xmlXPathFunction): cint; EXTDECL; external xsltlib;
+function xsltRegisterExtElement(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr; &function: xsltTransformFunction): cint; EXTDECL; external xsltlib;
+
+(*
+ * Extension Prefix handling API.
+ * Those are used by the XSLT (pre)processor.
+ *)
+function xsltRegisterExtPrefix(style: xsltStylesheetPtr; const prefix: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltCheckExtPrefix(style: xsltStylesheetPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltCheckExtURI(style: xsltStylesheetPtr; const URI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltInitCtxtExts(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+procedure xsltFreeCtxtExts(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+procedure xsltFreeExts(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+function xsltPreComputeExtModuleElement(style: xsltStylesheetPtr; inst: xmlNodePtr): xsltElemPreCompPtr; EXTDECL; external xsltlib;
+
+(*
+ * Extension Infos access.
+ * Used by exslt initialisation
+ *)
+function xsltGetExtInfo(style: xsltStylesheetPtr; const URI: xmlCharPtr): xmlHashTablePtr; EXTDECL; external xsltlib;
+
+(**
+ * Test of the extension module API
+ *)
+procedure xsltRegisterTestModule; EXTDECL; external xsltlib;
+procedure xsltDebugDumpExtensions(output: Pointer {FILE * }); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltRegisterExtModuleTopLevel: function(const name: xmlCharPtr; const URI: xmlCharPtr; &function: xsltTopLevelFunction): cint; EXTDECL;
+  xsltExtModuleTopLevelLookup: function(const name: xmlCharPtr; const URI: xmlCharPtr): xsltTopLevelFunction; EXTDECL;
+  xsltUnregisterExtModuleTopLevel: function(const name: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL;
+
+(* These 2 functions are deprecated for use within modules. *)
+  xsltRegisterExtFunction: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr; &function: xmlXPathFunction): cint; EXTDECL;
+  xsltRegisterExtElement: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const URI: xmlCharPtr; &function: xsltTransformFunction): cint; EXTDECL;
+
+(*
+ * Extension Prefix handling API.
+ * Those are used by the XSLT (pre)processor.
+ *)
+  xsltRegisterExtPrefix: function(style: xsltStylesheetPtr; const prefix: xmlCharPtr; const URI: xmlCharPtr): cint; EXTDECL;
+  xsltCheckExtPrefix: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): cint; EXTDECL;
+  xsltCheckExtURI: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): cint; EXTDECL;
+  xsltInitCtxtExts: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltFreeCtxtExts: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltFreeExts: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltPreComputeExtModuleElement: function(style: xsltStylesheetPtr; inst: xmlNodePtr): xsltElemPreCompPtr; EXTDECL;
+
+(*
+ * Extension Infos access.
+ * Used by exslt initialisation
+ *)
+  xsltGetExtInfo: function(style: xsltStylesheetPtr; const URI: xmlCharPtr): xmlHashTablePtr; EXTDECL;
+
+(**
+ * Test of the extension module API
+ *)
+  xsltRegisterTestModule: procedure; EXTDECL;
+  xsltDebugDumpExtensions: procedure(output: Pointer {FILE * }); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+

+ 55 - 0
packages/libxml/src/extra.inc

@@ -0,0 +1,55 @@
+(*
+ * Summary: interface for the non-standard features
+ * Description: implement some extension outside the XSLT namespace
+ *              but not EXSLT with is in a different library.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF CONST}
+  (**
+   * XSLT_LIBXSLT_NAMESPACE:
+   *
+   * This is the libxslt namespace for specific extensions.
+   *)
+  XSLT_LIBXSLT_NAMESPACE = 'http://xmlsoft.org/XSLT/namespace';
+
+  (**
+   * XSLT_SAXON_NAMESPACE:
+   *
+   * This is Michael Kay's Saxon processor namespace for extensions.
+   *)
+  XSLT_SAXON_NAMESPACE = 'http://icl.com/saxon';
+
+  (**
+   * XSLT_XT_NAMESPACE:
+   *
+   * This is James Clark's XT processor namespace for extensions.
+   *)
+  XSLT_XT_NAMESPACE = 'http://www.jclark.com/xt';
+
+  (**
+   * XSLT_XALAN_NAMESPACE:
+   *
+   * This is the Apache project XALAN processor namespace for extensions.
+   *)
+  XSLT_XALAN_NAMESPACE = 'org.apache.xalan.xslt.extensions.Redirect';
+{$ENDIF} {CONST}
+
+{$IFDEF FUNCTION}
+procedure xsltFunctionNodeSet(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltDebug(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltRegisterExtras(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+procedure xsltRegisterAllExtras; EXTDECL; external xsltlib;
+{$ENDIF FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltFunctionNodeSet: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltDebug: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltRegisterExtras: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltRegisterAllExtras: procedure; EXTDECL;
+{$ENDIF FUNCTIONVAR}
+
+

+ 84 - 0
packages/libxml/src/fpcfunctions.inc

@@ -0,0 +1,84 @@
+
+procedure fpcxmlFree(mem: pointer); EXTDECL;
+begin
+  FreeMem(mem);
+end;
+
+function fpcxmlMalloc(size: csize_t): pointer; EXTDECL;
+begin
+  GetMem(Result, size);
+end;
+
+function fpcxmlRealloc(mem: pointer; size: csize_t): pointer; EXTDECL;
+begin
+  Result := mem;
+  ReallocMem(Result, size);
+end;
+
+function fpcxmlStrdup(str: PAnsiChar): PAnsiChar; EXTDECL;
+var
+  L: SizeInt;
+begin
+  L := Length(str) + 1;
+  Getmem(Result, L);
+  if Result <> nil then
+    Move(str^, Result^, L);
+end;
+
+procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); EXTDECL;
+begin
+  writeln('struct error');
+end;
+
+{$IFDEF NO_EXTERNAL_VARS}
+function GetxmlMalloc: xmlMallocFunc; inline;
+begin
+  Result := varxmlMalloc^;
+end;
+
+procedure SetxmlMalloc(AValue: xmlMallocFunc); inline;
+begin
+  varxmlMalloc^ := AValue;
+end;
+
+function GetxmlMallocAtomic: xmlMallocFunc; inline;
+begin
+  Result := varxmlMallocAtomic^;
+end;
+
+procedure SetxmlMallocAtomic(AValue: xmlMallocFunc); inline;
+begin
+  varxmlMallocAtomic^ := AValue;
+end;
+
+function GetxmlRealloc: xmlReallocFunc; inline;
+begin
+  Result := varxmlRealloc^;
+end;
+
+procedure SetxmlRealloc(AValue: xmlReallocFunc); inline;
+begin
+  varxmlRealloc^ := AValue;
+end;
+
+function GetxmlFree: xmlFreeFunc; inline;
+begin
+  Result := varxmlFree^;
+end;
+
+procedure SetxmlFree(AValue: xmlFreeFunc); inline;
+begin
+  varxmlFree^ := AValue;
+end;
+
+function GetxmlMemStrdup: xmlStrdupFunc; inline;
+begin
+  Result := varxmlMemStrdup^;
+end;
+
+procedure SetxmlMemStrdup(AValue: xmlStrdupFunc); inline;
+begin
+  varxmlMemStrdup^ := AValue;
+end;
+{$ENDIF}
+

+ 69 - 0
packages/libxml/src/functions.inc

@@ -0,0 +1,69 @@
+(*
+ * Summary: interface for the XSLT functions not from XPath
+ * Description: a set of extra functions coming from XSLT but not in XPath
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard and Bjorn Reese <[email protected]>
+ *)
+
+(**
+ * XSLT_REGISTER_FUNCTION_LOOKUP:
+ *
+ * Registering macro, not general purpose at all but used in different modules.
+ *
+#define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt)			\
+    xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt,		\
+	xsltXPathFunctionLookup,				\
+	(void * )(ctxt->xpathCtxt));
+*)
+
+{$IFDEF FUNCTION}
+function xsltXPathFunctionLookup(vctxt: Pointer; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathFunction; EXTDECL; external xsltlib;
+
+(*
+ * Interfaces for the functions implementations.
+ *)
+
+procedure xsltDocumentFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltKeyFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltUnparsedEntityURIFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltFormatNumberFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltGenerateIdFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltSystemPropertyFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltElementAvailableFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+procedure xsltFunctionAvailableFunction(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL; external xsltlib;
+
+(*
+ * And the registration
+ *)
+
+procedure xsltRegisterAllFunctions(ctxt: xmlXPathContextPtr); EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltXPathFunctionLookup: function(vctxt: Pointer; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathFunction; EXTDECL;
+
+(*
+ * Interfaces for the functions implementations.
+ *)
+
+  xsltDocumentFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltKeyFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltUnparsedEntityURIFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltFormatNumberFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltGenerateIdFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltSystemPropertyFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltElementAvailableFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xsltFunctionAvailableFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+
+(*
+ * And the registration
+ *)
+
+  xsltRegisterAllFunctions: procedure(ctxt: xmlXPathContextPtr); EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}
+
+

+ 385 - 79
packages/libxml/src/globals.inc

@@ -24,6 +24,11 @@ procedure xmlInitGlobals; EXTDECL; external xml2lib;
 procedure xmlCleanupGlobals; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlInitGlobals: procedure; EXTDECL;
+  xmlCleanupGlobals: procedure; EXTDECL;
+{$ENDIF}
+
 {$IFDEF TYPE}
   xmlParserInputBufferCreateFilenameFunc = function(URI: PAnsiChar; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
   xmlOutputBufferCreateFilenameFunc = function(URI: PAnsiChar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; EXTDECL;
@@ -34,6 +39,11 @@ function xmlParserInputBufferCreateFilenameDefault(func: xmlParserInputBufferCre
 function xmlOutputBufferCreateFilenameDefault(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlParserInputBufferCreateFilenameDefault: function(func: xmlParserInputBufferCreateFilenameFunc): xmlParserInputBufferCreateFilenameFunc; EXTDECL;
+  xmlOutputBufferCreateFilenameDefault: function(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; EXTDECL;
+{$ENDIF}
+
 (*
  * Externally global symbols which need to be protected for backwards
  * compatibility support.
@@ -86,6 +96,8 @@ function xmlOutputBufferCreateFilenameDefault(func: xmlOutputBufferCreateFilenam
 
     xmlParserInputBufferCreateFilenameValue : xmlParserInputBufferCreateFilenameFunc;
     xmlOutputBufferCreateFilenameValue      : xmlOutputBufferCreateFilenameFunc;
+
+    xmlStructuredErrorContext               : pointer;
   end;
 {$ENDIF}
 
@@ -99,8 +111,8 @@ function xmlThrDefRegisterNodeDefault(func: xmlRegisterNodeFunc): xmlRegisterNod
 function xmlDeregisterNodeDefault(func: xmlRegisterNodeFunc): xmlDeregisterNodeFunc; EXTDECL; external xml2lib;
 function xmlThrDefDeregisterNodeDefault(func: xmlRegisterNodeFunc): xmlDeregisterNodeFunc; EXTDECL; external xml2lib;
 
-function xmlDeregisterNodeDefault(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; EXTDECL; external xml2lib;
-function xmlThrDefDeregisterNodeDefault(func: xmlParserInputBufferCreateFilenameFunc): xmlParserInputBufferCreateFilenameFunc; EXTDECL; external xml2lib;
+function xmlThrDefOutputBufferCreateFilenameDefault(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; EXTDECL; external xml2lib;
+function xmlThrDefParserInputBufferCreateFilenameDefault(func: xmlParserInputBufferCreateFilenameFunc): xmlParserInputBufferCreateFilenameFunc; EXTDECL; external xml2lib;
 
 (** DOC_DISABLE *)
 (*
@@ -113,83 +125,6 @@ function xmlThrDefDeregisterNodeDefault(func: xmlParserInputBufferCreateFilename
  *    - xmlFree
  *)
 
-{$IFDEF LIBXML_THREAD_ALLOC_ENABLED}
-{$IFDEF LIBXML_THREAD_ENABLED}
-function __xmlMalloc: xmlMallocFuncPtr; EXTDECL; external xml2lib;
-{$DEFINE xmlMalloc := __xmlMalloc()^ }
-{$ELSE}
-var
-  xmlMalloc: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-{$ENDIF}
-
-{$IFDEF LIBXML_THREAD_ENABLED}
-function __xmlMallocAtomic: xmlMallocFuncPtr; EXTDECL; external xml2lib;
-#define xmlMallocAtomic ( *(__xmlMallocAtomic()))
-{$ELSE}
-var
-  xmlMallocAtomic: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-{$ENDIF}
-
-{$IFDEF LIBXML_THREAD_ENABLED}
-function __xmlRealloc: xmlReallocFuncPtr; EXTDECL; external xml2lib;
-#define xmlRealloc ( *(__xmlRealloc()))
-{$ELSE}
-var
-  xmlRealloc: xmlReallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-{$ENDIF}
-
-{$IFDEF LIBXML_THREAD_ENABLED}
-function __xmlFree: xmlFreeFuncPtr; EXTDECL; external xml2lib;
-#define xmlFree ( *(__xmlFree()))
-{$ELSE}
-var
-  xmlFree: xmlFreeFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-{$ENDIF}
-
-{$IFDEF LIBXML_THREAD_ENABLED}
-function __xmlMemStrdup: xmlStrdupFuncPtr; EXTDECL; external xml2lib;
-#define xmlMemStrdup ( *(__xmlMemStrdup()))
-{$ELSE}
-var
-  xmlMemStrdup: xmlStrdupFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
-{$ENDIF}
-
-{$ELSE} (* !LIBXML_THREAD_ALLOC_ENABLED *)
-{$IFDEF NO_EXTERNAL_VARS}
-var
-  varxmlMalloc: PxmlMallocFunc;
-  varxmlMallocAtomic: PxmlMallocFunc;
-  varxmlRealloc: PxmlReallocFunc;
-  varxmlFree: PxmlFreeFunc;
-  varxmlMemStrdup: PxmlStrdupFunc;
-
-function GetxmlMalloc: xmlMallocFunc; inline;
-procedure SetxmlMalloc(AValue: xmlMallocFunc); inline;
-function GetxmlMallocAtomic: xmlMallocFunc; inline;
-procedure SetxmlMallocAtomic(AValue: xmlMallocFunc); inline;
-function GetxmlRealloc: xmlReallocFunc; inline;
-procedure SetxmlRealloc(AValue: xmlReallocFunc); inline;
-function GetxmlFree: xmlFreeFunc; inline;
-procedure SetxmlFree(AValue: xmlFreeFunc); inline;
-function GetxmlMemStrdup: xmlStrdupFunc; inline;
-procedure SetxmlMemStrdup(AValue: xmlStrdupFunc); inline;
-
-property xmlMalloc: xmlMallocFunc read GetxmlMalloc write SetxmlMalloc;
-property xmlMallocAtomic: xmlMallocFunc read GetxmlMallocAtomic write SetxmlMallocAtomic;
-property xmlRealloc: xmlReallocFunc read GetxmlRealloc write SetxmlRealloc;
-property xmlFree: xmlFreeFunc read GetxmlFree write SetxmlFree;
-property xmlMemStrdup: xmlStrdupFunc read GetxmlMemStrdup write SetxmlMemStrdup;
-
-{$ELSE}
-var
-  xmlMalloc: xmlMallocFunc; cvar; external;
-  xmlMallocAtomic: xmlMallocFunc; cvar; external;
-  xmlRealloc: xmlReallocFunc; cvar; external;
-  xmlFree: xmlFreeFunc; cvar; external;
-  xmlMemStrdup: xmlStrdupFunc; cvar; external;
-{$ENDIF}
-{$ENDIF} (* LIBXML_THREAD_ALLOC_ENABLED *)
-
 {$IFDEF LIBXML_DOCB_ENABLED}
 function __docbDefaultSAXHandler: xmlSAXHandlerV1Ptr; EXTDECL; external xml2lib;
 {$IFDEF LIBXML_THREAD_ENABLED}
@@ -484,3 +419,374 @@ var
 {$ENDIF}
 
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlInitializeGlobalState: procedure(gs: xmlGlobalStatePtr); EXTDECL;
+  xmlThrDefSetGenericErrorFunc: procedure(ctx: pointer; handler: xmlGenericErrorFunc); EXTDECL;
+  xmlThrDefSetStructuredErrorFunc: procedure(ctx: pointer; handler: xmlStructuredErrorFunc); EXTDECL;
+
+  xmlRegisterNodeDefault: function(func: xmlRegisterNodeFunc): xmlRegisterNodeFunc; EXTDECL;
+  xmlThrDefRegisterNodeDefault: function(func: xmlRegisterNodeFunc): xmlRegisterNodeFunc; EXTDECL;
+  xmlDeregisterNodeDefault: function(func: xmlRegisterNodeFunc): xmlDeregisterNodeFunc; EXTDECL;
+  xmlThrDefDeregisterNodeDefault: function(func: xmlRegisterNodeFunc): xmlDeregisterNodeFunc; EXTDECL;
+
+  xmlThrDefOutputBufferCreateFilenameDefault: function(func: xmlOutputBufferCreateFilenameFunc): xmlOutputBufferCreateFilenameFunc; EXTDECL;
+  xmlThrDefParserInputBufferCreateFilenameDefault: function(func: xmlParserInputBufferCreateFilenameFunc): xmlParserInputBufferCreateFilenameFunc; EXTDECL;
+
+(** DOC_DISABLE *)
+(*
+ * In general the memory allocation entry points are not kept
+ * thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED
+ *    - xmlMalloc
+ *    - xmlMallocAtomic
+ *    - xmlRealloc
+ *    - xmlMemStrdup
+ *    - xmlFree
+ *)
+
+{$IFDEF LIBXML_DOCB_ENABLED}
+  __docbDefaultSAXHandler: function: xmlSAXHandlerV1Ptr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE docbDefaultSAXHandler := __docbDefaultSAXHandler()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  docbDefaultSAXHandler: xmlSAXHandlerV1; cvar; external;
+{$ENDIF}
+{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LIBXML_HTML_ENABLED}
+  __htmlDefaultSAXHandler: function: xmlSAXHandlerV1Ptr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE htmlDefaultSAXHandler := __htmlDefaultSAXHandler()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  htmlDefaultSAXHandler: xmlSAXHandlerV1; cvar; external;
+{$ENDIF}
+{$ENDIF}
+{$ENDIF}
+
+  __xmlLastError: function: xmlErrorPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlLastError := __xmlLastError()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlLastError: xmlError; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+(*
+ * Everything starting from the line below is
+ * Automatically generated by build_glob.py.
+ * Do not modify the previous line.
+ *)
+
+  __oldXMLWDcompatibility: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE oldXMLWDcompatibility := __oldXMLWDcompatibility()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  oldXMLWDcompatibility: cint; cvar; external;
+  {$ENDIF}
+{$ENDIF}
+
+  __xmlBufferAllocScheme: function: xmlBufferAllocationSchemePtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlBufferAllocScheme := __xmlBufferAllocScheme()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlBufferAllocScheme: xmlBufferAllocationScheme; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefBufferAllocScheme: function(v: xmlBufferAllocationScheme): xmlBufferAllocationScheme; EXTDECL;
+
+  __xmlDefaultBufferSize: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlDefaultBufferSize := __xmlDefaultBufferSize()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlDefaultBufferSize: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefDefaultBufferSize: function(v: cint): cint; EXTDECL;
+
+  __xmlDefaultSAXHandler: function: xmlSAXHandlerV1Ptr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlDefaultSAXHandler := __xmlDefaultSAXHandler()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlDefaultSAXHandler: xmlSAXHandlerV1; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlDefaultSAXLocator: function: xmlSAXLocatorPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlDefaultSAXLocator := __xmlDefaultSAXLocator()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlDefaultSAXLocator: xmlSAXLocator; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlDoValidityCheckingDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlDoValidityCheckingDefaultValue := __xmlDoValidityCheckingDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlDoValidityCheckingDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefDoValidityCheckingDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlGenericError: function: xmlGenericErrorFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlGenericError := __xmlGenericError()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlGenericError: xmlGenericErrorFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlStructuredError: function: xmlStructuredErrorFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlStructuredError := __xmlStructuredError()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlStructuredError: xmlStructuredErrorFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlGenericErrorContext: function: ppointer; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlGenericErrorContext := __xmlGenericErrorContext()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlGenericErrorContext: pointer; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlGetWarningsDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlGetWarningsDefaultValue := __xmlGetWarningsDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlGetWarningsDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefGetWarningsDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlIndentTreeOutput: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlIndentTreeOutput := __xmlIndentTreeOutput()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlIndentTreeOutput: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefIndentTreeOutput: function(v: cint): cint; EXTDECL;
+
+  __xmlTreeIndentString: function: PPAnsiChar; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlTreeIndentString := __xmlTreeIndentString()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlTreeIndentString: PAnsiChar; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefTreeIndentString: function(v: PAnsiChar): PAnsiChar; EXTDECL;
+
+  __xmlKeepBlanksDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlKeepBlanksDefaultValue := __xmlKeepBlanksDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlKeepBlanksDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefKeepBlanksDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlLineNumbersDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlLineNumbersDefaultValue := __xmlLineNumbersDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlLineNumbersDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefLineNumbersDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlLoadExtDtdDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlLoadExtDtdDefaultValue := __xmlLoadExtDtdDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlLoadExtDtdDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefLoadExtDtdDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlParserDebugEntities: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlParserDebugEntities := __xmlParserDebugEntities()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlParserDebugEntities: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefParserDebugEntities: function(v: cint): cint; EXTDECL;
+
+  __xmlParserVersion: function: PPAnsiChar; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlParserVersion := __xmlParserVersion()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlParserVersion: PAnsiChar; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlPedanticParserDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlPedanticParserDefaultValue := __xmlPedanticParserDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlPedanticParserDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefPedanticParserDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlSaveNoEmptyTags: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlSaveNoEmptyTags := __xmlSaveNoEmptyTags()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlSaveNoEmptyTags: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefSaveNoEmptyTags: function(v: cint): cint; EXTDECL;
+
+  __xmlSubstituteEntitiesDefaultValue: function: pcint; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlSubstituteEntitiesDefaultValue := __xmlSubstituteEntitiesDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlSubstituteEntitiesDefaultValue: cint; cvar; external;
+{$ENDIF}
+{$ENDIF}
+  xmlThrDefSubstituteEntitiesDefaultValue: function(v: cint): cint; EXTDECL;
+
+  __xmlRegisterNodeDefaultValue: function: xmlRegisterNodeFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlRegisterNodeDefaultValue := __xmlRegisterNodeDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlRegisterNodeDefaultValue: xmlRegisterNodeFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlDeregisterNodeDefaultValue: function: xmlDeregisterNodeFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlDeregisterNodeDefaultValue := __xmlDeregisterNodeDefaultValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlDeregisterNodeDefaultValue: xmlDeregisterNodeFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlParserInputBufferCreateFilenameValue: function: xmlParserInputBufferCreateFilenameFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlParserInputBufferCreateFilenameValue := __xmlParserInputBufferCreateFilenameValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlParserInputBufferCreateFilenameValue: xmlParserInputBufferCreateFilenameFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+  __xmlOutputBufferCreateFilenameValue: function: xmlOutputBufferCreateFilenameFuncPtr; EXTDECL;
+{$IFDEF LIBXML_THREAD_ENABLED}
+{$DEFINE xmlOutputBufferCreateFilenameValue := __xmlOutputBufferCreateFilenameValue()^ }
+{$ELSE}
+{$IFNDEF NO_EXTERNAL_VARS}
+  xmlOutputBufferCreateFilenameValue: xmlOutputBufferCreateFilenameFunc; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
+{$ENDIF}
+
+{$IFDEF EXTVAR}
+{$IFDEF LIBXML_THREAD_ALLOC_ENABLED}
+{$IFDEF LIBXML_THREAD_ENABLED}
+function __xmlMalloc: xmlMallocFuncPtr; EXTDECL;
+{$DEFINE xmlMalloc := __xmlMalloc()^ }
+{$ELSE}
+var
+  xmlMalloc: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LIBXML_THREAD_ENABLED}
+function __xmlMallocAtomic: xmlMallocFuncPtr; EXTDECL;
+#define xmlMallocAtomic ( *(__xmlMallocAtomic()))
+{$ELSE}
+var
+  xmlMallocAtomic: xmlMallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LIBXML_THREAD_ENABLED}
+function __xmlRealloc: xmlReallocFuncPtr; EXTDECL;
+#define xmlRealloc ( *(__xmlRealloc()))
+{$ELSE}
+var
+  xmlRealloc: xmlReallocFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LIBXML_THREAD_ENABLED}
+function __xmlFree: xmlFreeFuncPtr; EXTDECL;
+#define xmlFree ( *(__xmlFree()))
+{$ELSE}
+var
+  xmlFree: xmlFreeFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$ENDIF}
+
+{$IFDEF LIBXML_THREAD_ENABLED}
+function __xmlMemStrdup: xmlStrdupFuncPtr; EXTDECL;
+#define xmlMemStrdup ( *(__xmlMemStrdup()))
+{$ELSE}
+var
+  xmlMemStrdup: xmlStrdupFunc; {$IFNDEF NO_EXTERNAL_VARS}cvar; external;{$ENDIF}
+{$ENDIF}
+
+{$ELSE} (* !LIBXML_THREAD_ALLOC_ENABLED *)
+{$IFDEF NO_EXTERNAL_VARS}
+var
+  varxmlMalloc: PxmlMallocFunc;
+  varxmlMallocAtomic: PxmlMallocFunc;
+  varxmlRealloc: PxmlReallocFunc;
+  varxmlFree: PxmlFreeFunc;
+  varxmlMemStrdup: PxmlStrdupFunc;
+
+function GetxmlMalloc: xmlMallocFunc; inline;
+procedure SetxmlMalloc(AValue: xmlMallocFunc); inline;
+function GetxmlMallocAtomic: xmlMallocFunc; inline;
+procedure SetxmlMallocAtomic(AValue: xmlMallocFunc); inline;
+function GetxmlRealloc: xmlReallocFunc; inline;
+procedure SetxmlRealloc(AValue: xmlReallocFunc); inline;
+function GetxmlFree: xmlFreeFunc; inline;
+procedure SetxmlFree(AValue: xmlFreeFunc); inline;
+function GetxmlMemStrdup: xmlStrdupFunc; inline;
+procedure SetxmlMemStrdup(AValue: xmlStrdupFunc); inline;
+
+property xmlMalloc: xmlMallocFunc read GetxmlMalloc write SetxmlMalloc;
+property xmlMallocAtomic: xmlMallocFunc read GetxmlMallocAtomic write SetxmlMallocAtomic;
+property xmlRealloc: xmlReallocFunc read GetxmlRealloc write SetxmlRealloc;
+property xmlFree: xmlFreeFunc read GetxmlFree write SetxmlFree;
+property xmlMemStrdup: xmlStrdupFunc read GetxmlMemStrdup write SetxmlMemStrdup;
+
+{$ELSE}
+var
+  xmlMalloc: xmlMallocFunc; cvar; external;
+  xmlMallocAtomic: xmlMallocFunc; cvar; external;
+  xmlRealloc: xmlReallocFunc; cvar; external;
+  xmlFree: xmlFreeFunc; cvar; external;
+  xmlMemStrdup: xmlStrdupFunc; cvar; external;
+{$ENDIF}
+{$ENDIF} (* LIBXML_THREAD_ALLOC_ENABLED *)
+{$ENDIF}

+ 55 - 7
packages/libxml/src/hash.inc

@@ -79,6 +79,7 @@
 function xmlHashCreate(size: cint): xmlHashTablePtr; EXTDECL; external xml2lib;
 function xmlHashCreateDict(size: cint; dict: xmlDictPtr): xmlHashTablePtr; EXTDECL; external xml2lib;
 procedure xmlHashFree(table: xmlHashTablePtr; f: xmlHashDeallocator); EXTDECL; external xml2lib;
+procedure xmlHashDefaultDeallocator(entry: Pointer;const name: xmlCharPtr); EXTDECL; external xml2lib;
 
 (*
  * Add a new entry to the hash table.
@@ -88,7 +89,7 @@ function xmlHashUpdateEntry(table: xmlHashTablePtr; name: xmlCharPtr; userdata:
 function xmlHashAddEntry2(table: xmlHashTablePtr; name, name2: xmlCharPtr; userdata: pointer): cint; EXTDECL; external xml2lib;
 function xmlHashUpdateEntry2(table: xmlHashTablePtr; name, name2: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL; external xml2lib;
 function xmlHashAddEntry3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; userdata: pointer): cint; EXTDECL; external xml2lib;
-function xmlHashUpdateEntry2(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL; external xml2lib;
+function xmlHashUpdateEntry3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL; external xml2lib;
 
 (*
  * Remove an entry from the hash table.
@@ -100,9 +101,9 @@ function xmlHashRemoveEntry3(table: xmlHashTablePtr; name, name2, name3: xmlChar
 (*
  * Retrieve the userdata.
  *)
-function xmlHashRemoveEntry(table: xmlHashTablePtr; name: xmlCharPtr): pointer; EXTDECL; external xml2lib;
-function xmlHashRemoveEntry2(table: xmlHashTablePtr; name, name2: xmlCharPtr): pointer; EXTDECL; external xml2lib;
-function xmlHashRemoveEntry3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr): pointer; EXTDECL; external xml2lib;
+function xmlHashLookup(table: xmlHashTablePtr; name: xmlCharPtr): pointer; EXTDECL; external xml2lib;
+function xmlHashLookup2(table: xmlHashTablePtr; name, name2: xmlCharPtr): pointer; EXTDECL; external xml2lib;
+function xmlHashLookup3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr): pointer; EXTDECL; external xml2lib;
 function xmlHashQLookup(table: xmlHashTablePtr; name, prefix: xmlCharPtr): pointer; EXTDECL; external xml2lib;
 function xmlHashQLookup2(table: xmlHashTablePtr; name, prefix, name2, prefix2: xmlCharPtr): pointer; EXTDECL; external xml2lib;
 function xmlHashQLookup3(table: xmlHashTablePtr; name, prefix, name2, prefix2, name3, prefix3: xmlCharPtr): pointer; EXTDECL; external xml2lib;
@@ -113,7 +114,54 @@ function xmlHashQLookup3(table: xmlHashTablePtr; name, prefix, name2, prefix2, n
 function xmlHashCopy(table: xmlHashTablePtr; f: xmlHashCopier): xmlHashTablePtr; EXTDECL; external xml2lib;
 function xmlHashSize(table: xmlHashTablePtr): cint; EXTDECL; external xml2lib;
 procedure xmlHashScan(table: xmlHashTablePtr; f: xmlHashScanner; data: pointer); EXTDECL; external xml2lib;
-procedure xmlHashScan(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScanner; data: pointer); EXTDECL; external xml2lib;
+procedure xmlHashScan3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScanner; data: pointer); EXTDECL; external xml2lib;
 procedure xmlHashScanFull(table: xmlHashTablePtr; f: xmlHashScannerFull; data: pointer); EXTDECL; external xml2lib;
-procedure xmlHashScanFull(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScannerFull; data: pointer); EXTDECL; external xml2lib;
-{$ENDIF}
+procedure xmlHashScanFull3(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScannerFull; data: pointer); EXTDECL; external xml2lib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Constructor and destructor.
+ *)
+  xmlHashCreate: function(size: cint): xmlHashTablePtr; EXTDECL;
+  xmlHashCreateDict: function(size: cint; dict: xmlDictPtr): xmlHashTablePtr; EXTDECL;
+  xmlHashFree: procedure(table: xmlHashTablePtr; f: xmlHashDeallocator); EXTDECL;
+  xmlHashDefaultDeallocator: procedure(entry: Pointer;const name: xmlCharPtr); EXTDECL;
+
+(*
+ * Add a new entry to the hash table.
+ *)
+  xmlHashAddEntry: function(table: xmlHashTablePtr; name: xmlCharPtr; userdata: pointer): cint; EXTDECL;
+  xmlHashUpdateEntry: function(table: xmlHashTablePtr; name: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL;
+  xmlHashAddEntry2: function(table: xmlHashTablePtr; name, name2: xmlCharPtr; userdata: pointer): cint; EXTDECL;
+  xmlHashUpdateEntry2: function(table: xmlHashTablePtr; name, name2: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL;
+  xmlHashAddEntry3: function(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; userdata: pointer): cint; EXTDECL;
+  xmlHashUpdateEntry3: function(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; userdata: pointer; f: xmlHashDeallocator): cint; EXTDECL;
+
+(*
+ * Remove an entry from the hash table.
+ *)
+  xmlHashRemoveEntry: function(table: xmlHashTablePtr; name: xmlCharPtr; f: xmlHashDeallocator): cint; EXTDECL;
+  xmlHashRemoveEntry2: function(table: xmlHashTablePtr; name, name2: xmlCharPtr; f: xmlHashDeallocator): cint; EXTDECL;
+  xmlHashRemoveEntry3: function(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashDeallocator): cint; EXTDECL;
+
+(*
+ * Retrieve the userdata.
+ *)
+  xmlHashLookup: function(table: xmlHashTablePtr; name: xmlCharPtr): pointer; EXTDECL;
+  xmlHashLookup2: function(table: xmlHashTablePtr; name, name2: xmlCharPtr): pointer; EXTDECL;
+  xmlHashLookup3: function(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr): pointer; EXTDECL;
+  xmlHashQLookup: function(table: xmlHashTablePtr; name, prefix: xmlCharPtr): pointer; EXTDECL;
+  xmlHashQLookup2: function(table: xmlHashTablePtr; name, prefix, name2, prefix2: xmlCharPtr): pointer; EXTDECL;
+  xmlHashQLookup3: function(table: xmlHashTablePtr; name, prefix, name2, prefix2, name3, prefix3: xmlCharPtr): pointer; EXTDECL;
+
+(*
+ * Helpers.
+ *)
+  xmlHashCopy: function(table: xmlHashTablePtr; f: xmlHashCopier): xmlHashTablePtr; EXTDECL;
+  xmlHashSize: function(table: xmlHashTablePtr): cint; EXTDECL;
+  xmlHashScan: procedure(table: xmlHashTablePtr; f: xmlHashScanner; data: pointer); EXTDECL;
+  xmlHashScan3: procedure(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScanner; data: pointer); EXTDECL;
+  xmlHashScanFull: procedure(table: xmlHashTablePtr; f: xmlHashScannerFull; data: pointer); EXTDECL;
+  xmlHashScanFull3: procedure(table: xmlHashTablePtr; name, name2, name3: xmlCharPtr; f: xmlHashScannerFull; data: pointer); EXTDECL;
+{$ENDIF}

+ 61 - 0
packages/libxml/src/imports.inc

@@ -0,0 +1,61 @@
+(*
+ * Summary: interface for the XSLT import support
+ * Description: macros and fuctions needed to implement and
+ *              access the import tree
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+(**
+ * XSLT_GET_IMPORT_PTR:
+ *
+ * A macro to import pointers from the stylesheet cascading order.
+ */
+#define XSLT_GET_IMPORT_PTR(res, style, name) {			\
+    xsltStylesheetPtr st = style;				\
+    res = NULL;							\
+    while (st != NULL) {					\
+	if (st->name != NULL) { res = st->name; break; }	\
+	st = xsltNextImport(st);				\
+    }}
+
+/**
+ * XSLT_GET_IMPORT_INT:
+ *
+ * A macro to import intergers from the stylesheet cascading order.
+ */
+#define XSLT_GET_IMPORT_INT(res, style, name) {			\
+    xsltStylesheetPtr st = style;				\
+    res = -1;							\
+    while (st != NULL) {					\
+	if (st->name != -1) { res = st->name; break; }	\
+	st = xsltNextImport(st);				\
+    }}
+*)
+
+{$IFDEF FUNCTION}
+(*
+ * Module interfaces
+ *)
+function xsltParseStylesheetImport(style: xsltStylesheetPtr; cur: xmlNodePtr): cint; EXTDECL; external xsltlib;
+function xsltParseStylesheetInclude(style: xsltStylesheetPtr; cur: xmlNodePtr): cint; EXTDECL; external xsltlib;
+function xsltNextImport(style: xsltStylesheetPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+function xsltNeedElemSpaceHandling(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+function xsltFindElemSpaceHandling(ctxt: xsltTransformContextPtr; node: xmlNodePtr): cint; EXTDECL; external xsltlib;
+function xsltFindTemplate(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr): xsltTemplatePtr; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Module interfaces
+ *)
+  xsltParseStylesheetImport: function(style: xsltStylesheetPtr; cur: xmlNodePtr): cint; EXTDECL;
+  xsltParseStylesheetInclude: function(style: xsltStylesheetPtr; cur: xmlNodePtr): cint; EXTDECL;
+  xsltNextImport: function(style: xsltStylesheetPtr): xsltStylesheetPtr; EXTDECL;
+  xsltNeedElemSpaceHandling: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltFindElemSpaceHandling: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr): cint; EXTDECL;
+  xsltFindTemplate: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr): xsltTemplatePtr; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+

+ 35 - 0
packages/libxml/src/keys.inc

@@ -0,0 +1,35 @@
+(*
+ * Summary:  interface for the key matching used in key() and template matches.
+ * Description: implementation of the key mechanims.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF CONST}
+(**
+ * NODE_IS_KEYED:
+ *
+ * check for bit 15 set
+ *)
+  NODE_IS_KEYED = 1 shr 15;
+{$ENDIF} {CONST}
+
+{$IFDEF FUNCTION}
+function xsltAddKey(style: xsltStylesheetPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr; const match: xmlCharPtr; const use: xmlCharPtr; inst: xmlNodePtr): cint; EXTDECL; external xsltlib;
+function xsltGetKey(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr; const value: xmlCharPtr): xmlNodeSetPtr; EXTDECL; external xsltlib;
+procedure xsltInitCtxtKeys(ctxt: xsltTransformContextPtr; doc: xsltDocumentPtr); EXTDECL; external xsltlib;
+procedure xsltFreeKeys(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+procedure xsltFreeDocumentKeys(doc: xsltDocumentPtr); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltAddKey: function(style: xsltStylesheetPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr; const match: xmlCharPtr; const use: xmlCharPtr; inst: xmlNodePtr): cint; EXTDECL;
+  xsltGetKey: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const nameURI: xmlCharPtr; const value: xmlCharPtr): xmlNodeSetPtr; EXTDECL;
+  xsltInitCtxtKeys: procedure(ctxt: xsltTransformContextPtr; doc: xsltDocumentPtr); EXTDECL;
+  xsltFreeKeys: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltFreeDocumentKeys: procedure(doc: xsltDocumentPtr); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+

+ 168 - 1
packages/libxml/src/libxmlparser.inc

@@ -778,7 +778,14 @@
   XML_PARSE_NOXINCNODE = (1 shl 15);(* do not generate XINCLUDE START/END nodes *)
   XML_PARSE_COMPACT   = (1 shl 16); (* compact small text nodes); no modification of
                                    the tree allowed afterwards (will possibly
-           crash if you try to modify the tree) *)
+                                   crash if you try to modify the tree) *)
+  XML_PARSE_OLD10     = (1 shl 17);(* parse using XML-1.0 before update 5 *)
+  XML_PARSE_NOBASEFIX = (1 shl 18);(* do not fixup XINCLUDE xml:base uris *)
+  XML_PARSE_HUGE      = (1 shl 19);(* relax any hardcoded limit from the parser *)
+  XML_PARSE_OLDSAX    = (1 shl 20);(* parse using SAX2 interface before 2.7.0 *)
+  XML_PARSE_IGNORE_ENC= (1 shl 21);(* ignore internal document encoding hint *)
+  XML_PARSE_BIG_LINES = (1 shl 22);(* Store big lines numbers in text PSVI field *)
+
 {$ENDIF}
 
 {$IFDEF TYPE}
@@ -814,6 +821,8 @@
     XML_WITH_DEBUG_MEM = 29,
     XML_WITH_DEBUG_RUN = 30,
     XML_WITH_ZLIB = 31,
+    XML_WITH_ICU = 32,
+    XML_WITH_LZMA = 33,
     XML_WITH_NONE = 99999 (* just to be sure of allocation size *)
   );
 
@@ -977,3 +986,161 @@ function xmlCtxtReadIO(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; ioc
 function xmlHasFeature(feature: xmlFeature): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Init/Cleanup
+ *)
+  xmlInitParser: procedure; EXTDECL;
+  xmlCleanupParser: procedure; EXTDECL;
+
+(*
+ * Input functions
+ *)
+  xmlParserInputRead: function(_in: xmlParserInputPtr; len: cint): cint; EXTDECL;
+  xmlParserInputGrow: function(_in: xmlParserInputPtr; len: cint): cint; EXTDECL;
+
+(*
+ * Basic parsing Interfaces
+ *)
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseDoc: function(cur: xmlCharPtr): xmlDocPtr; EXTDECL;
+  xmlParseFile: function(filename: PAnsiChar): xmlDocPtr; EXTDECL;
+  xmlParseMemory: function(buffer: PAnsiChar; size: cint): xmlDocPtr; EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlSubstituteEntitiesDefault: function(val: cint): cint; EXTDECL;
+  xmlKeepBlanksDefault: function(val: cint): cint; EXTDECL;
+  xmlStopParser: procedure(ctxt: xmlParserCtxtPtr); EXTDECL;
+  xmlPedanticParserDefault: function(val: cint): cint; EXTDECL;
+  xmlLineNumbersDefault: function(val: cint): cint; EXTDECL;
+
+{$IFDEF LIBXML_SAX1_ENABLED}
+(*
+ * Recovery mode
+ *)
+  xmlRecoverDoc: function(cur: xmlCharPtr): xmlDocPtr; EXTDECL;
+  xmlRecoverMemory: function(buffer: PAnsiChar; size: cint): xmlDocPtr; EXTDECL;
+  xmlRecoverFile: function(filename: PAnsiChar): xmlDocPtr; EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+
+(*
+ * Less common routines and SAX interfaces
+ *)
+  xmlParseDocument: function(ctxt: xmlParserCtxtPtr): cint; EXTDECL;
+  xmlParseExtParsedEnt: function(ctxt: xmlParserCtxtPtr): cint; EXTDECL;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSAXUserParseFile: function(sax: xmlSAXHandlerPtr; user_data: pointer; filename: PAnsiChar): cint; EXTDECL;
+  xmlSAXUserParseMemory: function(sax: xmlSAXHandlerPtr; user_data: pointer; buffer: PAnsiChar; size: cint): cint; EXTDECL;
+  xmlSAXParseDoc: function(sax: xmlSAXHandlerPtr; cur: xmlCharPtr; recovery: cint): xmlDocPtr; EXTDECL;
+  xmlSAXParseMemory: function(sax: xmlSAXHandlerPtr; buffer: PAnsiChar; size: cint; recovery: cint): xmlDocPtr; EXTDECL;
+  xmlSAXParseMemoryWithData: function(sax: xmlSAXHandlerPtr; buffer: PAnsiChar; size: cint; recovery: cint; data: pointer): xmlDocPtr; EXTDECL;
+  xmlSAXParseFile: function(sax: xmlSAXHandlerPtr; filename: PAnsiChar; recovery: cint): xmlDocPtr; EXTDECL;
+  xmlSAXParseFileWithData: function(sax: xmlSAXHandlerPtr; filename: PAnsiChar; recovery: cint; data: pointer): xmlDocPtr; EXTDECL;
+  xmlSAXParseEntity: function(sax: xmlSAXHandlerPtr; filename: PAnsiChar): xmlDocPtr; EXTDECL;
+  xmlParseEntity: function(filename: PAnsiChar): xmlDocPtr; EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+
+{$IFDEF LIBXML_VALID_ENABLED}
+  xmlSAXParseDTD: function(sax: xmlSAXHandlerPtr; ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL;
+  xmlParseDTD: function(ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL;
+  xmlIOParseDTD: function(sax: xmlSAXHandlerPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding): xmlDtdPtr; EXTDECL;
+{$ENDIF} (* LIBXML_VALID_ENABLE *)
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseBalancedChunkMemory: function(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer; depth: cint; _string: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlParseInNodeContext: function(node: xmlNodePtr; data: PAnsiChar; datalen, options: cint; lst: xmlNodePtrPtr): xmlParserErrors; EXTDECL;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseBalancedChunkMemoryRecover: function(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer;
+    depth: cint; _string: xmlCharPtr; lst: xmlNodePtrPtr; recover: cint): cint; EXTDECL;
+  xmlParseExternalEntity: function(doc: xmlDocPtr; sax: xmlSAXHandlerPtr; user_data: pointer;
+    depth: cint; URL, ID: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL;
+
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlParseCtxtExternalEntity: function(ctx: xmlParserCtxtPtr; URL, ID: xmlCharPtr; lst: xmlNodePtrPtr): cint; EXTDECL;
+
+(*
+ * Parser contexts handling.
+ *)
+  xmlNewParserCtxt: function: xmlParserCtxtPtr; EXTDECL;
+  xmlInitParserCtxt: function(ctxt: xmlParserCtxtPtr): cint; EXTDECL;
+  xmlClearParserCtxt: procedure(ctxt: xmlParserCtxtPtr); EXTDECL;
+  xmlFreeParserCtxt: procedure(ctxt: xmlParserCtxtPtr); EXTDECL;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSetupParserForBuffer: procedure(ctxt: xmlParserCtxtPtr; buffer: xmlCharPtr; filename: PAnsiChar); EXTDECL;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlCreateDocParserCtxt: function(cur: xmlCharPtr): xmlParserCtxtPtr; EXTDECL;
+
+{$IFDEF LIBXML_LEGACY_ENABLED}
+(*
+ * Reading/setting optional parsing features.
+ *)
+  xmlGetFeaturesList: function(var len: cint; var result: PAnsiChar): cint; EXTDECL;
+  xmlGetFeature: function(ctxt: xmlParserCtxtPtr; name: PAnsiChar; result: pointer): cint; EXTDECL;
+  xmlSetFeature: function(ctxt: xmlParserCtxtPtr; name: PAnsiChar; value: pointer): cint; EXTDECL;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+
+{$IFDEF LIBXML_PUSH_ENABLED}
+(*
+ * Interfaces for the Push mode.
+ *)
+  xmlCreatePushParserCtxt: function(sax: xmlSAXHandlerPtr; user_data: pointer; chunk: PAnsiChar; size: cint; filename: PAnsiChar): xmlParserCtxtPtr; EXTDECL;
+  xmlParseChunk: function(ctxt: xmlParserCtxtPtr; chunk: PAnsiChar; size, terminate: cint): cint; EXTDECL;
+{$ENDIF} (* LIBXML_PUSH_ENABLED *)
+
+(*
+ * Special I/O mode.
+ *)
+  xmlCreateIOParserCtxt: function(sax: xmlSAXHandlerPtr; user_data: pointer; ioread: xmlInputReadCallback;
+    ioclose: xmlInputCloseCallback; ioctx: pointer; enc: xmlCharEncoding): xmlParserCtxtPtr; EXTDECL;
+  xmlNewIOInputStream: function(ctxt: xmlParserCtxtPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding): xmlParserInputPtr; EXTDECL;
+
+(*
+ * Node infos.
+ *)
+  xmlParserFindNodeInfo: function(ctxt: xmlParserCtxtPtr; node: xmlNodePtr): xmlParserNodeInfoPtr; EXTDECL;
+  xmlInitNodeInfoSeq: procedure(seq: xmlParserNodeInfoSeqPtr); EXTDECL;
+  xmlClearNodeInfoSeq: procedure(seq: xmlParserNodeInfoSeqPtr); EXTDECL;
+  xmlParserFindNodeInfoIndex: function(seq: xmlParserNodeInfoSeqPtr; node: xmlNodePtr): culong; EXTDECL;
+  xmlParserAddNodeInfo: procedure(ctxt: xmlParserCtxtPtr; info: xmlParserNodeInfoPtr); EXTDECL;
+
+(*
+ * External entities handling actually implemented in xmlIO.
+ *)
+  xmlSetExternalEntityLoader: procedure(f: xmlExternalEntityLoader); EXTDECL;
+  xmlGetExternalEntityLoader: function(): xmlExternalEntityLoader; EXTDECL;
+  xmlLoadExternalEntity: function(URL, ID: PAnsiChar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; EXTDECL;
+
+(*
+ * Index lookup, actually implemented in the encoding module
+ *)
+  xmlByteConsumed: function(ctxt: xmlParserCtxtPtr): culong; EXTDECL;
+
+(*
+ * New set of simpler/more flexible APIs
+ *)
+  xmlCtxtReset: procedure(ctxt: xmlParserCtxtPtr); EXTDECL;
+  xmlCtxtResetPush: function(ctxt: xmlParserCtxtPtr; chunk: PAnsiChar; size: cint; filename, encoding: PAnsiChar): cint; EXTDECL;
+  xmlCtxtUseOptions: function(ctxt: xmlParserCtxtPtr; options: cint): cint; EXTDECL;
+  xmlReadDoc: function(cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlReadFile: function(filename, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlReadMemory: function(buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlReadFd: function(fd: cint; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlReadIO: function(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlCtxtReadDoc: function(ctxt: xmlParserCtxtPtr; cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlCtxtReadFile: function(ctxt: xmlParserCtxtPtr; filename, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlCtxtReadMemory: function(ctxt: xmlParserCtxtPtr; buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlCtxtReadFd: function(ctxt: xmlParserCtxtPtr; fd: cint; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+  xmlCtxtReadIO: function(ctxt: xmlParserCtxtPtr; ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: PAnsiChar; URL, encoding: PAnsiChar; options: cint): xmlDocPtr; EXTDECL;
+
+(*
+ * Library wide options
+ *)
+(**
+ * xmlFeature:
+ *
+ * Used to examine the existance of features that can be enabled
+ * or disabled at compile-time.
+ * They used to be called XML_FEATURE_xxx but this clashed with Expat
+ *)
+  xmlHasFeature: function(feature: xmlFeature): cint; EXTDECL;
+{$ENDIF}
+

+ 38 - 2
packages/libxml/src/list.inc

@@ -78,8 +78,44 @@ procedure xmlListWalk(l: xmlListPtr; walker: xmlListWalker; user: pointer); EXTD
 procedure xmlListReverseWalk(l: xmlListPtr; walker: xmlListWalker; user: pointer); EXTDECL; external xml2lib;
 procedure xmlListMerge(l1, l2: xmlListPtr); EXTDECL; external xml2lib;
 function xmlListDup(old: xmlListPtr): xmlListPtr; EXTDECL; external xml2lib;
-function xmlListDup(cur, old: xmlListPtr): cint; EXTDECL; external xml2lib;
+function xmlListCopy(cur, old: xmlListPtr): cint; EXTDECL; external xml2lib;
 
 (* Link operators *)
 function xmlLinkGetData(lk: xmlLinkPtr): cint; EXTDECL; external xml2lib;
-{$ENDIF}
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(* Creation/Deletion *)
+  xmlListCreate: function(deallocator: xmlListDeallocator; compare: xmlListDataCompare): xmlListPtr; EXTDECL;
+  xmlListDelete: procedure(l: xmlListPtr); EXTDECL;
+
+(* Basic Operators *)
+  xmlListSearch: function(l: xmlListPtr; data: pointer): pointer; EXTDECL;
+  xmlListReverseSearch: function(l: xmlListPtr; data: pointer): pointer; EXTDECL;
+  xmlListInsert: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListAppend: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListRemoveFirst: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListRemoveLast: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListRemoveAll: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListClear: procedure(l: xmlListPtr); EXTDECL;
+  xmlListEmpty: function(l: xmlListPtr): cint; EXTDECL;
+  xmlListFront: function(l: xmlListPtr): xmlLinkPtr; EXTDECL;
+  xmlListEnd: function(l: xmlListPtr): xmlLinkPtr; EXTDECL;
+  xmlListSize: function(l: xmlListPtr): cint; EXTDECL;
+  xmlListPopFront: procedure (l: xmlListPtr); EXTDECL;
+  xmlListPopBack: procedure(l: xmlListPtr); EXTDECL;
+  xmlListPushFront: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+  xmlListPushBack: function(l: xmlListPtr; data: pointer): cint; EXTDECL;
+
+(* Advanced Operators *)
+  xmlListReverse: procedure(l: xmlListPtr); EXTDECL;
+  xmlListSort: procedure(l: xmlListPtr); EXTDECL;
+  xmlListWalk: procedure(l: xmlListPtr; walker: xmlListWalker; user: pointer); EXTDECL;
+  xmlListReverseWalk: procedure(l: xmlListPtr; walker: xmlListWalker; user: pointer); EXTDECL;
+  xmlListMerge: procedure(l1, l2: xmlListPtr); EXTDECL;
+  xmlListDup: function(old: xmlListPtr): xmlListPtr; EXTDECL;
+  xmlListCopy: function(cur, old: xmlListPtr): cint; EXTDECL;
+
+(* Link operators *)
+  xmlLinkGetData: function(lk: xmlLinkPtr): cint; EXTDECL;
+{$ENDIF}

+ 191 - 0
packages/libxml/src/macros.inc

@@ -0,0 +1,191 @@
+
+(*
+ * macros from xmlversion.inc
+ *)
+
+procedure LIBXML_TEST_VERSION;
+begin
+  xmlCheckVersion(LIBXML_VERSION);
+end;
+
+
+(*
+ * macros from xmlversion.inc
+ *)
+
+
+(*
+ * macros from chvalid.inc
+ *)
+
+function xmlIsBaseChar_ch(c: cint): cbool;
+begin
+  Result :=
+    ((c >= $41) and (c <= $5A)) or
+    ((c >= $61) and (c <= $7A)) or
+    ((c >= $C0) and (c <= $D6)) or
+    ((c >= $D8) and (c <= $F6)) or
+     (c >= $F8);
+end;
+
+function xmlIsBaseCharQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsBaseChar_ch(c)
+  else
+    Result := xmlCharInRange(c, __xmlIsBaseCharGroup);
+end;
+
+function xmlIsBlank_ch(c: cint): cbool;
+begin
+  Result := (c = $20) or ((c >= $9) and (c <= $A)) or (c = $D);
+end;
+
+function xmlIsBlankQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsBaseChar_ch(c)
+  else
+    Result := false;
+end;
+
+function xmlIsChar_ch(c: cint): cbool;
+begin
+  Result := ((c >= $9) and (c <= $A)) or (c = $D) or (c >= $20);
+end;
+
+function xmlIsCharQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsChar_ch(c)
+  else
+    Result :=
+          ((c >= $000100) and (c <= $00D7FF)) or
+          ((c >= $00E000) and (c <= $00FFFD)) or
+          ((c >= $010000) and (c <= $10FFFF));
+end;
+
+function xmlIsCombiningQ(c: cint): cbool;
+begin
+    if c < $100 then
+    Result := false
+  else
+    Result := xmlCharInRange(c, __xmlIsCombiningGroup);
+end;
+
+function xmlIsDigit_ch(c: cint): cbool;
+begin
+  Result := (c >= $30) and (c <= $39);
+end;
+
+function xmlIsDigitQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsDigit_ch(c)
+  else
+    Result := xmlCharInRange(c, __xmlIsDigitGroup);
+end;
+
+function xmlIsExtender_ch(c: cint): cbool;
+begin
+  Result := c = $B7;
+end;
+
+function xmlIsExtenderQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsExtender_ch(c)
+  else
+    Result := xmlCharInRange(c, __xmlIsExtenderGroup);
+end;
+
+function xmlIsIdeographicQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := false
+  else
+    Result :=
+      ((c >= $4E00) and (c <= $9FA5)) or
+       (c  = $3007) or
+      ((c >= $3021) and (c <= $3029));
+end;
+
+function xmlIsPubidChar_ch(c: cint): cbool;
+begin
+  if (c >= 0) and (c <= 255) then
+    Result := __xmlIsPubidChar_tab^[c]
+  else
+    Result := false;
+end;
+
+function xmlIsPubidCharQ(c: cint): cbool;
+begin
+  if c < $100 then
+    Result := xmlIsPubidChar_ch(c)
+  else
+    Result := false;
+end;
+
+
+(*
+ * macros from HTMLparser.inc
+ *)
+
+function htmlDefaultSubelement(elt: htmlElemDescPtr): PAnsiChar;
+begin
+  Result := elt^.defaultsubelt;
+end;
+
+function htmlElementAllowedHereDesc(parent: htmlElemDescPtr; elt: htmlElemDescPtr): cint;
+begin
+  Result := htmlElementAllowedHere(parent, xmlCharPtr(elt^.name));
+end;
+
+function htmlRequiredAttrs(elt: htmlElemDescPtr): PPAnsiChar;
+begin
+  Result := elt^.attrs_req;
+end;
+
+
+(*
+ * macros from tree.inc
+ *)
+
+function XML_GET_CONTENT(n: pointer): xmlCharPtr;
+begin
+  if xmlNodePtr(n)^._type = XML_ELEMENT_NODE then
+    Result := nil
+  else
+    Result := xmlNodePtr(n)^.content;
+end;
+
+function XML_GET_LINE(n: Pointer): clong; inline;
+begin
+  Result := xmlGetLineNo(xmlNodePtr(n));
+end;
+
+(*
+ * macros from xpath.inc
+ *)
+
+function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint;
+begin
+  if assigned(ns) then
+    Result := ns^.nodeNr
+  else
+    Result := 0;
+end;
+
+function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr;
+begin
+  if assigned(ns) and (index >= 0) and (index < ns^.nodeNr) then
+    Result := ns^.nodeTab[index]
+  else
+    Result := nil;
+end;
+
+function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean;
+begin
+  Result := not assigned(ns) or (ns^.nodeNr = 0) or (ns^.nodeTab = nil);
+end;
+

+ 46 - 0
packages/libxml/src/namespaces.inc

@@ -0,0 +1,46 @@
+(*
+ * Summary: interface for the XSLT namespace handling
+ * Description: set of function easing the processing and generation
+ *              of namespace nodes in XSLT.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+
+(*
+ * Used within nsAliases hashtable when the default namespace is required
+ * but it's not been explicitly defined
+ *)
+
+{$IFDEF CONST}
+  (**
+   * UNDEFINED_DEFAULT_NS:
+   *
+   * Special value for undefined namespace, internal
+   *)
+  UNDEFINED_DEFAULT_NS = clong(-1);
+{$ENDIF} {CONST}
+
+{$IFDEF FUNCTION}
+procedure xsltNamespaceAlias(style: xsltStylesheetPtr; node: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltGetNamespace(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; ns: xmlNsPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL; external xsltlib;
+function xsltGetPlainNamespace(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; ns: xmlNsPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL; external xsltlib;
+function xsltGetSpecialNamespace(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; const URI: xmlCharPtr; const prefix: xmlCharPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL; external xsltlib;
+function xsltCopyNamespace(ctxt: xsltTransformContextPtr; elem: xmlNodePtr; ns: xmlNsPtr): xmlNsPtr; EXTDECL; external xsltlib;
+function xsltCopyNamespaceList(ctxt: xsltTransformContextPtr; node: xmlNodePtr; cur: xmlNsPtr): xmlNsPtr; EXTDECL; external xsltlib;
+procedure xsltFreeNamespaceAliasHashes(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltNamespaceAlias: procedure(style: xsltStylesheetPtr; node: xmlNodePtr); EXTDECL;
+  xsltGetNamespace: function(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; ns: xmlNsPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL;
+  xsltGetPlainNamespace: function(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; ns: xmlNsPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL;
+  xsltGetSpecialNamespace: function(ctxt: xsltTransformContextPtr; cur: xmlNodePtr; const URI: xmlCharPtr; const prefix: xmlCharPtr; &out: xmlNodePtr): xmlNsPtr; EXTDECL;
+  xsltCopyNamespace: function(ctxt: xsltTransformContextPtr; elem: xmlNodePtr; ns: xmlNsPtr): xmlNsPtr; EXTDECL;
+  xsltCopyNamespaceList: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr; cur: xmlNsPtr): xmlNsPtr; EXTDECL;
+  xsltFreeNamespaceAliasHashes: procedure(style: xsltStylesheetPtr); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+

+ 45 - 1
packages/libxml/src/nanoftp.inc

@@ -77,7 +77,7 @@ function xmlNanoFTPCheckResponse(ctx: pointer): cint; EXTDECL; external xml2lib;
  * CD/DIR/GET handlers.
  *)
 function xmlNanoFTPCwd(ctx: pointer; directory: PAnsiChar): cint; EXTDECL; external xml2lib;
-function xmlNanoFTPGetResponse(ctx: pointer; _file: PAnsiChar): cint; EXTDECL; external xml2lib;
+function xmlNanoFTPDele(ctx: pointer; _file: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlNanoFTPGetConnection(ctx: pointer): cint; EXTDECL; external xml2lib;
 function xmlNanoFTPCloseConnection(ctx: pointer): cint; EXTDECL; external xml2lib;
 function xmlNanoFTPList(ctx: pointer; callback: ftpListCallback; userData: pointer; filename: PAnsiChar): cint; EXTDECL; external xml2lib;
@@ -85,5 +85,49 @@ function xmlNanoFTPGetSocket(ctx: pointer; filename: PAnsiChar): cint; EXTDECL;
 function xmlNanoFTPGet(ctx: pointer; callback: ftpDataCallback; userData: pointer; filename: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlNanoFTPRead(ctx: pointer; dest: pointer; len: cint): cint; EXTDECL; external xml2lib;
 
+{$ENDIF}
+{$IFDEF FUNCTIONVAR}
+(*
+ * Init
+ *)
+  xmlNanoFTPInit: procedure; EXTDECL;
+  xmlNanoFTPCleanup: procedure; EXTDECL;
+
+(*
+ * Creating/freeing contexts.
+ *)
+  xmlNanoFTPNewCtxt: function(URL: PAnsiChar): pointer; EXTDECL;
+  xmlNanoFTPFreeCtxt: procedure(ctx: pointer); EXTDECL;
+  xmlNanoFTPConnectTo: function(server: PAnsiChar; port: cint): pointer; EXTDECL;
+
+(*
+ * Opening/closing session connections.
+ *)
+  xmlNanoFTPOpen: function(URL: PAnsiChar): pointer; EXTDECL;
+  xmlNanoFTPConnect: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPClose: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPQuit: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPScanProxy: procedure(URL: PAnsiChar); EXTDECL;
+  xmlNanoFTPProxy: procedure(host: PAnsiChar; port: cint; user, passwd: PAnsiChar; _type: cint); EXTDECL;
+  xmlNanoFTPUpdateURL: function(ctx: pointer; URL: PAnsiChar): cint; EXTDECL;
+
+(*
+ * Rather internal commands.
+ *)
+  xmlNanoFTPGetResponse: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPCheckResponse: function(ctx: pointer): cint; EXTDECL;
+
+(*
+ * CD/DIR/GET handlers.
+ *)
+  xmlNanoFTPCwd: function(ctx: pointer; directory: PAnsiChar): cint; EXTDECL;
+  xmlNanoFTPDele: function(ctx: pointer; _file: PAnsiChar): cint; EXTDECL;
+  xmlNanoFTPGetConnection: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPCloseConnection: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoFTPList: function(ctx: pointer; callback: ftpListCallback; userData: pointer; filename: PAnsiChar): cint; EXTDECL;
+  xmlNanoFTPGetSocket: function(ctx: pointer; filename: PAnsiChar): cint; EXTDECL;
+  xmlNanoFTPGet: function(ctx: pointer; callback: ftpDataCallback; userData: pointer; filename: PAnsiChar): cint; EXTDECL;
+  xmlNanoFTPRead: function(ctx: pointer; dest: pointer; len: cint): cint; EXTDECL;
+
 {$ENDIF}
 {$ENDIF} (* LIBXML_FTP_ENABLED *)

+ 23 - 1
packages/libxml/src/nanohttp.inc

@@ -14,7 +14,7 @@
 procedure xmlNanoHTTPInit; EXTDECL; external xml2lib;
 procedure xmlNanoHTTPCleanup; EXTDECL; external xml2lib;
 procedure xmlNanoHTTPScanProxy(URL: PAnsiChar); EXTDECL; external xml2lib;
-function xmlNanoHTTPCleanup(URL, filename: PAnsiChar; contentType: PPAnsiChar): cint; EXTDECL; external xml2lib;
+function xmlNanoHTTPFetch(URL, filename: PAnsiChar; contentType: PPAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlNanoHTTPMethod(URL, method, input: PAnsiChar; contentType: PPAnsiChar; headers: PAnsiChar; ilen: cint): pointer; EXTDECL; external xml2lib;
 function xmlNanoHTTPMethodRedir(URL, method, input: PAnsiChar; contentType, redir: PPAnsiChar; headers: PAnsiChar; ilen: cint): pointer; EXTDECL; external xml2lib;
 function xmlNanoHTTPOpen(URL: PAnsiChar; contentType: PPAnsiChar): pointer; EXTDECL; external xml2lib;
@@ -32,4 +32,26 @@ function xmlNanoHTTPSave(ctx: pointer; filename: PAnsiChar): cint; EXTDECL; exte
 procedure xmlNanoHTTPClose(ctx: pointer); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlNanoHTTPInit: procedure; EXTDECL;
+  xmlNanoHTTPCleanup: procedure; EXTDECL;
+  xmlNanoHTTPScanProxy: procedure(URL: PAnsiChar); EXTDECL;
+  xmlNanoHTTPFetch: function(URL, filename: PAnsiChar; contentType: PPAnsiChar): cint; EXTDECL;
+  xmlNanoHTTPMethod: function(URL, method, input: PAnsiChar; contentType: PPAnsiChar; headers: PAnsiChar; ilen: cint): pointer; EXTDECL;
+  xmlNanoHTTPMethodRedir: function(URL, method, input: PAnsiChar; contentType, redir: PPAnsiChar; headers: PAnsiChar; ilen: cint): pointer; EXTDECL;
+  xmlNanoHTTPOpen: function(URL: PAnsiChar; contentType: PPAnsiChar): pointer; EXTDECL;
+  xmlNanoHTTPOpenRedir: function(URL: PAnsiChar; contentType, redir: PPAnsiChar): pointer; EXTDECL;
+  xmlNanoHTTPReturnCode: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoHTTPAuthHeader: function(ctx: pointer): PAnsiChar; EXTDECL;
+  xmlNanoHTTPRedir: function(ctx: pointer): PAnsiChar; EXTDECL;
+  xmlNanoHTTPContentLength: function(ctx: pointer): cint; EXTDECL;
+  xmlNanoHTTPEncoding: function(ctx: pointer): PAnsiChar; EXTDECL;
+  xmlNanoHTTPMimeType: function(ctx: pointer): PAnsiChar; EXTDECL;
+  xmlNanoHTTPRead: function(ctx: pointer; dest: pointer; len: cint): cint; EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlNanoHTTPSave: function(ctx: pointer; filename: PAnsiChar): cint; EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlNanoHTTPClose: procedure(ctx: pointer); EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_HTTP_ENABLED *)

+ 57 - 0
packages/libxml/src/numbersInternals.inc

@@ -0,0 +1,57 @@
+(*
+ * Summary: Implementation of the XSLT number functions
+ * Description: Implementation of the XSLT number functions
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Bjorn Reese <[email protected]> and Daniel Veillard
+ *)
+
+{$IFDEF TYPE}
+
+(**
+ * xsltNumberData:
+ *
+ * This data structure is just a wrapper to pass xsl:number data in.
+ *)
+  xsltNumberDataPtr = ^xsltNumberData;
+  xsltNumberData = record
+    level: xmlCharPtr;
+    count: xmlCharPtr;
+    from: xmlCharPtr;
+    value: xmlCharPtr;
+    format: xmlCharPtr;
+    has_format: cint;
+    digitsPerGroup: cint;
+    groupingCharacter: cint;
+    groupingCharacterLen: cint;
+    doc: xmlDocPtr;
+    node: xmlNodePtr;
+    countPat: xsltCompMatchPtr;
+    fromPat: xsltCompMatchPtr;
+
+    (*
+     * accelerators
+     *)
+  end;
+
+(**
+ * xsltFormatNumberInfo,:
+ *
+ * This data structure lists the various parameters needed to format numbers.
+ *)
+  xsltFormatNumberInfoPtr = ^xsltFormatNumberInfo;
+
+  xsltFormatNumberInfo = record
+    integer_hash: cint;         (* Number of '#' in integer part *)
+    integer_digits: cint;       (* Number of '0' in integer part *)
+    frac_digits: cint;          (* Number of '0' in fractional part *)
+    frac_hash: cint;            (* Number of '#' in fractional part *)
+    group: cint;                (* Number of chars per display 'group' *)
+    multiplier: cint;           (* Scaling for percent or permille *)
+    add_decimal: Byte;          (* Flag for whether decimal point appears in pattern *)
+    is_multiplier_set: Byte;    (* Flag to catch multiple occurences of percent/permille *)
+    is_negative_pattern: Byte;  (* Flag for processing -ve prefix/suffix *)
+  end;
+
+{$ENDIF} {TYPE}

+ 21 - 1
packages/libxml/src/pattern.inc

@@ -62,4 +62,24 @@ function xmlStreamPop(stream: xmlStreamCtxtPtr): cint; EXTDECL; external xml2lib
 function xmlStreamWantsAnyNode(stream: xmlStreamCtxtPtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
-{$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+{$IFDEF FUNCTIONVAR}
+  xmlFreePattern: procedure(comp: xmlPatternPtr); EXTDECL;
+  xmlFreePatternList: procedure(comp: xmlPatternPtr); EXTDECL;
+  xmlPatterncompile: function(pattern: xmlCharPtr; dict: xmlDictPtr; flags: cint; namespaces: xmlCharPtrPtr): xmlPatternPtr; EXTDECL;
+  xmlPatternMatch: function(comp: xmlPatternPtr; node: xmlNodePtr): cint; EXTDECL;
+
+(* streaming interfaces *)
+  xmlPatternStreamable: function(comp: xmlPatternPtr): cint; EXTDECL;
+  xmlPatternMaxDepth: function(comp: xmlPatternPtr): cint; EXTDECL;
+  xmlPatternMinDepth: function(comp: xmlPatternPtr): cint; EXTDECL;
+  xmlPatternFromRoot: function(comp: xmlPatternPtr): cint; EXTDECL;
+  xmlPatternGetStreamCtxt: function(comp: xmlPatternPtr): xmlStreamCtxtPtr; EXTDECL;
+  xmlFreeStreamCtxt: procedure(stream: xmlStreamCtxtPtr); EXTDECL;
+  xmlStreamPushNode: function(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr; nodeType: cint): cint; EXTDECL;
+  xmlStreamPush: function(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr): cint; EXTDECL;
+  xmlStreamPushAttr: function(stream: xmlStreamCtxtPtr; name, ns: xmlCharPtr): cint; EXTDECL;
+  xmlStreamPop: function(stream: xmlStreamCtxtPtr): cint; EXTDECL;
+  xmlStreamWantsAnyNode: function(stream: xmlStreamCtxtPtr): cint; EXTDECL;
+{$ENDIF}
+
+{$ENDIF} (* LIBXML_PATTERN_ENABLED *)

+ 31 - 0
packages/libxml/src/preproc.inc

@@ -0,0 +1,31 @@
+(*
+ * Summary: precomputing stylesheets
+ * Description: this is the compilation phase, where most of the
+ *              stylesheet is "compiled" into faster to use data.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+
+{$IFDEF FUNCTION}
+(*
+ * Interfaces
+ *)
+function xsltDocumentComp(style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction): xsltElemPreCompPtr; EXTDECL; external xsltlib;
+procedure xsltStylePreCompute(style: xsltStylesheetPtr; inst: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltFreeStylePreComps(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltDocumentComp: function(style: xsltStylesheetPtr; inst: xmlNodePtr; &function: xsltTransformFunction): xsltElemPreCompPtr; EXTDECL;
+  xsltStylePreCompute: procedure(style: xsltStylesheetPtr; inst: xmlNodePtr); EXTDECL;
+  xsltFreeStylePreComps: procedure(style: xsltStylesheetPtr); EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF EXTVAR}
+var
+  xsltExtMarker: xmlCharPtr; external xsltlib;
+
+{$ENDIF}

+ 42 - 1
packages/libxml/src/relaxng.inc

@@ -117,7 +117,7 @@ procedure xmlRelaxNGDumpTree(output: PFILE; schema: xmlRelaxNGPtr); EXTDECL; ext
  *)
 procedure xmlRelaxNGSetValidErrors(ctxt: xmlRelaxNGValidCtxtPtr; err: xmlRelaxNGValidityErrorFunc; warn: xmlRelaxNGValidityWarningFunc; ctx: pointer); EXTDECL; external xml2lib;
 function xmlRelaxNGGetValidErrors(ctxt: xmlRelaxNGValidCtxtPtr; var err: xmlRelaxNGValidityErrorFunc; var warn: xmlRelaxNGValidityWarningFunc; var ctx: pointer): cint; EXTDECL; external xml2lib;
-procedure xmlRelaxNGSetValidErrors(ctxt: xmlRelaxNGValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
+procedure xmlRelaxNGSetValidStructuredErrors(ctxt: xmlRelaxNGValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
 function xmlRelaxNGNewValidCtxt(schema: xmlRelaxNGPtr): xmlRelaxNGValidCtxtPtr; EXTDECL; external xml2lib;
 procedure xmlRelaxNGFreeValidCtxt(ctxt: xmlRelaxNGValidCtxtPtr); EXTDECL; external xml2lib;
 function xmlRelaxNGValidateDoc(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
@@ -130,5 +130,46 @@ function xmlRelaxNGValidatePushCData(ctxt: xmlRelaxNGValidCtxtPtr; data: xmlChar
 function xmlRelaxNGValidatePopElement(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL; external xml2lib;
 function xmlRelaxNGValidateFullElement(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlRelaxNGInitTypes: function: cint; EXTDECL;
+  xmlRelaxNGCleanupTypes: function: cint; EXTDECL;
+
+(*
+ * Interfaces for parsing.
+ *)
+  xmlRelaxNGNewParserCtxt: function(URL: PAnsiChar): xmlRelaxNGParserCtxtPtr; EXTDECL;
+  xmlRelaxNGNewMemParserCtxt: function(buffer: PAnsiChar; size: cint): xmlRelaxNGParserCtxtPtr; EXTDECL;
+  xmlRelaxNGNewDocParserCtxt: function(doc: xmlDocPtr): xmlRelaxNGParserCtxtPtr; EXTDECL;
+  xmlRelaxParserSetFlag: function(ctxt: xmlRelaxNGParserCtxtPtr; flag: cint; doc: xmlDocPtr): cint; EXTDECL;
+  xmlRelaxNGFreeParserCtxt: procedure(ctxt: xmlRelaxNGParserCtxtPtr); EXTDECL;
+  xmlRelaxNGSetParserErrors: procedure(ctxt: xmlRelaxNGParserCtxtPtr; err: xmlRelaxNGValidityErrorFunc; warn: xmlRelaxNGValidityWarningFunc; ctx: pointer); EXTDECL;
+  xmlRelaxNGGetParserErrors: function(ctxt: xmlRelaxNGParserCtxtPtr; var err: xmlRelaxNGValidityErrorFunc; var warn: xmlRelaxNGValidityWarningFunc; var ctx: pointer): cint; EXTDECL;
+  xmlRelaxNGSetParserStructuredErrors: procedure(ctxt: xmlRelaxNGParserCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL;
+  xmlRelaxNGParse: function(ctxt: xmlRelaxNGParserCtxtPtr): xmlRelaxNGPtr; EXTDECL;
+  xmlRelaxNGFree: procedure(schema: xmlRelaxNGPtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlRelaxNGDump: procedure(output: PFILE; schema: xmlRelaxNGPtr); EXTDECL;
+  xmlRelaxNGDumpTree: procedure(output: PFILE; schema: xmlRelaxNGPtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(*
+ * Interfaces for validating
+ *)
+  xmlRelaxNGSetValidErrors: procedure(ctxt: xmlRelaxNGValidCtxtPtr; err: xmlRelaxNGValidityErrorFunc; warn: xmlRelaxNGValidityWarningFunc; ctx: pointer); EXTDECL;
+  xmlRelaxNGGetValidErrors: function(ctxt: xmlRelaxNGValidCtxtPtr; var err: xmlRelaxNGValidityErrorFunc; var warn: xmlRelaxNGValidityWarningFunc; var ctx: pointer): cint; EXTDECL;
+  xmlRelaxNGSetValidStructuredErrors: procedure(ctxt: xmlRelaxNGValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL;
+  xmlRelaxNGNewValidCtxt: function(schema: xmlRelaxNGPtr): xmlRelaxNGValidCtxtPtr; EXTDECL;
+  xmlRelaxNGFreeValidCtxt: procedure(ctxt: xmlRelaxNGValidCtxtPtr); EXTDECL;
+  xmlRelaxNGValidateDoc: function(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL;
+
+(*
+ * Interfaces for progressive validation when possible
+ *)
+  xmlRelaxNGValidatePushElement: function(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL;
+  xmlRelaxNGValidatePushCData: function(ctxt: xmlRelaxNGValidCtxtPtr; data: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlRelaxNGValidatePopElement: function(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL;
+  xmlRelaxNGValidateFullElement: function(ctxt: xmlRelaxNGValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL;
+{$ENDIF}
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
 

+ 58 - 46
packages/libxml/src/schemasInternals.inc

@@ -34,52 +34,52 @@
 
   xmlSchemaValType = (
     XML_SCHEMAS_UNKNOWN = 0,
-    XML_SCHEMAS_STRING,
-    XML_SCHEMAS_NORMSTRING,
-    XML_SCHEMAS_DECIMAL,
-    XML_SCHEMAS_TIME,
-    XML_SCHEMAS_GDAY,
-    XML_SCHEMAS_GMONTH,
-    XML_SCHEMAS_GMONTHDAY,
-    XML_SCHEMAS_GYEAR,
-    XML_SCHEMAS_GYEARMONTH,
-    XML_SCHEMAS_DATE,
-    XML_SCHEMAS_DATETIME,
-    XML_SCHEMAS_DURATION,
-    XML_SCHEMAS_FLOAT,
-    XML_SCHEMAS_DOUBLE,
-    XML_SCHEMAS_BOOLEAN,
-    XML_SCHEMAS_TOKEN,
-    XML_SCHEMAS_LANGUAGE,
-    XML_SCHEMAS_NMTOKEN,
-    XML_SCHEMAS_NMTOKENS,
-    XML_SCHEMAS_NAME,
-    XML_SCHEMAS_QNAME,
-    XML_SCHEMAS_NCNAME,
-    XML_SCHEMAS_ID,
-    XML_SCHEMAS_IDREF,
-    XML_SCHEMAS_IDREFS,
-    XML_SCHEMAS_ENTITY,
-    XML_SCHEMAS_ENTITIES,
-    XML_SCHEMAS_NOTATION,
-    XML_SCHEMAS_ANYURI,
-    XML_SCHEMAS_INTEGER,
-    XML_SCHEMAS_NPINTEGER,
-    XML_SCHEMAS_NINTEGER,
-    XML_SCHEMAS_NNINTEGER,
-    XML_SCHEMAS_PINTEGER,
-    XML_SCHEMAS_INT,
-    XML_SCHEMAS_UINT,
-    XML_SCHEMAS_LONG,
-    XML_SCHEMAS_ULONG,
-    XML_SCHEMAS_SHORT,
-    XML_SCHEMAS_USHORT,
-    XML_SCHEMAS_BYTE,
-    XML_SCHEMAS_UBYTE,
-    XML_SCHEMAS_HEXBINARY,
-    XML_SCHEMAS_BASE64BINARY,
-    XML_SCHEMAS_ANYTYPE,
-    XML_SCHEMAS_ANYSIMPLETYPE
+    XML_SCHEMAS_STRING = 1,
+    XML_SCHEMAS_NORMSTRING = 2,
+    XML_SCHEMAS_DECIMAL = 3,
+    XML_SCHEMAS_TIME = 4,
+    XML_SCHEMAS_GDAY = 5,
+    XML_SCHEMAS_GMONTH = 6,
+    XML_SCHEMAS_GMONTHDAY = 7,
+    XML_SCHEMAS_GYEAR = 8,
+    XML_SCHEMAS_GYEARMONTH = 9,
+    XML_SCHEMAS_DATE = 10,
+    XML_SCHEMAS_DATETIME = 11,
+    XML_SCHEMAS_DURATION = 12,
+    XML_SCHEMAS_FLOAT = 13,
+    XML_SCHEMAS_DOUBLE = 14,
+    XML_SCHEMAS_BOOLEAN = 15,
+    XML_SCHEMAS_TOKEN = 16,
+    XML_SCHEMAS_LANGUAGE = 17,
+    XML_SCHEMAS_NMTOKEN = 18,
+    XML_SCHEMAS_NMTOKENS = 19,
+    XML_SCHEMAS_NAME = 20,
+    XML_SCHEMAS_QNAME = 21,
+    XML_SCHEMAS_NCNAME = 22,
+    XML_SCHEMAS_ID = 23,
+    XML_SCHEMAS_IDREF = 24,
+    XML_SCHEMAS_IDREFS = 25,
+    XML_SCHEMAS_ENTITY = 26,
+    XML_SCHEMAS_ENTITIES = 27,
+    XML_SCHEMAS_NOTATION = 28,
+    XML_SCHEMAS_ANYURI = 29,
+    XML_SCHEMAS_INTEGER = 30,
+    XML_SCHEMAS_NPINTEGER = 31,
+    XML_SCHEMAS_NINTEGER = 32,
+    XML_SCHEMAS_NNINTEGER = 33,
+    XML_SCHEMAS_PINTEGER = 34,
+    XML_SCHEMAS_INT = 35,
+    XML_SCHEMAS_UINT = 36,
+    XML_SCHEMAS_LONG = 37,
+    XML_SCHEMAS_ULONG = 38,
+    XML_SCHEMAS_SHORT = 39,
+    XML_SCHEMAS_USHORT = 40,
+    XML_SCHEMAS_BYTE = 41,
+    XML_SCHEMAS_UBYTE = 42,
+    XML_SCHEMAS_HEXBINARY = 43,
+    XML_SCHEMAS_BASE64BINARY = 44,
+    XML_SCHEMAS_ANYTYPE = 45,
+    XML_SCHEMAS_ANYSIMPLETYPE = 46
   );
 
 (*
@@ -647,6 +647,13 @@
  * the element is a reference to a type
  *)
   XML_SCHEMAS_ELEM_REF                = (1 shl 6);
+(**
+ * XML_SCHEMAS_ELEM_NSDEFAULT:
+ *
+ * allow elements in no namespace
+ * Obsolete, not used anymore.
+ *)
+  XML_SCHEMAS_ELEM_NSDEFAULT          = (1 shl 7);
 (**
  * XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
  *
@@ -917,4 +924,9 @@ procedure xmlSchemaFreeType(_type: xmlSchemaTypePtr); EXTDECL; external xml2lib;
 procedure xmlSchemaFreeWildcard(wildcard: xmlSchemaWildcardPtr); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlSchemaFreeType: procedure(_type: xmlSchemaTypePtr); EXTDECL;
+  xmlSchemaFreeWildcard: procedure(wildcard: xmlSchemaWildcardPtr); EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)

+ 55 - 0
packages/libxml/src/schematron.inc

@@ -97,5 +97,60 @@ function xmlSchematronNewValidCtxt(schema: xmlSchematronPtr; options: cint): xml
 procedure xmlSchematronFreeValidCtxt(ctxt: xmlSchematronValidCtxtPtr); EXTDECL; external xml2lib;
 function xmlSchematronValidateDoc(ctxt: xmlSchematronValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL; external xml2lib;
 
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Interfaces for parsing.
+ *)
+  xmlSchematronNewParserCtxt: function(URL: PAnsiChar): xmlSchematronParserCtxtPtr; EXTDECL;
+  xmlSchematronNewMemParserCtxt: function(buffer: PAnsiChar; size: cint): xmlSchematronParserCtxtPtr; EXTDECL;
+  xmlSchematronNewDocParserCtxt: function(doc: xmlDocPtr): xmlSchematronParserCtxtPtr; EXTDECL;
+  xmlSchematronFreeParserCtxt: procedure(ctxt: xmlSchematronParserCtxtPtr); EXTDECL;
+(*****
+external xml2lib void EXTDECL
+	    xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
+					 xmlSchematronValidityErrorFunc err,
+					 xmlSchematronValidityWarningFunc warn,
+					 void *ctx);
+external xml2lib int EXTDECL
+		xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
+					xmlSchematronValidityErrorFunc * err,
+					xmlSchematronValidityWarningFunc * warn,
+					void **ctx);
+external xml2lib int EXTDECL
+		xmlSchematronIsValid	(xmlSchematronValidCtxtPtr ctxt);
+ *****)
+  xmlSchematronParse: function(ctxt: xmlSchematronParserCtxtPtr): xmlSchematronPtr; EXTDECL;
+  xmlSchematronFree: procedure(schema: xmlSchematronPtr); EXTDECL;
+
+(*
+ * Interfaces for validating
+ *)
+  xmlSchematronSetValidStructuredErrors: procedure(ctxt: xmlSchematronValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL;
+(******
+external xml2lib void EXTDECL
+	    xmlSchematronSetValidErrors	(xmlSchematronValidCtxtPtr ctxt,
+					 xmlSchematronValidityErrorFunc err,
+					 xmlSchematronValidityWarningFunc warn,
+					 void *ctx);
+external xml2lib int EXTDECL
+	    xmlSchematronGetValidErrors	(xmlSchematronValidCtxtPtr ctxt,
+					 xmlSchematronValidityErrorFunc *err,
+					 xmlSchematronValidityWarningFunc *warn,
+					 void **ctx);
+external xml2lib int EXTDECL
+	    xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
+					 int options);
+external xml2lib int EXTDECL
+	    xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
+external xml2lib int EXTDECL
+            xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
+			                 xmlNodePtr elem);
+ *******)
+  xmlSchematronNewValidCtxt: function(schema: xmlSchematronPtr; options: cint): xmlSchematronValidCtxtPtr; EXTDECL;
+  xmlSchematronFreeValidCtxt: procedure(ctxt: xmlSchematronValidCtxtPtr); EXTDECL;
+  xmlSchematronValidateDoc: function(ctxt: xmlSchematronValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL;
+
 {$ENDIF}
 {$ENDIF} (* LIBXML_SCHEMATRON_ENABLED *)

+ 85 - 0
packages/libxml/src/security.inc

@@ -0,0 +1,85 @@
+(*
+ * Summary: interface for the libxslt security framework
+ * Description: the libxslt security framework allow to restrict
+ *              the access to new resources (file or URL) from
+ *              the stylesheet at runtime.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF TYPE}
+  (**
+   * xsltSecurityPref:
+   *
+   * structure to indicate the preferences for security in the XSLT
+   * transformation.
+   *)
+  xsltSecurityPrefs = record end;
+  xsltSecurityPrefsPtr = ^xsltSecurityPrefs;
+
+  (**
+   * xsltSecurityOption:
+   *
+   * the set of option that can be configured
+   *)
+  xsltSecurityOption = (
+    XSLT_SECPREF_READ_FILE = 1,
+    XSLT_SECPREF_WRITE_FILE,
+    XSLT_SECPREF_CREATE_DIRECTORY,
+    XSLT_SECPREF_READ_NETWORK,
+    XSLT_SECPREF_WRITE_NETWORK
+  );
+
+  (**
+   * xsltSecurityCheck:
+   *
+   * User provided function to check the value of a string like a file
+   * path or an URL ...
+   *)
+  xsltSecurityCheck = function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const value: PAnsiChar): cint; EXTDECL;
+
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+(*
+ * Module interfaces
+ *)
+function xsltNewSecurityPrefs: xsltSecurityPrefsPtr; EXTDECL; external xsltlib;
+procedure xsltFreeSecurityPrefs(sec: xsltSecurityPrefsPtr); EXTDECL; external xsltlib;
+function xsltSetSecurityPrefs(sec: xsltSecurityPrefsPtr; option: xsltSecurityOption; func: xsltSecurityCheck): cint; EXTDECL; external xsltlib;
+function xsltGetSecurityPrefs(sec: xsltSecurityPrefsPtr; option: xsltSecurityOption): xsltSecurityCheck; EXTDECL; external xsltlib;
+procedure xsltSetDefaultSecurityPrefs(sec: xsltSecurityPrefsPtr); EXTDECL; external xsltlib;
+function xsltGetDefaultSecurityPrefs: xsltSecurityPrefsPtr; EXTDECL; external xsltlib;
+function xsltSetCtxtSecurityPrefs(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+function xsltSecurityAllow(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const value: PAnsiChar): cint; EXTDECL; external xsltlib;
+function xsltSecurityForbid(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const value: PAnsiChar): cint; EXTDECL; external xsltlib;
+
+(*
+ * internal interfaces
+ *)
+function xsltCheckWrite(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const URL: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltCheckRead(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const URL: xmlCharPtr): cint; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Module interfaces
+ *)
+  xsltNewSecurityPrefs: function: xsltSecurityPrefsPtr; EXTDECL;
+  xsltFreeSecurityPrefs: procedure(sec: xsltSecurityPrefsPtr); EXTDECL;
+  xsltSetSecurityPrefs: function(sec: xsltSecurityPrefsPtr; option: xsltSecurityOption; func: xsltSecurityCheck): cint; EXTDECL;
+  xsltGetSecurityPrefs: function(sec: xsltSecurityPrefsPtr; option: xsltSecurityOption): xsltSecurityCheck; EXTDECL;
+  xsltSetDefaultSecurityPrefs: procedure(sec: xsltSecurityPrefsPtr); EXTDECL;
+  xsltGetDefaultSecurityPrefs: function: xsltSecurityPrefsPtr; EXTDECL;
+  xsltSetCtxtSecurityPrefs: function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltSecurityAllow: function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const value: PAnsiChar): cint; EXTDECL;
+  xsltSecurityForbid: function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const value: PAnsiChar): cint; EXTDECL;
+
+(*
+ * internal interfaces
+ *)
+  xsltCheckWrite: function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const URL: xmlCharPtr): cint; EXTDECL;
+  xsltCheckRead: function(sec: xsltSecurityPrefsPtr; ctxt: xsltTransformContextPtr; const URL: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}

+ 43 - 0
packages/libxml/src/templates.inc

@@ -0,0 +1,43 @@
+(*
+ * Summary: interface for the template processing
+ * Description: This set of routine encapsulates XPath calls
+ *              and Attribute Value Templates evaluation.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF FUNCTION}
+function xsltEvalXPathPredicate(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr; nsList: xmlNsPtrPtr; nsNr: cint): cint; EXTDECL; external xsltlib;
+function xsltEvalTemplateString(ctxt: xsltTransformContextPtr; contextNode: xmlNodePtr; inst: xmlNodePtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltEvalAttrValueTemplate(ctxt: xsltTransformContextPtr; node: xmlNodePtr; const name: xmlCharPtr; const ns: xmlCharPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltEvalStaticAttrValueTemplate(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtr; const ns: xmlCharPtr; found: pcint): xmlCharPtr; EXTDECL; external xsltlib;
+
+(* TODO: this is obviously broken ... the namespaces should be passed too ! *)
+function xsltEvalXPathString(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltEvalXPathStringNs(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr; nsNr: cint; nsList: xmlNsPtrPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltTemplateProcess(ctxt: xsltTransformContextPtr; node: xmlNodePtr): xmlNodePtrPtr; EXTDECL; external xsltlib;
+function xsltAttrListTemplateProcess(ctxt: xsltTransformContextPtr; target: xmlNodePtr; cur: xmlAttrPtr): xmlAttrPtr; EXTDECL; external xsltlib;
+function xsltAttrTemplateProcess(ctxt: xsltTransformContextPtr; target: xmlNodePtr; attr: xmlAttrPtr): xmlAttrPtr; EXTDECL; external xsltlib;
+function xsltAttrTemplateValueProcess(ctxt: xsltTransformContextPtr; const attr: xmlCharPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltAttrTemplateValueProcessNode(ctxt: xsltTransformContextPtr; const str: xmlCharPtr; node: xmlNodePtr): xmlCharPtr; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+
+{$IFDEF FUNCTIONVAR}
+  xsltEvalXPathPredicate: function(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr; nsList: xmlNsPtrPtr; nsNr: cint): cint; EXTDECL;
+  xsltEvalTemplateString: function(ctxt: xsltTransformContextPtr; contextNode: xmlNodePtr; inst: xmlNodePtr): xmlCharPtr; EXTDECL;
+  xsltEvalAttrValueTemplate: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr; const name: xmlCharPtr; const ns: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xsltEvalStaticAttrValueTemplate: function(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtr; const ns: xmlCharPtr; found: pcint): xmlCharPtr; EXTDECL;
+
+  (* TODO: this is obviously broken ... the namespaces should be passed too ! *)
+  xsltEvalXPathString: function(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr): xmlCharPtr; EXTDECL;
+  xsltEvalXPathStringNs: function(ctxt: xsltTransformContextPtr; comp: xmlXPathCompExprPtr; nsNr: cint; nsList: xmlNsPtrPtr): xmlCharPtr; EXTDECL;
+  xsltTemplateProcess: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr): xmlNodePtrPtr; EXTDECL;
+  xsltAttrListTemplateProcess: function(ctxt: xsltTransformContextPtr; target: xmlNodePtr; cur: xmlAttrPtr): xmlAttrPtr; EXTDECL;
+  xsltAttrTemplateProcess: function(ctxt: xsltTransformContextPtr; target: xmlNodePtr; attr: xmlAttrPtr): xmlAttrPtr; EXTDECL;
+  xsltAttrTemplateValueProcess: function(ctxt: xsltTransformContextPtr; const attr: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xsltAttrTemplateValueProcessNode: function(ctxt: xsltTransformContextPtr; const str: xmlCharPtr; node: xmlNodePtr): xmlCharPtr; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+

+ 25 - 1
packages/libxml/src/threads.inc

@@ -52,4 +52,28 @@ function xmlGetGlobalState: xmlGlobalStatePtr; EXTDECL; external xml2lib;
 //int EXTDECL xmlDllMain(void *hinstDLL, unsigned long fdwReason, void *lpvReserved);
 {$ENDIF}
 
-{$ENDIF}
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlNewMutex: function: xmlMutexPtr; EXTDECL;
+  xmlMutexLock: procedure(tok: xmlMutexPtr); EXTDECL;
+  xmlMutexUnlock: procedure(tok: xmlMutexPtr); EXTDECL;
+  xmlFreeMutex: procedure(tok: xmlMutexPtr); EXTDECL;
+
+  xmlNewRMutex: function: xmlRMutexPtr; EXTDECL;
+  xmlRMutexLock: procedure(tok: xmlRMutexPtr); EXTDECL;
+  xmlRMutexUnlock: procedure(tok: xmlRMutexPtr); EXTDECL;
+  xmlFreeRMutex: procedure(tok: xmlRMutexPtr); EXTDECL;
+
+(*
+ * Library wide APIs.
+ *)
+  xmlInitThreads: procedure; EXTDECL;
+  xmlLockLibrary: procedure; EXTDECL;
+  xmlUnlockLibrary: procedure; EXTDECL;
+
+  xmlGetThreadId: function: cint; EXTDECL;
+  xmlIsMainThread: function: cint; EXTDECL;
+  xmlCleanupThreads: procedure; EXTDECL;
+  xmlGetGlobalState: function: xmlGlobalStatePtr; EXTDECL;
+{$ENDIF}

+ 120 - 0
packages/libxml/src/transform.inc

@@ -0,0 +1,120 @@
+(*
+ * Summary: the XSLT engine transformation part.
+ * Description: This module implements the bulk of the actual
+ *              transformation processing. Most of the xsl: element
+ *              constructs are implemented in this module.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF FUNCTION}
+(**
+ * XInclude default processing.
+ *)
+procedure xsltSetXIncludeDefault(xinclude: cint); EXTDECL; external xsltlib;
+function xsltGetXIncludeDefault: cint; EXTDECL; external xsltlib;
+
+(**
+ * Export context to users.
+ *)
+function xsltNewTransformContext(style: xsltStylesheetPtr; doc: xmlDocPtr): xsltTransformContextPtr; EXTDECL; external xsltlib;
+procedure xsltFreeTransformContext(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+function xsltApplyStylesheetUser(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; profile: Pointer; userCtxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL; external xsltlib;
+procedure xsltProcessOneNode(ctxt: xsltTransformContextPtr; node: xmlNodePtr; params: xsltStackElemPtr); EXTDECL; external xsltlib;
+
+(**
+ * Private Interfaces.
+ *)
+procedure xsltApplyStripSpaces(ctxt: xsltTransformContextPtr; node: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltApplyStylesheet(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar): xmlDocPtr; EXTDECL; external xsltlib;
+function xsltProfileStylesheet(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; output: Pointer): xmlDocPtr; EXTDECL; external xsltlib;
+function xsltRunStylesheet(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; SAX: xmlSAXHandlerPtr; IObuf: xmlOutputBufferPtr): cint; EXTDECL; external xsltlib;
+function xsltRunStylesheetUser(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; SAX: xmlSAXHandlerPtr; IObuf: xmlOutputBufferPtr; profile: Pointer; userCtxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+procedure xsltApplyOneTemplate(ctxt: xsltTransformContextPtr; node: xmlNodePtr; list: xmlNodePtr; templ: xsltTemplatePtr; params: xsltStackElemPtr); EXTDECL; external xsltlib;
+procedure xsltDocumentElem(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltSort(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltCopy(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltText(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltElement(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltComment(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltAttribute(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltProcessingInstruction(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltCopyOf(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltValueOf(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltNumber(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltApplyImports(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltCallTemplate(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltApplyTemplates(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltChoose(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltIf(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltForEach(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL; external xsltlib;
+procedure xsltRegisterAllElement(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+function xsltCopyTextString(ctxt: xsltTransformContextPtr; target: xmlNodePtr; const &string: xmlCharPtr; noescape: cint): xmlNodePtr; EXTDECL; external xsltlib;
+
+(* Following 2 functions needed for libexslt/functions.c *)
+procedure xsltLocalVariablePop(ctxt: xsltTransformContextPtr; limitNr: cint; level: cint); EXTDECL; external xsltlib;
+function xsltLocalVariablePush(ctxt: xsltTransformContextPtr; variable: xsltStackElemPtr; level: cint): cint; EXTDECL; external xsltlib;
+
+(*
+ * Hook for the debugger if activated.
+ *)
+procedure xslHandleDebugger(cur: xmlNodePtr; node: xmlNodePtr; templ: xsltTemplatePtr; ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(**
+ * XInclude default processing.
+ *)
+  xsltSetXIncludeDefault: procedure(xinclude: cint); EXTDECL;
+  xsltGetXIncludeDefault: function: cint; EXTDECL;
+
+(**
+ * Export context to users.
+ *)
+  xsltNewTransformContext: function(style: xsltStylesheetPtr; doc: xmlDocPtr): xsltTransformContextPtr; EXTDECL;
+  xsltFreeTransformContext: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltApplyStylesheetUser: function(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; profile: Pointer; userCtxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL;
+  xsltProcessOneNode: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; params: xsltStackElemPtr); EXTDECL;
+
+(**
+ * Private Interfaces.
+ *)
+  xsltApplyStripSpaces: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr); EXTDECL;
+  xsltApplyStylesheet: function(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar): xmlDocPtr; EXTDECL;
+  xsltProfileStylesheet: function(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; output: Pointer): xmlDocPtr; EXTDECL;
+  xsltRunStylesheet: function(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; SAX: xmlSAXHandlerPtr; IObuf: xmlOutputBufferPtr): cint; EXTDECL;
+  xsltRunStylesheetUser: function(style: xsltStylesheetPtr; doc: xmlDocPtr; const params: PPAnsiChar; const output: PAnsiChar; SAX: xmlSAXHandlerPtr; IObuf: xmlOutputBufferPtr; profile: Pointer; userCtxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltApplyOneTemplate: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; list: xmlNodePtr; templ: xsltTemplatePtr; params: xsltStackElemPtr); EXTDECL;
+  xsltDocumentElem: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltSort: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltCopy: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltText: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltElement: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltComment: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltAttribute: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltProcessingInstruction: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltCopyOf: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltValueOf: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltNumber: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltApplyImports: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltCallTemplate: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltApplyTemplates: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltChoose: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltIf: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltForEach: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+  xsltRegisterAllElement: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltCopyTextString: function(ctxt: xsltTransformContextPtr; target: xmlNodePtr; const &string: xmlCharPtr; noescape: cint): xmlNodePtr; EXTDECL;
+
+(* Following 2 functions needed for libexslt/functions.c *)
+  xsltLocalVariablePop: procedure(ctxt: xsltTransformContextPtr; limitNr: cint; level: cint); EXTDECL;
+  xsltLocalVariablePush: function(ctxt: xsltTransformContextPtr; variable: xsltStackElemPtr; level: cint): cint; EXTDECL;
+
+(*
+ * Hook for the debugger if activated.
+ *)
+  xslHandleDebugger: procedure(cur: xmlNodePtr; node: xmlNodePtr; templ: xsltTemplatePtr; ctxt: xsltTransformContextPtr); EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}

+ 335 - 13
packages/libxml/src/tree.inc

@@ -27,6 +27,14 @@
   xmlDocPtr = ^xmlDoc;
   xmlDOMWrapCtxtPtr = ^xmlDOMWrapCtxt;
   xmlBufferAllocationSchemePtr = ^xmlBufferAllocationScheme;
+
+(**
+ * xmlBufPtr:
+ *
+ * A pointer to a buffer structure, the actual structure internals are not
+ * public
+ *)
+  xmlBufPtr = ^xmlBuf;
 {$ENDIF}
 
 (*
@@ -74,9 +82,12 @@
  * need or double it's allocated size each time it is found too small.
  *)
   xmlBufferAllocationScheme = (
-    XML_BUFFER_ALLOC_DOUBLEIT,
-    XML_BUFFER_ALLOC_EXACT,
-    XML_BUFFER_ALLOC_IMMUTABLE
+    XML_BUFFER_ALLOC_DOUBLEIT,	(* double each time one need to grow *)
+    XML_BUFFER_ALLOC_EXACT,	(* grow only to the minimal size *)
+    XML_BUFFER_ALLOC_IMMUTABLE, (* immutable buffer *)
+    XML_BUFFER_ALLOC_IO,	(* special allocation scheme used for I/O *)
+    XML_BUFFER_ALLOC_HYBRID,	(* exact up to a threshold, and doubleit thereafter *)
+    XML_BUFFER_ALLOC_BOUNDED	(* limit the upper size of the buffer *)
   );
 
 (**
@@ -85,10 +96,11 @@
  * A buffer structure.
  *)
   xmlBuffer = record
-    content : xmlCharPtr;   (* The buffer content UTF8 *)
-    use     : cuint;      (* The buffer size used *)
-    size    : cuint;      (* The buffer size *)
-    alloc   : xmlBufferAllocationScheme; (* The realloc method *)
+    content   : xmlCharPtr;                (* The buffer content UTF8 *)
+    use       : cuint;                     (* The buffer size used *)
+    size      : cuint;                     (* The buffer size *)
+    alloc     : xmlBufferAllocationScheme; (* The realloc method *)
+    contentIO : xmlCharPtr;                (* in IO mode we may have a different base *)
   end;
 
 (*
@@ -283,6 +295,15 @@
 {$ENDIF}
   end;
 
+
+(**
+ * xmlBuf:
+ *
+ * A buffer structure, new one, the actual structure internals are not public
+ *)
+
+ xmlBuf = record end;
+
 (**
  * XML_LOCAL_NAMESPACE:
  *
@@ -429,8 +450,8 @@ function XML_GET_CONTENT(n: pointer): xmlCharPtr;
  *
  * Macro to extract the line number of an element node.
  *)
-{#define XML_GET_LINE(n)						\
-    (xmlGetLineNo(n))}
+function XML_GET_LINE(n: Pointer): clong; inline;
+
 {$ENDIF}
 
 {$IFDEF TYPE}
@@ -549,7 +570,7 @@ function xmlValidateName(value: xmlCharPtr; space: cint): cint; EXTDECL; externa
 function xmlValidateNMToken(value: xmlCharPtr; space: cint): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
-function xmlValidateQName(ncname, prefix, memory: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL; external xml2lib;
+function xmlBuildQName(ncname, prefix, memory: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlSplitQName2(name: xmlCharPtr; var prefix: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlSplitQName3(name: xmlCharPtr; var prefix: xmlCharPtr; var len: cint): xmlCharPtr; EXTDECL; external xml2lib;
 
@@ -573,6 +594,7 @@ function xmlBufferShrink(buf: xmlBufferPtr; len: cuint): cint; EXTDECL; external
 function xmlBufferGrow(buf: xmlBufferPtr; len: cuint): cint; EXTDECL; external xml2lib;
 procedure xmlBufferEmpty(buf: xmlBufferPtr); EXTDECL; external xml2lib;
 function xmlBufferContent(buf: xmlBufferPtr): xmlCharPtr; EXTDECL; external xml2lib;
+function xmlBufferDetach(buf: xmlBufferPtr): xmlCharPtr; EXTDECL; external xml2lib;
 procedure xmlBufferSetAllocationScheme(buf: xmlBufferPtr; scheme: xmlBufferAllocationScheme); EXTDECL; external xml2lib;
 function xmlBufferLength(buf: xmlBufferPtr): cint; EXTDECL; external xml2lib;
 
@@ -685,7 +707,7 @@ procedure xmlSetListDoc(list: xmlNodePtr; doc: xmlDocPtr); EXTDECL; external xml
 function xmlSearchNs(doc: xmlDocPtr; node: xmlNodePtr; nameSpace: xmlCharPtr): xmlNsPtr; EXTDECL; external xml2lib;
 function xmlSearchNsByHref(doc: xmlDocPtr; node: xmlNodePtr; href: xmlCharPtr): xmlNsPtr; EXTDECL; external xml2lib;
 {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
-function xmlGetNsList(doc: xmlDocPtr; node: xmlNodePtr): xmlNsPtr; EXTDECL; external xml2lib;
+function xmlGetNsList(doc: xmlDocPtr; node: xmlNodePtr): xmlNsPtrPtr; EXTDECL; external xml2lib;
 {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) *)
 procedure xmlSetNs(node: xmlNodePtr; ns: xmlNsPtr); EXTDECL; external xml2lib;
 function xmlCopyNamespace(cur: xmlNsPtr): xmlNsPtr; EXTDECL; external xml2lib;
@@ -777,6 +799,7 @@ function xmlDocDump(f: PFILE; cur: xmlDocPtr): cint; EXTDECL; external xml2lib;
 function xmlElemDump(f: PFILE; doc: xmlDocPtr; cur: xmlNodePtr): cint; EXTDECL; external xml2lib;
 function xmlSaveFormatFile(filename: PAnsiChar; cur: xmlDocPtr; format: cint): cint; EXTDECL; external xml2lib;
 function xmlSaveFile(filename: PAnsiChar; cur: xmlDocPtr): cint; EXTDECL; external xml2lib;
+function xmlBufNodeDump(buf: xmlBufPtr; doc: xmlDocPtr; cur: xmlNodePtr; level: cint; format: cint): csize_t; EXTDECL; external xml2lib;
 function xmlNodeDump(buf: xmlBufferPtr; doc: xmlDocPtr; cur: xmlNodePtr; level, format: cint): cint; EXTDECL; external xml2lib;
 function xmlSaveFileTo(buf: xmlOutputBufferPtr; cur: xmlDocPtr; encoding: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlSaveFormatFileTo(buf: xmlOutputBufferPtr; cur: xmlDocPtr; encoding: PAnsiChar; format: cint): cint; EXTDECL; external xml2lib;
@@ -794,7 +817,7 @@ function xmlIsXHTML(systemID, publicID: xmlCharPtr): cint; EXTDECL; external xml
  * Compression.
  *)
 function xmlGetDocCompressMode(doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
-procedure xmlSetDocCompressMode(ctxt: xmlDOMWrapCtxtPtr; mode: cint); EXTDECL; external xml2lib;
+procedure xmlSetDocCompressMode(doc: xmlDocPtr; mode: cint); EXTDECL; external xml2lib;
 function xmlGetCompressMode: cint; EXTDECL; external xml2lib;
 procedure xmlSetCompressMode(mode: cint); EXTDECL; external xml2lib;
 
@@ -802,9 +825,308 @@ procedure xmlSetCompressMode(mode: cint); EXTDECL; external xml2lib;
 * DOM-wrapper helper functions.
 *)
 function xmlDOMWrapNewCtxt: xmlDOMWrapCtxtPtr; EXTDECL; external xml2lib;
-procedure xmlDOMWrapNewCtxt(ctxt: xmlDOMWrapCtxtPtr); EXTDECL; external xml2lib;
+procedure xmlDOMWrapFreeCtxt(ctxt: xmlDOMWrapCtxtPtr); EXTDECL; external xml2lib;
 function xmlDOMWrapReconcileNamespaces(ctxt: xmlDOMWrapCtxtPtr; elem: xmlNodePtr; options: cint): cint; EXTDECL; external xml2lib;
 function xmlDOMWrapAdoptNode(ctxt: xmlDOMWrapCtxtPtr; sourceDoc: xmlDocPtr; node: xmlNodePtr; destDoc: xmlDocPtr; destParent: xmlNodePtr; options: cint): cint; EXTDECL; external xml2lib;
 function xmlDOMWrapRemoveNode(ctxt: xmlDOMWrapCtxtPtr; doc: xmlDocPtr; node: xmlNodePtr; options: cint): cint; EXTDECL; external xml2lib;
 function xmlDOMWrapCloneNode(ctxt: xmlDOMWrapCtxtPtr; sourceDoc: xmlDocPtr; node: xmlNodePtr; var clonedNode: xmlNodePtr; destDoc: xmlDocPtr; destParent: xmlNodePtr; deep, options: cint): cint; EXTDECL; external xml2lib;
+
+{$IFDEF LIBXML_TREE_ENABLED}
+function xmlChildElementCount(parent: xmlNodePtr): clong; EXTDECL; external xml2lib;
+function xmlNextElementSibling(node: xmlNodePtr): xmlNodePtr; EXTDECL; external xml2lib;
+function xmlFirstElementChild(parent: xmlNodePtr): xmlNodePtr; EXTDECL; external xml2lib;
+function xmlLastElementChild(parent: xmlNodePtr): xmlNodePtr; EXTDECL; external xml2lib;
+function xmlPreviousElementSibling(node: xmlNodePtr): xmlNodePtr; EXTDECL; external xml2lib;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Variables.
+ *)
+(*
+ * Some helper functions
+ *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or
+  defined(LIBXML_DEBUG_ENABLED) or defined (LIBXML_HTML_ENABLED) or defined(LIBXML_SAX1_ENABLED) or
+  defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+  xmlValidateNCName: function(value: xmlCharPtr; space: cint): cint; EXTDECL;
+{$ENDIF}
+
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlValidateQName: function(value: xmlCharPtr; space: cint): cint; EXTDECL;
+  xmlValidateName: function(value: xmlCharPtr; space: cint): cint; EXTDECL;
+  xmlValidateNMToken: function(value: xmlCharPtr; space: cint): cint; EXTDECL;
+{$ENDIF}
+
+  xmlBuildQName: function(ncname, prefix, memory: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlSplitQName2: function(name: xmlCharPtr; var prefix: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlSplitQName3: function(name: xmlCharPtr; var prefix: xmlCharPtr; var len: cint): xmlCharPtr; EXTDECL;
+
+(*
+ * Handling Buffers.
+ *)
+  xmlSetBufferAllocationScheme: procedure(scheme: xmlBufferAllocationScheme); EXTDECL;
+  xmlGetBufferAllocationScheme: function: xmlBufferAllocationScheme; EXTDECL;
+
+  xmlBufferCreate: function: xmlBufferPtr; EXTDECL;
+  xmlBufferCreateSize: function(size: csize_t): xmlBufferPtr; EXTDECL;
+  xmlBufferCreateStatic: function(mem: pointer; size: csize_t): xmlBufferPtr; EXTDECL;
+  xmlBufferResize: function(buf: xmlBufferPtr; size: cuint): cint; EXTDECL;
+  xmlBufferFree: procedure(buf: xmlBufferPtr); EXTDECL;
+  xmlBufferDump: procedure(fp: PFILE; buf: xmlBufferPtr); EXTDECL;
+  xmlBufferAdd: function(buf: xmlBufferPtr; str: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlBufferAddHead: function(buf: xmlBufferPtr; str: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlBufferCat: function(buf: xmlBufferPtr; str: xmlCharPtr): cint; EXTDECL;
+  xmlBufferCCat: function(buf: xmlBufferPtr; str: PAnsiChar): cint; EXTDECL;
+  xmlBufferShrink: function(buf: xmlBufferPtr; len: cuint): cint; EXTDECL;
+  xmlBufferGrow: function(buf: xmlBufferPtr; len: cuint): cint; EXTDECL;
+  xmlBufferEmpty: procedure(buf: xmlBufferPtr); EXTDECL;
+  xmlBufferContent: function(buf: xmlBufferPtr): xmlCharPtr; EXTDECL;
+  xmlBufferDetach: function(buf: xmlBufferPtr): xmlCharPtr; EXTDECL;
+  xmlBufferSetAllocationScheme: procedure(buf: xmlBufferPtr; scheme: xmlBufferAllocationScheme); EXTDECL;
+  xmlBufferLength: function(buf: xmlBufferPtr): cint; EXTDECL;
+
+(*
+ * Creating/freeing new structures.
+ *)
+  xmlCreateIntSubset: function(doc: xmlDocPtr; name, ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL;
+  xmlNewDtd: function(doc: xmlDocPtr; name, ExternalID, SystemID: xmlCharPtr): xmlDtdPtr; EXTDECL;
+  xmlGetIntSubset: function(doc: xmlDocPtr): xmlDtdPtr; EXTDECL;
+  xmlFreeDtd: procedure(cur: xmlDtdPtr); EXTDECL;
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlNewGlobalNs: function(doc: xmlDocPtr; href, prefix: xmlCharPtr): xmlNsPtr; EXTDECL;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlNewNs: function(node: xmlNodePtr; href, prefix: xmlCharPtr): xmlNsPtr; EXTDECL;
+  xmlFreeNs: procedure(cur: xmlNsPtr); EXTDECL;
+  xmlFreeNsList: procedure(cur: xmlNsPtr); EXTDECL;
+  xmlNewDoc: function(version: xmlCharPtr): xmlDocPtr; EXTDECL;
+  xmlFreeDoc: procedure(cur: xmlDocPtr); EXTDECL;
+  xmlNewDocProp: function(doc: xmlDocPtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlNewProp: function(node: xmlNodePtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+{$ENDIF}
+  xmlNewNsProp: function(node: xmlNodePtr; ns: xmlNsPtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlNewNsPropEatName: function(node: xmlNodePtr; ns: xmlNsPtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlFreePropList: procedure(cur: xmlAttrPtr); EXTDECL;
+  xmlFreeProp: procedure(cur: xmlAttrPtr); EXTDECL;
+  xmlCopyProp: function(target: xmlNodePtr; cur: xmlAttrPtr): xmlAttrPtr; EXTDECL;
+  xmlCopyPropList: function(target: xmlNodePtr; cur: xmlAttrPtr): xmlAttrPtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyDtd: function(dtd: xmlDtdPtr): xmlDtdPtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlCopyDoc: function(doc: xmlDocPtr; recursive: cint): xmlDocPtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+
+(*
+ * Creating new nodes.
+ *)
+  xmlNewDocNode: function(doc: xmlDocPtr; ns: xmlNsPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewDocNodeEatName: function(doc: xmlDocPtr; ns: xmlNsPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewNode: function(ns: xmlNsPtr; name: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewNodeEatName: function(ns: xmlNsPtr; name: xmlCharPtr): xmlNodePtr; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlNewChild: function(parent: xmlNodePtr; ns: xmlNsPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+{$ENDIF}
+
+  xmlNewDocText: function(doc: xmlDocPtr; content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewText: function(content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewDocPI: function(doc: xmlDocPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewPI: function(name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewDocTextLen: function(doc: xmlDocPtr; content: xmlCharPtr; len: cint): xmlNodePtr; EXTDECL;
+  xmlNewTextLen: function(content: xmlCharPtr; len: cint): xmlNodePtr; EXTDECL;
+  xmlNewDocComment: function(doc: xmlDocPtr; content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewComment: function(content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewCDataBlock: function(doc: xmlDocPtr; content: xmlCharPtr; len: cint): xmlNodePtr; EXTDECL;
+  xmlNewCharRef: function(doc: xmlDocPtr; name: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewReference: function(doc: xmlDocPtr; name: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlCopyNode: function(node: xmlNodePtr; recursive: cint): xmlNodePtr; EXTDECL;
+  xmlDocCopyNode: function(node: xmlNodePtr; doc: xmlDocPtr; recursive: cint): xmlNodePtr; EXTDECL;
+  xmlDocCopyNodeList: function(doc: xmlDocPtr; node: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlCopyNodeList: function(node: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNewTextChild: function(parent: xmlNodePtr; ns: xmlNsPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewDocRawNode: function(doc: xmlDocPtr; ns: xmlNsPtr; name, content: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlNewDocFragment: function(doc: xmlDocPtr): xmlNodePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+
+(*
+ * Navigating.
+ *)
+  xmlGetLineNo: function(node: xmlNodePtr): clong; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_DEBUG_ENABLED)}
+  xmlGetNodePath: function(node: xmlNodePtr): xmlCharPtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) *)
+  xmlDocGetRootElement: function(doc: xmlDocPtr): xmlNodePtr; EXTDECL;
+  xmlGetLastChild: function(parent: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlNodeIsText: function(node: xmlNodePtr): cint; EXTDECL;
+  xmlIsBlankNode: function(node: xmlNodePtr): cint; EXTDECL;
+
+(*
+ * Changing the structure.
+ *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+  xmlDocSetRootElement: function(doc: xmlDocPtr; root: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetName: procedure(cur: xmlNodePtr; name: xmlCharPtr); EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlAddChild: function (parent, cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlAddChildList: function(parent, cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+  xmlReplaceNode: function(old, cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlAddPrevSibling: function(cur, elem: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED *)
+  xmlAddSibling: function(cur, elem: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlAddNextSibling: function(cur, elem: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlUnlinkNode: procedure(cur: xmlNodePtr); EXTDECL;
+  xmlTextMerge: function(first, second: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlTextConcat: function(node: xmlNodePtr; name: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlFreeNodeList: procedure(cur: xmlNodePtr); EXTDECL;
+  xmlFreeNode: procedure(cur: xmlNodePtr); EXTDECL;
+  xmlSetTreeDoc: procedure(tree: xmlNodePtr; doc: xmlDocPtr); EXTDECL;
+  xmlSetListDoc: procedure(list: xmlNodePtr; doc: xmlDocPtr); EXTDECL;
+
+(*
+ * Namespaces.
+ *)
+  xmlSearchNs: function(doc: xmlDocPtr; node: xmlNodePtr; nameSpace: xmlCharPtr): xmlNsPtr; EXTDECL;
+  xmlSearchNsByHref: function(doc: xmlDocPtr; node: xmlNodePtr; href: xmlCharPtr): xmlNsPtr; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlGetNsList: function(doc: xmlDocPtr; node: xmlNodePtr): xmlNsPtrPtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) *)
+  xmlSetNs: procedure(node: xmlNodePtr; ns: xmlNsPtr); EXTDECL;
+  xmlCopyNamespace: function(cur: xmlNsPtr): xmlNsPtr; EXTDECL;
+  xmlCopyNamespaceList: function (cur: xmlNsPtr): xmlNsPtr; EXTDECL;
+
+(*
+ * Changing the content.
+ *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or defined(LIBXML_HTML_ENABLED)}
+  xmlSetProp: function(node: xmlNodePtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlSetNsProp: function(node: xmlNodePtr; ns: xmlNsPtr; name, value: xmlCharPtr): xmlAttrPtr; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) *)
+  xmlGetNoNsProp: function(node: xmlNodePtr; name: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlGetProp: function(node: xmlNodePtr; name: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlHasProp: function(node: xmlNodePtr; name: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlHasNsProp: function(node: xmlNodePtr; name, nameSpace: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlGetNsProp: function(node: xmlNodePtr; name, nameSpace: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlStringGetNodeList: function(doc: xmlDocPtr; value: xmlCharPtr): xmlNodePtr; EXTDECL;
+  xmlStringLenGetNodeList: function(doc: xmlDocPtr; value: xmlCharPtr; len: cint): xmlNodePtr; EXTDECL;
+  xmlNodeListGetString: function(doc: xmlDocPtr; list: xmlNodePtr; _inLine: cint): xmlCharPtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeListGetRawString: function(doc: xmlDocPtr; list: xmlNodePtr; _inLine: cint): xmlCharPtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeSetContent: procedure(node: xmlNodePtr; content: xmlCharPtr); EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetContentLen: procedure(node: xmlNodePtr; content: xmlCharPtr; len: cint); EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeAddContent: procedure(cur: xmlNodePtr; content: xmlCharPtr); EXTDECL;
+  xmlNodeAddContentLen: procedure(cur: xmlNodePtr; content: xmlCharPtr; len: cint); EXTDECL;
+  xmlNodeGetContent: function(cur: xmlNodePtr): xmlCharPtr; EXTDECL;
+  xmlNodeBufGetContent: function(buffer: xmlBufferPtr; cur: xmlNodePtr): cint; EXTDECL;
+  xmlNodeGetLang: function(cur: xmlNodePtr): xmlCharPtr; EXTDECL;
+  xmlNodeGetSpacePreserve: function(cur: xmlNodePtr): cint; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetLang: procedure(cur: xmlNodePtr; lang: xmlCharPtr); EXTDECL;
+  xmlNodeSetSpacePreserve: procedure(cur: xmlNodePtr; val: cint); EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeGetBase: function(doc: xmlDocPtr; cur: xmlNodePtr): xmlCharPtr; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED)}
+  xmlNodeSetBase: procedure(cur: xmlNodePtr; uri: xmlCharPtr); EXTDECL;
+{$ENDIF}
+
+(*
+ * Removing content.
+ *)
+  xmlRemoveProp: function(cur: xmlAttrPtr): cint; EXTDECL;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlUnsetNsProp: function(node: xmlNodePtr; ns: xmlNsPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlUnsetProp: function(node: xmlNodePtr; name: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+
+(*
+ * Internal, don't use.
+ *)
+{external xml2lib void EXTDECL
+		xmlBufferWriteCHAR	(xmlBufferPtr buf,
+					 xmlChar *string);
+external xml2lib void EXTDECL
+		xmlBufferWriteChar	(xmlBufferPtr buf,
+					 AnsiChar *string);
+external xml2lib void EXTDECL
+		xmlBufferWriteQuotedString(xmlBufferPtr buf,
+					 xmlChar *string);
+}
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+{external xml2lib void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
+					 xmlDocPtr doc,
+					 xmlAttrPtr attr,
+					 xmlChar *string);}
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+{$IFDEF LIBXML_TREE_ENABLED}
+(*
+ * Namespace handling.
+ *)
+  xmlReconciliateNs: function(doc: xmlDocPtr; tree: xmlNodePtr): cint; EXTDECL;
+{$ENDIF}
+
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+(*
+ * Saving.
+ *)
+  xmlDocDumpFormatMemory: procedure(cur: xmlDocPtr; var mem: xmlCharPtr; var size: cint; format: cint); EXTDECL;
+  xmlDocDumpMemory: procedure(cur: xmlDocPtr; var mem: xmlCharPtr; var size: cint); EXTDECL;
+  xmlDocDumpMemoryEnc: procedure(out_doc: xmlDocPtr; var doc_txt_ptr: xmlCharPtr; var doc_txt_len: cint; txt_encoding: PAnsiChar); EXTDECL;
+  xmlDocDumpFormatMemoryEnc: procedure(out_doc: xmlDocPtr; var doc_txt_ptr: xmlCharPtr; var doc_txt_len: cint; txt_encoding: PAnsiChar; format: cint); EXTDECL;
+  xmlDocFormatDump: function(f: PFILE; cur: xmlDocPtr; format: cint): cint; EXTDECL;
+  xmlDocDump: function(f: PFILE; cur: xmlDocPtr): cint; EXTDECL;
+  xmlElemDump: function(f: PFILE; doc: xmlDocPtr; cur: xmlNodePtr): cint; EXTDECL;
+  xmlSaveFormatFile: function(filename: PAnsiChar; cur: xmlDocPtr; format: cint): cint; EXTDECL;
+  xmlSaveFile: function(filename: PAnsiChar; cur: xmlDocPtr): cint; EXTDECL;
+  xmlBufNodeDump: function(buf: xmlBufPtr; doc: xmlDocPtr; cur: xmlNodePtr; level: cint; format: cint): csize_t; EXTDECL;
+  xmlNodeDump: function(buf: xmlBufferPtr; doc: xmlDocPtr; cur: xmlNodePtr; level, format: cint): cint; EXTDECL;
+  xmlSaveFileTo: function(buf: xmlOutputBufferPtr; cur: xmlDocPtr; encoding: PAnsiChar): cint; EXTDECL;
+  xmlSaveFormatFileTo: function(buf: xmlOutputBufferPtr; cur: xmlDocPtr; encoding: PAnsiChar; format: cint): cint; EXTDECL;
+  xmlNodeDumpOutput: procedure(buf: xmlBufferPtr; doc: xmlDocPtr; cur: xmlNodePtr; level, format: cint; encoding: PAnsiChar); EXTDECL;
+  xmlSaveFormatFileEnc: function(filename: PAnsiChar; cur: xmlDocPtr; encoding: PAnsiChar; format: cint): cint; EXTDECL;
+  xmlSaveFileEnc: function(filename: PAnsiChar; cur: xmlDocPtr; encoding: PAnsiChar): cint; EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(*
+ * XHTML
+ *)
+  xmlIsXHTML: function(systemID, publicID: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * Compression.
+ *)
+  xmlGetDocCompressMode: function(doc: xmlDocPtr): cint; EXTDECL;
+  xmlSetDocCompressMode: procedure(doc: xmlDocPtr; mode: cint); EXTDECL;
+  xmlGetCompressMode: function: cint; EXTDECL;
+  xmlSetCompressMode: procedure(mode: cint); EXTDECL;
+
+(*
+* DOM-wrapper helper functions.
+*)
+  xmlDOMWrapNewCtxt: function: xmlDOMWrapCtxtPtr; EXTDECL;
+  xmlDOMWrapFreeCtxt: procedure(ctxt: xmlDOMWrapCtxtPtr); EXTDECL;
+  xmlDOMWrapReconcileNamespaces: function(ctxt: xmlDOMWrapCtxtPtr; elem: xmlNodePtr; options: cint): cint; EXTDECL;
+  xmlDOMWrapAdoptNode: function(ctxt: xmlDOMWrapCtxtPtr; sourceDoc: xmlDocPtr; node: xmlNodePtr; destDoc: xmlDocPtr; destParent: xmlNodePtr; options: cint): cint; EXTDECL;
+  xmlDOMWrapRemoveNode: function(ctxt: xmlDOMWrapCtxtPtr; doc: xmlDocPtr; node: xmlNodePtr; options: cint): cint; EXTDECL;
+  xmlDOMWrapCloneNode: function(ctxt: xmlDOMWrapCtxtPtr; sourceDoc: xmlDocPtr; node: xmlNodePtr; var clonedNode: xmlNodePtr; destDoc: xmlDocPtr; destParent: xmlNodePtr; deep, options: cint): cint; EXTDECL;
+
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlChildElementCount: function(parent: xmlNodePtr): clong; EXTDECL;
+  xmlNextElementSibling: function(node: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlFirstElementChild: function(parent: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlLastElementChild: function(parent: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlPreviousElementSibling: function(node: xmlNodePtr): xmlNodePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+
 {$ENDIF}

+ 26 - 3
packages/libxml/src/uri.inc

@@ -48,7 +48,7 @@ function xmlCreateURI(): xmlURIPtr; EXTDECL; external xml2lib;
 function xmlBuildURI(URI: xmlCharPtr; base: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlBuildRelativeURI(URI: xmlCharPtr; base: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlParseURI(str: PAnsiChar): xmlURIPtr; EXTDECL; external xml2lib;
-function xmlParseURI(str: PAnsiChar; raw: cint): xmlURIPtr; EXTDECL; external xml2lib;
+function xmlParseURIRaw(str: PAnsiChar; raw: cint): xmlURIPtr; EXTDECL; external xml2lib;
 function xmlParseURIReference(uri: xmlURIPtr; str: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlSaveUri(uri: xmlURIPtr): PAnsiChar; EXTDECL; external xml2lib;
 procedure xmlPrintURI(stream: PFILE; uri: xmlURIPtr); EXTDECL; external xml2lib;
@@ -56,7 +56,30 @@ function xmlURIEscapeStr(str: xmlCharPtr; list: xmlCharPtr): xmlCharPtr; EXTDECL
 function xmlURIUnescapeString(str: PAnsiChar; len: cint; target: PAnsiChar): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlNormalizeURIPath(path: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlURIEscape(str: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
-procedure xmlPrintURI(uri: xmlURIPtr); EXTDECL; external xml2lib;
+procedure xmlFreeURI(uri: xmlURIPtr); EXTDECL; external xml2lib;
 function xmlCanonicPath(path: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
 function xmlPathToURI(path: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
-{$ENDIF}
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * This function is in tree.h:
+ * xmlChar *	xmlNodeGetBase	(xmlDocPtr doc,
+ *                               xmlNodePtr cur);
+ *)
+  xmlCreateURI: function(): xmlURIPtr; EXTDECL;
+  xmlBuildURI: function(URI: xmlCharPtr; base: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlBuildRelativeURI: function(URI: xmlCharPtr; base: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlParseURI: function(str: PAnsiChar): xmlURIPtr; EXTDECL;
+  xmlParseURIRaw: function(str: PAnsiChar; raw: cint): xmlURIPtr; EXTDECL;
+  xmlParseURIReference: function(uri: xmlURIPtr; str: PAnsiChar): cint; EXTDECL;
+  xmlSaveUri: function(uri: xmlURIPtr): PAnsiChar; EXTDECL;
+  xmlPrintURI: procedure(stream: PFILE; uri: xmlURIPtr); EXTDECL;
+  xmlURIEscapeStr: function(str: xmlCharPtr; list: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlURIUnescapeString: function(str: PAnsiChar; len: cint; target: PAnsiChar): xmlCharPtr; EXTDECL;
+  xmlNormalizeURIPath: function(path: PAnsiChar): cint; EXTDECL;
+  xmlURIEscape: function(str: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlFreeURI: procedure(uri: xmlURIPtr); EXTDECL;
+  xmlCanonicPath: function(path: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlPathToURI: function(path: xmlCharPtr): xmlCharPtr; EXTDECL;
+{$ENDIF}

+ 119 - 1
packages/libxml/src/valid.inc

@@ -213,7 +213,7 @@ function xmlGetDtdQElementDesc(dtd: xmlDtdPtr; name, prefix: xmlCharPtr): xmlEle
 function xmlGetDtdElementDesc(dtd: xmlDtdPtr; name: xmlCharPtr): xmlElementPtr; EXTDECL; external xml2lib;
 {$IFDEF LIBXML_VALID_ENABLED}
 
-function xmlGetDtdElementDesc(ctree: xmlElementContentPtr; var names: xmlCharPtr; var len: cint; max: cint): cint; EXTDECL; external xml2lib;
+function xmlValidGetPotentialChildren(ctree: xmlElementContentPtr; var names: xmlCharPtr; var len: cint; max: cint): cint; EXTDECL; external xml2lib;
 function xmlValidGetValidElements(prev, next: xmlNodePtr; var names: xmlCharPtr; max: cint): cint; EXTDECL; external xml2lib;
 function xmlValidateNameValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlValidateNamesValue(value: xmlCharPtr): cint; EXTDECL; external xml2lib;
@@ -232,3 +232,121 @@ function xmlValidatePopElement(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlN
 {$ENDIF} (* LIBXML_REGEXP_ENABLED *)
 {$ENDIF} (* LIBXML_VALID_ENABLED *)
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(* Notation *)
+  xmlAddNotationDecl: function(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; name, PublicID, SystemID: xmlCharPtr): xmlNotationPtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyNotationTable: function(table: xmlNotationTablePtr): xmlNotationTablePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeNotationTable: procedure(table: xmlNotationTablePtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpNotationDecl: procedure(buf: xmlBufferPtr; nota: xmlNotationPtr); EXTDECL;
+  xmlDumpNotationTable: procedure(buf: xmlBufferPtr; table: xmlNotationTablePtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(* Element Content *)
+  xmlNewDocElementContent: function(doc: xmlDocPtr; name: xmlCharPtr; _type: xmlElementContentType): xmlElementContentPtr; EXTDECL;
+  xmlCopyDocElementContent: function(doc: xmlDocPtr; content: xmlElementContentPtr): xmlElementContentPtr; EXTDECL;
+  xmlFreeDocElementContent: procedure(doc: xmlDocPtr; cur: xmlElementContentPtr); EXTDECL;
+  xmlSnprintfElementContent: procedure(buf: PAnsiChar; size: cint; content: xmlElementContentPtr; englob: cint); EXTDECL;
+
+(* Element *)
+  xmlAddElementDecl: function(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; name: xmlCharPtr; _type: xmlElementTypeVal; content: xmlElementContentPtr): xmlElementPtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyElementTable: function(table: xmlElementTablePtr): xmlElementTablePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeElementTable: procedure(table: xmlElementTablePtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpElementTable: procedure(buf: xmlBufferPtr; table: xmlElementTablePtr); EXTDECL;
+  xmlDumpElementDecl: procedure(buf: xmlBufferPtr; elem: xmlElementPtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(* Enumeration *)
+  xmlCreateEnumeration: function(name: xmlCharPtr): xmlEnumerationPtr; EXTDECL;
+  xmlFreeEnumeration: procedure(cur: xmlEnumerationPtr); EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyEnumeration: function(cur: xmlEnumerationPtr): xmlEnumerationPtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+
+(* Attribute *)
+  xmlAddAttributeDecl: function(ctxt: xmlValidCtxtPtr; dtd: xmlDtdPtr; elem, name, ns: xmlCharPtr; _type: xmlAttributeType;
+    def: xmlAttributeDefault; defaultValue: xmlCharPtr; tree: xmlEnumerationPtr): xmlAttributePtr; EXTDECL;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyAttributeTable: function(table: xmlAttributeTablePtr): xmlAttributeTablePtr; EXTDECL;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeAttributeTable: procedure(table: xmlAttributeTablePtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpAttributeTable: procedure(buf: xmlBufferPtr; table: xmlAttributeTablePtr); EXTDECL;
+  xmlDumpAttributeDecl: procedure(buf: xmlBufferPtr; attr: xmlAttributePtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(* IDs *)
+  xmlAddID: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; value: xmlCharPtr; attr: xmlAttrPtr): xmlIDPtr; EXTDECL;
+  xmlFreeIDTable: procedure(table: xmlIDTablePtr); EXTDECL;
+  xmlGetID: function(doc: xmlDocPtr; ID: xmlCharPtr): xmlAttrPtr; EXTDECL;
+  xmlIsID: function(doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr): cint; EXTDECL;
+  xmlRemoveID: function(doc: xmlDocPtr; attr: xmlAttrPtr): cint; EXTDECL;
+
+(* IDREFs *)
+  xmlAddRef: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; value: xmlCharPtr; attr: xmlAttrPtr): xmlRefPtr; EXTDECL;
+  xmlFreeRefTable: procedure(table: xmlRefTablePtr); EXTDECL;
+  xmlIsRef: function(doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr): cint; EXTDECL;
+  xmlRemoveRef: function(doc: xmlDocPtr; attr: xmlAttrPtr): cint; EXTDECL;
+  xmlGetRefs: function(doc: xmlDocPtr; ID: xmlCharPtr): xmlListPtr; EXTDECL;
+
+(**
+ * The public function calls related to validity checking.
+ *)
+{$IFDEF LIBXML_VALID_ENABLED}
+(* Allocate/Release Validation Contexts *)
+  xmlNewValidCtxt: function: xmlValidCtxtPtr; EXTDECL;
+  xmlFreeValidCtxt: procedure(table: xmlValidCtxtPtr); EXTDECL;
+  xmlValidateRoot: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL;
+  xmlValidateElementDecl: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlElementPtr): cint; EXTDECL;
+  xmlValidNormalizeAttributeValue: function(doc: xmlDocPtr; elem: xmlNodePtr; name, value: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlValidCtxtNormalizeAttributeValue: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; name, value: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlValidateAttributeDecl: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; attr: xmlAttributePtr): cint; EXTDECL;
+  xmlValidateAttributeValue: function(_type: xmlAttributeType; value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateNotationDecl: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; nota: xmlNotationPtr): cint; EXTDECL;
+  xmlValidateDtd: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; dtd: xmlDtdPtr): cint; EXTDECL;
+  xmlValidateDtdFinal: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL;
+  xmlValidateDocument: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL;
+  xmlValidateElement: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL;
+  xmlValidateOneElement: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr): cint; EXTDECL;
+  xmlValidateOneAttribute: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; attr: xmlAttrPtr; value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateOneNamespace: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; prefix: xmlCharPtr; ns: xmlNsPtr; value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateDocumentFinal: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr): cint; EXTDECL;
+{$ENDIF} (* LIBXML_VALID_ENABLED *)
+
+{$IF defined(LIBXML_VALID_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlValidateNotationUse: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; notationName: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} (* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED *)
+
+  xmlIsMixedElement: function(doc: xmlDocPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlGetDtdAttrDesc: function(dtd: xmlDtdPtr; elem, name: xmlCharPtr): xmlAttributePtr; EXTDECL;
+  xmlGetDtdQAttrDesc: function(dtd: xmlDtdPtr; elem, name, prefix: xmlCharPtr): xmlAttributePtr; EXTDECL;
+  xmlGetDtdNotationDesc: function(dtd: xmlDtdPtr; name: xmlCharPtr): xmlNotationPtr; EXTDECL;
+  xmlGetDtdQElementDesc: function(dtd: xmlDtdPtr; name, prefix: xmlCharPtr): xmlElementPtr; EXTDECL;
+  xmlGetDtdElementDesc: function(dtd: xmlDtdPtr; name: xmlCharPtr): xmlElementPtr; EXTDECL;
+{$IFDEF LIBXML_VALID_ENABLED}
+
+  xmlValidGetPotentialChildren: function(ctree: xmlElementContentPtr; var names: xmlCharPtr; var len: cint; max: cint): cint; EXTDECL;
+  xmlValidGetValidElements: function(prev, next: xmlNodePtr; var names: xmlCharPtr; max: cint): cint; EXTDECL;
+  xmlValidateNameValue: function(value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateNamesValue: function(value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateNmtokenValue: function(value: xmlCharPtr): cint; EXTDECL;
+  xmlValidateNmtokensValue: function(value: xmlCharPtr): cint; EXTDECL;
+
+
+{$IFDEF LIBXML_REGEXP_ENABLED}
+(*
+ * Validation based on the regexp support
+ *)
+  xmlValidBuildContentModel: function(ctxt: xmlValidCtxtPtr; elem: xmlElementPtr): cint; EXTDECL;
+  xmlValidatePushElement: function(ctxt: xmlValidCtxtPtr; doc: xmlNodePtr; elem: xmlElementPtr; qname: xmlCharPtr): cint; EXTDECL;
+  xmlValidatePushCData: function(ctxt: xmlValidCtxtPtr; data: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlValidatePopElement: function(ctxt: xmlValidCtxtPtr; doc: xmlDocPtr; elem: xmlNodePtr; qname: xmlCharPtr): cint; EXTDECL;
+{$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+{$ENDIF} (* LIBXML_VALID_ENABLED *)
+{$ENDIF}

+ 99 - 0
packages/libxml/src/variables.inc

@@ -0,0 +1,99 @@
+(*
+ * Summary: interface for the variable matching and lookup.
+ * Description: interface for the variable matching and lookup.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+
+(**
+ * XSLT_REGISTER_VARIABLE_LOOKUP:
+ *
+ * Registering macro, not general purpose at all but used in different modules.
+ *)
+
+{
+#define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt)			\
+    xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt,		\
+	       xsltXPathVariableLookup,	(void *)(ctxt));	\
+    xsltRegisterAllFunctions((ctxt)->xpathCtxt);		\
+    xsltRegisterAllElement(ctxt);				\
+    (ctxt)->xpathCtxt->extra = ctxt
+}
+
+(*
+ * Flags for memory management of RVTs
+ *)
+
+{$IFDEF CONST}
+  (**
+   * XSLT_RVT_LOCAL:
+   *
+   * RVT is destroyed after the current instructions ends.
+   *)
+  XSLT_RVT_LOCAL = 1;
+
+  (**
+   * XSLT_RVT_FUNC_RESULT:
+   *
+   * RVT is part of results returned with func:result. The RVT won't be
+   * destroyed after exiting a template and will be reset to XSLT_RVT_LOCAL or
+   * XSLT_RVT_VARIABLE in the template that receives the return value.
+   *)
+  XSLT_RVT_FUNC_RESULT = 2;
+
+  (**
+   * XSLT_RVT_GLOBAL:
+   *
+   * RVT is part of a global variable.
+   *)
+  XSLT_RVT_GLOBAL = 3;
+{$ENDIF} {CONST}
+
+{$IFDEF FUNCTION}
+
+(*
+ * Interfaces for the variable module.
+ *)
+
+function xsltEvalGlobalVariables(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+function xsltEvalUserParams(ctxt: xsltTransformContextPtr; const params: PPAnsiChar): cint; EXTDECL; external xsltlib;
+function xsltQuoteUserParams(ctxt: xsltTransformContextPtr; const params: PPAnsiChar): cint; EXTDECL; external xsltlib;
+function xsltEvalOneUserParam(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const value: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltQuoteOneUserParam(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const value: xmlCharPtr): cint; EXTDECL; external xsltlib;
+procedure xsltParseGlobalVariable(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltParseGlobalParam(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltParseStylesheetVariable(ctxt: xsltTransformContextPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltParseStylesheetParam(ctxt: xsltTransformContextPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltParseStylesheetCallerParam(ctxt: xsltTransformContextPtr; cur: xmlNodePtr): xsltStackElemPtr; EXTDECL; external xsltlib;
+function xsltAddStackElemList(ctxt: xsltTransformContextPtr; elems: xsltStackElemPtr): cint; EXTDECL; external xsltlib;
+procedure xsltFreeGlobalVariables(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+function xsltVariableLookup(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathObjectPtr; EXTDECL; external xsltlib;
+function xsltXPathVariableLookup(ctxt: Pointer; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathObjectPtr; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+
+(*
+ * Interfaces for the variable module.
+ *)
+
+  xsltEvalGlobalVariables: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltEvalUserParams: function(ctxt: xsltTransformContextPtr; const params: PPAnsiChar): cint; EXTDECL;
+  xsltQuoteUserParams: function(ctxt: xsltTransformContextPtr; const params: PPAnsiChar): cint; EXTDECL;
+  xsltEvalOneUserParam: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const value: xmlCharPtr): cint; EXTDECL;
+  xsltQuoteOneUserParam: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const value: xmlCharPtr): cint; EXTDECL;
+  xsltParseGlobalVariable: procedure(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL;
+  xsltParseGlobalParam: procedure(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL;
+  xsltParseStylesheetVariable: procedure(ctxt: xsltTransformContextPtr; cur: xmlNodePtr); EXTDECL;
+  xsltParseStylesheetParam: procedure(ctxt: xsltTransformContextPtr; cur: xmlNodePtr); EXTDECL;
+  xsltParseStylesheetCallerParam: function(ctxt: xsltTransformContextPtr; cur: xmlNodePtr): xsltStackElemPtr; EXTDECL;
+  xsltAddStackElemList: function(ctxt: xsltTransformContextPtr; elems: xsltStackElemPtr): cint; EXTDECL;
+  xsltFreeGlobalVariables: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltVariableLookup: function(ctxt: xsltTransformContextPtr; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+  xsltXPathVariableLookup: function(ctxt: Pointer; const name: xmlCharPtr; const ns_uri: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+

+ 23 - 2
packages/libxml/src/xinclude.inc

@@ -90,6 +90,7 @@
 function xmlXIncludeProcess(doc: xmlDocPtr): cint; EXTDECL; external xml2lib;
 function xmlXIncludeProcessFlags(doc: xmlDocPtr; flags: cint): cint; EXTDECL; external xml2lib;
 function xmlXIncludeProcessFlagsData(doc: xmlDocPtr; flags: cint; data: pointer): cint; EXTDECL; external xml2lib;
+function xmlXIncludeProcessTreeFlagsData(tree: xmlNodePtr; flags: cint; data: pointer): cint; EXTDECL; external xml2lib;
 function xmlXIncludeProcessTree(tree: xmlNodePtr): cint; EXTDECL; external xml2lib;
 function xmlXIncludeProcessTreeFlags(tree: xmlNodePtr; flags: cint): cint; EXTDECL; external xml2lib;
 
@@ -97,9 +98,29 @@ function xmlXIncludeProcessTreeFlags(tree: xmlNodePtr; flags: cint): cint; EXTDE
  * contextual processing
  *)
 function xmlXIncludeNewContext(doc: xmlDocPtr): xmlXIncludeCtxtPtr; EXTDECL; external xml2lib;
-function xmlXIncludeProcessFlags(ctxt: xmlXIncludeCtxtPtr; flags: cint): cint; EXTDECL; external xml2lib;
-procedure xmlXIncludeProcess(ctxt: xmlXIncludeCtxtPtr); EXTDECL; external xml2lib;
+function xmlXIncludeSetFlags(ctxt: xmlXIncludeCtxtPtr; flags: cint): cint; EXTDECL; external xml2lib;
+procedure xmlXIncludeFreeContext(ctxt: xmlXIncludeCtxtPtr); EXTDECL; external xml2lib;
 function xmlXIncludeProcessNode(ctxt: xmlXIncludeCtxtPtr; tree: xmlNodePtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * standalone processing
+ *)
+  xmlXIncludeProcess: function(doc: xmlDocPtr): cint; EXTDECL;
+  xmlXIncludeProcessFlags: function(doc: xmlDocPtr; flags: cint): cint; EXTDECL;
+  xmlXIncludeProcessFlagsData: function(doc: xmlDocPtr; flags: cint; data: pointer): cint; EXTDECL;
+  xmlXIncludeProcessTreeFlagsData: function(tree: xmlNodePtr; flags: cint; data: pointer): cint; EXTDECL;
+  xmlXIncludeProcessTree: function(tree: xmlNodePtr): cint; EXTDECL;
+  xmlXIncludeProcessTreeFlags: function(tree: xmlNodePtr; flags: cint): cint; EXTDECL;
+
+(*
+ * contextual processing
+ *)
+  xmlXIncludeNewContext: function(doc: xmlDocPtr): xmlXIncludeCtxtPtr; EXTDECL;
+  xmlXIncludeSetFlags: function(ctxt: xmlXIncludeCtxtPtr; flags: cint): cint; EXTDECL;
+  xmlXIncludeFreeContext: procedure(ctxt: xmlXIncludeCtxtPtr); EXTDECL;
+  xmlXIncludeProcessNode: function(ctxt: xmlXIncludeCtxtPtr; tree: xmlNodePtr): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_XINCLUDE_ENABLED *)

+ 20 - 0
packages/libxml/src/xlink.inc

@@ -150,5 +150,25 @@ procedure xlinkSetDefaultHandler(handler: xlinkHandlerPtr); EXTDECL; external xm
 function xlinkIsLink(doc: xmlDocPtr; node: xmlNodePtr): xlinkType; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * The default detection routine, can be overridden, they call the default
+ * detection callbacks.
+ *)
+  xlinkGetDefaultDetect: function: xlinkNodeDetectFunc; EXTDECL;
+  xlinkSetDefaultDetect: procedure(func: xlinkNodeDetectFunc); EXTDECL;
+
+(*
+ * Routines to set/get the default handlers.
+ *)
+  xlinkGetDefaultHandler: function: xlinkHandlerPtr; EXTDECL;
+  xlinkSetDefaultHandler: procedure(handler: xlinkHandlerPtr); EXTDECL;
+
+(*
+ * Link detection module itself.
+ *)
+  xlinkIsLink: function(doc: xmlDocPtr; node: xmlNodePtr): xlinkType; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_XPTR_ENABLED *)
 

+ 26 - 1
packages/libxml/src/xml2.inc

@@ -1,4 +1,6 @@
-{$i xmlversion.inc}
+{$DEFINE DEFINES}
+  {$i xmlversion.inc}
+{$UNDEF DEFINES}
 
 type
   PFILE = pointer;
@@ -108,6 +110,7 @@ type
 *)
 {$DEFINE CONST}
 const
+  {$i xmlversion.inc}
   {$i catalog.inc}
   {$i chvalid.inc}
   {$i dict.inc}
@@ -156,7 +159,13 @@ const
 (*
   include functions
 *)
+{$IFDEF LIBXML_DYN}
+{$DEFINE FUNCTIONVAR}
+var
+{$ELSE}
 {$DEFINE FUNCTION}
+{$ENDIF}
+  {$i xmlversion.inc}
   {$i catalog.inc}
   {$i chvalid.inc}
   {$i dict.inc}
@@ -200,5 +209,21 @@ const
   {$i xlink.inc}
   {$i xinclude.inc}
   {$i xpointer.inc}
+{$IFDEF LIBXML_DYN}
+{$UNDEF FUNCTIONVAR}
+{$ELSE}
 {$UNDEF FUNCTION}
+{$ENDIF}
 
+{$DEFINE MACRO}
+  {$i xmlversion.inc}
+  {$i xpath.inc}
+  {$i HTMLparser.inc}
+{$UNDEF MACRO}
+
+{$DEFINE EXTVAR}
+  {$i chvalid.inc}
+  {$i globals.inc}
+  {$i xmlregexp.inc}
+  {$i xpath.inc}
+{$UNDEF EXTVAR}

+ 3 - 300
packages/libxml/src/xml2.pas

@@ -7,312 +7,15 @@
 unit xml2;
 {$ENDIF FPC_DOTTEDUNITS}
 
-{$mode objfpc}
-{$H+}
-{$macro on}
-
-{$ALIGN 8}
-{$MINENUMSIZE 4}
-
-interface
-
-{$IFDEF FPC_DOTTEDUNITS}
-uses
-  System.DynLibs,
-  System.CTypes,
-  System.Math;
-{$ELSE FPC_DOTTEDUNITS}
-uses
-  dynlibs,
-  ctypes,
-  math;
-{$ENDIF FPC_DOTTEDUNITS}
-
-const
-{$IF Defined(WINDOWS)}
-  xml2lib = 'libxml2.'+sharedsuffix;
-  {$DEFINE EXTDECL := cdecl}
-  {$DEFINE NO_EXTERNAL_VARS}
-{$ELSEIF Defined(UNIX)}
-  xml2lib = 'libxml2.'+sharedsuffix;
-  {$DEFINE EXTDECL := cdecl}
-{$ELSE}
-  {$MESSAGE ERROR 'Platform not supported right now'}
-{$IFEND}
+{$i xml2h.inc}
 
 {$i xml2.inc}
 
 implementation
 
-{$IFDEF NO_EXTERNAL_VARS}
-function GetxmlMalloc: xmlMallocFunc; inline;
-begin
-  Result := varxmlMalloc^;
-end;
-
-procedure SetxmlMalloc(AValue: xmlMallocFunc); inline;
-begin
-  varxmlMalloc^ := AValue;
-end;
-
-function GetxmlMallocAtomic: xmlMallocFunc; inline;
-begin
-  Result := varxmlMallocAtomic^;
-end;
-
-procedure SetxmlMallocAtomic(AValue: xmlMallocFunc); inline;
-begin
-  varxmlMallocAtomic^ := AValue;
-end;
-
-function GetxmlRealloc: xmlReallocFunc; inline;
-begin
-  Result := varxmlRealloc^;
-end;
-
-procedure SetxmlRealloc(AValue: xmlReallocFunc); inline;
-begin
-  varxmlRealloc^ := AValue;
-end;
-
-function GetxmlFree: xmlFreeFunc; inline;
-begin
-  Result := varxmlFree^;
-end;
-
-procedure SetxmlFree(AValue: xmlFreeFunc); inline;
-begin
-  varxmlFree^ := AValue;
-end;
-
-function GetxmlMemStrdup: xmlStrdupFunc; inline;
-begin
-  Result := varxmlMemStrdup^;
-end;
-
-procedure SetxmlMemStrdup(AValue: xmlStrdupFunc); inline;
-begin
-  varxmlMemStrdup^ := AValue;
-end;
-{$ENDIF}
+{$i fpcfunctions.inc}
 
-procedure fpcxmlFree(mem: pointer); EXTDECL;
-begin
-  FreeMem(mem);
-end;
-
-function fpcxmlMalloc(size: csize_t): pointer; EXTDECL;
-begin
-  GetMem(Result, size);
-end;
-
-function fpcxmlRealloc(mem: pointer; size: csize_t): pointer; EXTDECL;
-begin
-  Result := mem;
-  ReallocMem(Result, size);
-end;
-
-function fpcxmlStrdup(str: PAnsiChar): PAnsiChar; EXTDECL;
-var
-  L: SizeInt;
-begin
-  L := Length(str) + 1;
-  Getmem(Result, L);
-  if Result <> nil then
-    Move(str^, Result^, L);
-end;
-
-procedure fpcxmlStructuredErrorHandler(userData: pointer; error: xmlErrorPtr); EXTDECL;
-begin
-  writeln('struct error');
-end;
-
-
-(*
- * macros from xmlversion.inc
- *)
-
-procedure LIBXML_TEST_VERSION;
-begin
-  xmlCheckVersion(LIBXML_VERSION);
-end;
-
-
-(*
- * macros from xmlversion.inc
- *)
-
-
-(*
- * macros from chvalid.inc
- *)
-
-function xmlIsBaseChar_ch(c: cint): cbool;
-begin
-  Result :=
-    ((c >= $41) and (c <= $5A)) or
-    ((c >= $61) and (c <= $7A)) or
-    ((c >= $C0) and (c <= $D6)) or
-    ((c >= $D8) and (c <= $F6)) or
-     (c >= $F8);
-end;
-
-function xmlIsBaseCharQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsBaseChar_ch(c)
-  else
-    Result := xmlCharInRange(c, __xmlIsBaseCharGroup);
-end;
-
-function xmlIsBlank_ch(c: cint): cbool;
-begin
-  Result := (c = $20) or ((c >= $9) and (c <= $A)) or (c = $D);
-end;
-
-function xmlIsBlankQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsBaseChar_ch(c)
-  else
-    Result := false;
-end;
-
-function xmlIsChar_ch(c: cint): cbool;
-begin
-  Result := ((c >= $9) and (c <= $A)) or (c = $D) or (c >= $20);
-end;
-
-function xmlIsCharQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsChar_ch(c)
-  else
-    Result :=
-          ((c >= $000100) and (c <= $00D7FF)) or
-          ((c >= $00E000) and (c <= $00FFFD)) or
-          ((c >= $010000) and (c <= $10FFFF));
-end;
-
-function xmlIsCombiningQ(c: cint): cbool;
-begin
-    if c < $100 then
-    Result := false
-  else
-    Result := xmlCharInRange(c, __xmlIsCombiningGroup);
-end;
-
-function xmlIsDigit_ch(c: cint): cbool;
-begin
-  Result := (c >= $30) and (c <= $39);
-end;
-
-function xmlIsDigitQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsDigit_ch(c)
-  else
-    Result := xmlCharInRange(c, __xmlIsDigitGroup);
-end;
-
-function xmlIsExtender_ch(c: cint): cbool;
-begin
-  Result := c = $B7;
-end;
-
-function xmlIsExtenderQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsExtender_ch(c)
-  else
-    Result := xmlCharInRange(c, __xmlIsExtenderGroup);
-end;
-
-function xmlIsIdeographicQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := false
-  else
-    Result :=
-      ((c >= $4E00) and (c <= $9FA5)) or
-       (c  = $3007) or
-      ((c >= $3021) and (c <= $3029));
-end;
-
-function xmlIsPubidChar_ch(c: cint): cbool;
-begin
-  if (c >= 0) and (c <= 255) then
-    Result := __xmlIsPubidChar_tab^[c]
-  else
-    Result := false;
-end;
-
-function xmlIsPubidCharQ(c: cint): cbool;
-begin
-  if c < $100 then
-    Result := xmlIsPubidChar_ch(c)
-  else
-    Result := false;
-end;
-
-
-(*
- * macros from HTMLparser.inc
- *)
-
-function htmlDefaultSubelement(elt: htmlElemDescPtr): PAnsiChar;
-begin
-  Result := elt^.defaultsubelt;
-end;
-
-function htmlElementAllowedHereDesc(parent: htmlElemDescPtr; elt: htmlElemDescPtr): cint;
-begin
-  Result := htmlElementAllowedHere(parent, xmlCharPtr(elt^.name));
-end;
-
-function htmlRequiredAttrs(elt: htmlElemDescPtr): PPAnsiChar;
-begin
-  Result := elt^.attrs_req;
-end;
-
-
-(*
- * macros from tree.inc
- *)
-
-function XML_GET_CONTENT(n: pointer): xmlCharPtr;
-begin
-  if xmlNodePtr(n)^._type = XML_ELEMENT_NODE then
-    Result := nil
-  else
-    Result := xmlNodePtr(n)^.content;
-end;
-
-
-(*
- * macros from xpath.inc
- *)
-
-function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint;
-begin
-  if assigned(ns) then
-    Result := ns^.nodeNr
-  else
-    Result := 0;
-end;
-
-function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr;
-begin
-  if assigned(ns) and (index >= 0) and (index < ns^.nodeNr) then
-    Result := ns^.nodeTab[index]
-  else
-    Result := nil;
-end;
-
-function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean;
-begin
-  Result := not assigned(ns) or (ns^.nodeNr = 0) or (ns^.nodeTab = nil);
-end;
+{$i macros.inc}
 
 {$IFDEF NO_EXTERNAL_VARS}
 procedure LoadExternalVariables;

+ 3706 - 0
packages/libxml/src/xml2dyn.pas

@@ -0,0 +1,3706 @@
+{
+  Translation of the libxml2 headers for FreePascal
+  Copyright (C) 2008 by Ivo Steinmann
+}
+
+{$IFNDEF FPC_DOTTEDUNITS}
+unit xml2dyn;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$DEFINE LIBXML_DYN}
+{$DEFINE NIL_FUNCVARS_ON_FREE}
+
+{$i xml2h.inc}
+
+{$IFNDEF NO_EXTERNAL_VARS}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ENDIF}
+
+{$i xml2.inc}
+
+var
+  libXmlHandle: TLibHandle = NilHandle;
+
+function LoadLibXML(AFileName: String = ''; InstallFpcMemFunc: Boolean = True): Boolean;
+procedure FreeLibXML;
+
+implementation
+
+{$i fpcfunctions.inc}
+
+{$i macros.inc}
+
+function LoadLibXML(AFileName: String; InstallFpcMemFunc: Boolean): Boolean;
+var
+  mask : TFPUExceptionMask;
+begin
+  if AFileName = '' then
+    AFileName := xml2lib;
+  libXmlHandle := LoadLibrary(AFileName);
+  if libXmlHandle <> NilHandle then
+  begin
+  { xmlregexp.inc }
+   {__emptyExp := xmlExpNodePtrPtr(GetProcAddress(libXmlHandle, 'emptyExp'));
+    __forbiddenExp := xmlExpNodePtrPtr(GetProcAddress(libXmlHandle, 'forbiddenExp'));}
+
+  { paserInternals.inc }
+    //__xmlParserMaxDepth := PCardinal(GetProcAddress(libXmlHandle, 'xmlParserMaxDepth'));
+
+  {  }
+   {xmlStringComment := PAnsiChar(GetProcAddress(libXmlHandle, 'xmlStringComment'));
+    xmlStringText := PAnsiChar(GetProcAddress(libXmlHandle, 'xmlStringText'));
+    xmlStringTextNoenc := PAnsiChar(GetProcAddress(libXmlHandle, 'xmlStringTextNoenc'));}
+
+  { chvalid.inc }
+    __xmlIsBaseCharGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsBaseCharGroup'));
+    __xmlIsCharGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsCharGroup'));
+    __xmlIsCombiningGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsCombiningGroup'));
+    __xmlIsDigitGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsDigitGroup'));
+    __xmlIsExtenderGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsExtenderGroup'));
+    __xmlIsIdeographicGroup := xmlChRangeGroupPtr(GetProcAddress(libXmlHandle, 'xmlIsIdeographicGroup'));
+    __xmlIsPubidChar_tab := GetProcAddress(libXmlHandle, 'xmlIsPubidChar_tab');
+
+  { globals.inc }
+    varxmlMalloc := PxmlMallocFunc(GetProcAddress(libXmlHandle, 'xmlMalloc'));
+    varxmlMallocAtomic := PxmlMallocFunc(GetProcAddress(libXmlHandle, 'xmlMallocAtomic'));
+    varxmlRealloc := PxmlReallocFunc(GetProcAddress(libXmlHandle, 'xmlRealloc'));
+    varxmlFree := PxmlFreeFunc(GetProcAddress(libXmlHandle, 'xmlFree'));
+    varxmlMemStrdup := PxmlStrdupFunc(GetProcAddress(libXmlHandle, 'xmlMemStrdup'));
+
+  { xpath.inc }
+   {__xmlXPathNAN := PDouble(GetProcAddress(libXmlHandle, 'xmlXPathNAN'));
+    __xmlXPathNINF := PDouble(GetProcAddress(libXmlHandle, 'xmlXPathNINF'));
+    __xmlXPathPINF := PDouble(GetProcAddress(libXmlHandle, 'xmlXPathPINF'));}
+
+
+    { xmlversion.inc }
+    Pointer(xmlCheckVersion) := GetProcAddress(libXmlHandle, 'xmlCheckVersion');
+
+    { catalog.inc }
+  {$IFDEF LIBXML_CATALOG_ENABLED}
+    Pointer(xmlNewCatalog) := GetProcAddress(libXmlHandle, 'xmlNewCatalog');
+    Pointer(xmlLoadACatalog) := GetProcAddress(libXmlHandle, 'xmlLoadACatalog');
+    Pointer(xmlLoadSGMLSuperCatalog) := GetProcAddress(libXmlHandle, 'xmlLoadSGMLSuperCatalog');
+    Pointer(xmlConvertSGMLCatalog) := GetProcAddress(libXmlHandle, 'xmlConvertSGMLCatalog');
+    //xmlLoadACatalog
+    Pointer(xmlACatalogAdd) := GetProcAddress(libXmlHandle, 'xmlACatalogAdd');
+    Pointer(xmlACatalogRemove) := GetProcAddress(libXmlHandle, 'xmlACatalogRemove');
+    Pointer(xmlACatalogResolve) := GetProcAddress(libXmlHandle, 'xmlACatalogResolve');
+    Pointer(xmlACatalogResolveSystem) := GetProcAddress(libXmlHandle, 'xmlACatalogResolveSystem');
+    Pointer(xmlACatalogResolvePublic) := GetProcAddress(libXmlHandle, 'xmlACatalogResolvePublic');
+    Pointer(xmlACatalogResolveURI) := GetProcAddress(libXmlHandle, 'xmlACatalogResolveURI');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlACatalogDump) := GetProcAddress(libXmlHandle, 'xmlACatalogDump');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlFreeCatalog) := GetProcAddress(libXmlHandle, 'xmlFreeCatalog');
+    Pointer(xmlCatalogIsEmpty) := GetProcAddress(libXmlHandle, 'xmlCatalogIsEmpty');
+    Pointer(xmlInitializeCatalog) := GetProcAddress(libXmlHandle, 'xmlInitializeCatalog');
+    Pointer(xmlLoadCatalog) := GetProcAddress(libXmlHandle, 'xmlLoadCatalog');
+    Pointer(xmlLoadCatalogs) := GetProcAddress(libXmlHandle, 'xmlLoadCatalogs');
+    Pointer(xmlCatalogCleanup) := GetProcAddress(libXmlHandle, 'xmlCatalogCleanup');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlCatalogDump) := GetProcAddress(libXmlHandle, 'xmlCatalogDump');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlCatalogResolve) := GetProcAddress(libXmlHandle, 'xmlCatalogResolve');
+    Pointer(xmlCatalogResolveSystem) := GetProcAddress(libXmlHandle, 'xmlCatalogResolveSystem');
+    Pointer(xmlCatalogResolvePublic) := GetProcAddress(libXmlHandle, 'xmlCatalogResolvePublic');
+    Pointer(xmlCatalogResolveURI) := GetProcAddress(libXmlHandle, 'xmlCatalogResolveURI');
+    Pointer(xmlCatalogAdd) := GetProcAddress(libXmlHandle, 'xmlCatalogAdd');
+    Pointer(xmlCatalogRemove) := GetProcAddress(libXmlHandle, 'xmlCatalogRemove');
+    Pointer(xmlParseCatalogFile) := GetProcAddress(libXmlHandle, 'xmlParseCatalogFile');
+    Pointer(xmlCatalogConvert) := GetProcAddress(libXmlHandle, 'xmlCatalogConvert');
+    Pointer(xmlCatalogFreeLocal) := GetProcAddress(libXmlHandle, 'xmlCatalogFreeLocal');
+    Pointer(xmlCatalogAddLocal) := GetProcAddress(libXmlHandle, 'xmlCatalogAddLocal');
+    Pointer(xmlCatalogLocalResolve) := GetProcAddress(libXmlHandle, 'xmlCatalogLocalResolve');
+    Pointer(xmlCatalogLocalResolveURI) := GetProcAddress(libXmlHandle, 'xmlCatalogLocalResolveURI');
+    Pointer(xmlCatalogSetDebug) := GetProcAddress(libXmlHandle, 'xmlCatalogSetDebug');
+    Pointer(xmlCatalogSetDefaultPrefer) := GetProcAddress(libXmlHandle, 'xmlCatalogSetDefaultPrefer');
+    Pointer(xmlCatalogSetDefaults) := GetProcAddress(libXmlHandle, 'xmlCatalogSetDefaults');
+    Pointer(xmlCatalogGetDefaults) := GetProcAddress(libXmlHandle, 'xmlCatalogGetDefaults');
+  {$ENDIF} (* LIBXML_CATALOG_ENABLED *)
+
+    { chvalid.inc }
+    Pointer(xmlCharInRange) := GetProcAddress(libXmlHandle, 'xmlCharInRange');
+    Pointer(xmlIsBaseChar) := GetProcAddress(libXmlHandle, 'xmlIsBaseChar');
+    Pointer(xmlIsBlank) := GetProcAddress(libXmlHandle, 'xmlIsBlank');
+    Pointer(xmlIsChar) := GetProcAddress(libXmlHandle, 'xmlIsChar');
+    Pointer(xmlIsCombining) := GetProcAddress(libXmlHandle, 'xmlIsCombining');
+    Pointer(xmlIsDigit) := GetProcAddress(libXmlHandle, 'xmlIsDigit');
+    Pointer(xmlIsExtender) := GetProcAddress(libXmlHandle, 'xmlIsExtender');
+    Pointer(xmlIsIdeographic) := GetProcAddress(libXmlHandle, 'xmlIsIdeographic');
+    Pointer(xmlIsPubidChar) := GetProcAddress(libXmlHandle, 'xmlIsPubidChar');
+
+    { dict.inc }
+    Pointer(xmlInitializeDict) := GetProcAddress(libXmlHandle, 'xmlInitializeDict');
+    Pointer(xmlDictCreate) := GetProcAddress(libXmlHandle, 'xmlDictCreate');
+    Pointer(xmlDictSetLimit) := GetProcAddress(libXmlHandle, 'xmlDictSetLimit');
+    Pointer(xmlDictGetUsage) := GetProcAddress(libXmlHandle, 'xmlDictGetUsage');
+    Pointer(xmlDictCreateSub) := GetProcAddress(libXmlHandle, 'xmlDictCreateSub');
+    Pointer(xmlDictReference) := GetProcAddress(libXmlHandle, 'xmlDictReference');
+    Pointer(xmlDictFree) := GetProcAddress(libXmlHandle, 'xmlDictFree');
+    Pointer(xmlDictLookup) := GetProcAddress(libXmlHandle, 'xmlDictLookup');
+    Pointer(xmlDictExists) := GetProcAddress(libXmlHandle, 'xmlDictExists');
+    Pointer(xmlDictQLookup) := GetProcAddress(libXmlHandle, 'xmlDictQLookup');
+    Pointer(xmlDictOwns) := GetProcAddress(libXmlHandle, 'xmlDictOwns');
+    Pointer(xmlDictSize) := GetProcAddress(libXmlHandle, 'xmlDictSize');
+    Pointer(xmlDictCleanup) := GetProcAddress(libXmlHandle, 'xmlDictCleanup');
+
+    { encoding.inc }
+    Pointer(xmlInitCharEncodingHandlers) := GetProcAddress(libXmlHandle, 'xmlInitCharEncodingHandlers');
+    Pointer(xmlCleanupCharEncodingHandlers) := GetProcAddress(libXmlHandle, 'xmlCleanupCharEncodingHandlers');
+    Pointer(xmlRegisterCharEncodingHandler) := GetProcAddress(libXmlHandle, 'xmlRegisterCharEncodingHandler');
+    Pointer(xmlGetCharEncodingHandler) := GetProcAddress(libXmlHandle, 'xmlGetCharEncodingHandler');
+    Pointer(xmlFindCharEncodingHandler) := GetProcAddress(libXmlHandle, 'xmlFindCharEncodingHandler');
+    Pointer(xmlNewCharEncodingHandler) := GetProcAddress(libXmlHandle, 'xmlNewCharEncodingHandler');
+    Pointer(xmlAddEncodingAlias) := GetProcAddress(libXmlHandle, 'xmlAddEncodingAlias');
+    Pointer(xmlDelEncodingAlias) := GetProcAddress(libXmlHandle, 'xmlDelEncodingAlias');
+    Pointer(xmlGetEncodingAlias) := GetProcAddress(libXmlHandle, 'xmlGetEncodingAlias');
+    Pointer(xmlCleanupEncodingAliases) := GetProcAddress(libXmlHandle, 'xmlCleanupEncodingAliases');
+    Pointer(xmlParseCharEncoding) := GetProcAddress(libXmlHandle, 'xmlParseCharEncoding');
+    Pointer(xmlGetCharEncodingName) := GetProcAddress(libXmlHandle, 'xmlGetCharEncodingName');
+    Pointer(xmlDetectCharEncoding) := GetProcAddress(libXmlHandle, 'xmlDetectCharEncoding');
+    Pointer(xmlCharEncOutFunc) := GetProcAddress(libXmlHandle, 'xmlCharEncOutFunc');
+    Pointer(xmlCharEncInFunc) := GetProcAddress(libXmlHandle, 'xmlCharEncInFunc');
+    Pointer(xmlCharEncFirstLine) := GetProcAddress(libXmlHandle, 'xmlCharEncFirstLine');
+    Pointer(xmlCharEncCloseFunc) := GetProcAddress(libXmlHandle, 'xmlCharEncCloseFunc');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(UTF8Toisolat1) := GetProcAddress(libXmlHandle, 'UTF8Toisolat1');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(isolat1ToUTF8) := GetProcAddress(libXmlHandle, 'isolat1ToUTF8');
+
+    { tree.inc }
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or
+    defined(LIBXML_DEBUG_ENABLED) or defined (LIBXML_HTML_ENABLED) or defined(LIBXML_SAX1_ENABLED) or
+    defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+    Pointer(xmlValidateNCName) := GetProcAddress(libXmlHandle, 'xmlValidateNCName');
+  {$ENDIF}
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlValidateQName) := GetProcAddress(libXmlHandle, 'xmlValidateQName');
+    Pointer(xmlValidateName) := GetProcAddress(libXmlHandle, 'xmlValidateName');
+    Pointer(xmlValidateNMToken) := GetProcAddress(libXmlHandle, 'xmlValidateNMToken');
+  {$ENDIF}
+    Pointer(xmlBuildQName) := GetProcAddress(libXmlHandle, 'xmlBuildQName');
+    Pointer(xmlSplitQName2) := GetProcAddress(libXmlHandle, 'xmlSplitQName2');
+    Pointer(xmlSplitQName3) := GetProcAddress(libXmlHandle, 'xmlSplitQName3');
+    Pointer(xmlSetBufferAllocationScheme) := GetProcAddress(libXmlHandle, 'xmlSetBufferAllocationScheme');
+    Pointer(xmlGetBufferAllocationScheme) := GetProcAddress(libXmlHandle, 'xmlGetBufferAllocationScheme');
+    Pointer(xmlBufferCreate) := GetProcAddress(libXmlHandle, 'xmlBufferCreate');
+    Pointer(xmlBufferCreateSize) := GetProcAddress(libXmlHandle, 'xmlBufferCreateSize');
+    Pointer(xmlBufferCreateStatic) := GetProcAddress(libXmlHandle, 'xmlBufferCreateStatic');
+    Pointer(xmlBufferResize) := GetProcAddress(libXmlHandle, 'xmlBufferResize');
+    Pointer(xmlBufferFree) := GetProcAddress(libXmlHandle, 'xmlBufferFree');
+    Pointer(xmlBufferDump) := GetProcAddress(libXmlHandle, 'xmlBufferDump');
+    Pointer(xmlBufferAdd) := GetProcAddress(libXmlHandle, 'xmlBufferAdd');
+    Pointer(xmlBufferAddHead) := GetProcAddress(libXmlHandle, 'xmlBufferAddHead');
+    Pointer(xmlBufferCat) := GetProcAddress(libXmlHandle, 'xmlBufferCat');
+    Pointer(xmlBufferCCat) := GetProcAddress(libXmlHandle, 'xmlBufferCCat');
+    Pointer(xmlBufferShrink) := GetProcAddress(libXmlHandle, 'xmlBufferShrink');
+    Pointer(xmlBufferGrow) := GetProcAddress(libXmlHandle, 'xmlBufferGrow');
+    Pointer(xmlBufferEmpty) := GetProcAddress(libXmlHandle, 'xmlBufferEmpty');
+    Pointer(xmlBufferContent) := GetProcAddress(libXmlHandle, 'xmlBufferContent');
+    Pointer(xmlBufferDetach) := GetProcAddress(libXmlHandle, 'xmlBufferDetach');
+    Pointer(xmlBufferSetAllocationScheme) := GetProcAddress(libXmlHandle, 'xmlBufferSetAllocationScheme');
+    Pointer(xmlBufferLength) := GetProcAddress(libXmlHandle, 'xmlBufferLength');
+    Pointer(xmlCreateIntSubset) := GetProcAddress(libXmlHandle, 'xmlCreateIntSubset');
+    Pointer(xmlNewDtd) := GetProcAddress(libXmlHandle, 'xmlNewDtd');
+    Pointer(xmlGetIntSubset) := GetProcAddress(libXmlHandle, 'xmlGetIntSubset');
+    Pointer(xmlFreeDtd) := GetProcAddress(libXmlHandle, 'xmlFreeDtd');
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(xmlNewGlobalNs) := GetProcAddress(libHandle, 'xmlNewGlobalNs');
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+    Pointer(xmlNewNs) := GetProcAddress(libXmlHandle, 'xmlNewNs');
+    Pointer(xmlFreeNs) := GetProcAddress(libXmlHandle, 'xmlFreeNs');
+    Pointer(xmlFreeNsList) := GetProcAddress(libXmlHandle, 'xmlFreeNsList');
+    Pointer(xmlNewDoc) := GetProcAddress(libXmlHandle, 'xmlNewDoc');
+    Pointer(xmlFreeDoc) := GetProcAddress(libXmlHandle, 'xmlFreeDoc');
+    Pointer(xmlNewDocProp) := GetProcAddress(libXmlHandle, 'xmlNewDocProp');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlNewProp) := GetProcAddress(libXmlHandle, 'xmlNewProp');
+  {$ENDIF}
+    Pointer(xmlNewNsProp) := GetProcAddress(libXmlHandle, 'xmlNewNsProp');
+    Pointer(xmlNewNsPropEatName) := GetProcAddress(libXmlHandle, 'xmlNewNsPropEatName');
+    Pointer(xmlFreePropList) := GetProcAddress(libXmlHandle, 'xmlFreePropList');
+    Pointer(xmlFreeProp) := GetProcAddress(libXmlHandle, 'xmlFreeProp');
+    Pointer(xmlCopyProp) := GetProcAddress(libXmlHandle, 'xmlCopyProp');
+    Pointer(xmlCopyPropList) := GetProcAddress(libXmlHandle, 'xmlCopyPropList');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyDtd) := GetProcAddress(libXmlHandle, 'xmlCopyDtd');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlCopyDoc) := GetProcAddress(libXmlHandle, 'xmlCopyDoc');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+    Pointer(xmlNewDocNode) := GetProcAddress(libXmlHandle, 'xmlNewDocNode');
+    Pointer(xmlNewDocNodeEatName) := GetProcAddress(libXmlHandle, 'xmlNewDocNodeEatName');
+    Pointer(xmlNewNode) := GetProcAddress(libXmlHandle, 'xmlNewNode');
+    Pointer(xmlNewNodeEatName) := GetProcAddress(libXmlHandle, 'xmlNewNodeEatName');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlNewChild) := GetProcAddress(libXmlHandle, 'xmlNewChild');
+  {$ENDIF}
+    Pointer(xmlNewDocText) := GetProcAddress(libXmlHandle, 'xmlNewDocText');
+    Pointer(xmlNewText) := GetProcAddress(libXmlHandle, 'xmlNewText');
+    Pointer(xmlNewDocPI) := GetProcAddress(libXmlHandle, 'xmlNewDocPI');
+    Pointer(xmlNewPI) := GetProcAddress(libXmlHandle, 'xmlNewPI');
+    Pointer(xmlNewDocTextLen) := GetProcAddress(libXmlHandle, 'xmlNewDocTextLen');
+    Pointer(xmlNewTextLen) := GetProcAddress(libXmlHandle, 'xmlNewTextLen');
+    Pointer(xmlNewDocComment) := GetProcAddress(libXmlHandle, 'xmlNewDocComment');
+    Pointer(xmlNewComment) := GetProcAddress(libXmlHandle, 'xmlNewComment');
+    Pointer(xmlNewCDataBlock) := GetProcAddress(libXmlHandle, 'xmlNewCDataBlock');
+    Pointer(xmlNewCharRef) := GetProcAddress(libXmlHandle, 'xmlNewCharRef');
+    Pointer(xmlNewReference) := GetProcAddress(libXmlHandle, 'xmlNewReference');
+    Pointer(xmlCopyNode) := GetProcAddress(libXmlHandle, 'xmlCopyNode');
+    Pointer(xmlDocCopyNode) := GetProcAddress(libXmlHandle, 'xmlDocCopyNode');
+    Pointer(xmlDocCopyNodeList) := GetProcAddress(libXmlHandle, 'xmlDocCopyNodeList');
+    Pointer(xmlCopyNodeList) := GetProcAddress(libXmlHandle, 'xmlCopyNodeList');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlNewTextChild) := GetProcAddress(libXmlHandle, 'xmlNewTextChild');
+    Pointer(xmlNewDocRawNode) := GetProcAddress(libXmlHandle, 'xmlNewDocRawNode');
+    Pointer(xmlNewDocFragment) := GetProcAddress(libXmlHandle, 'xmlNewDocFragment');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlGetLineNo) := GetProcAddress(libXmlHandle, 'xmlGetLineNo');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_DEBUG_ENABLED)}
+    Pointer(xmlGetNodePath) := GetProcAddress(libXmlHandle, 'xmlGetNodePath');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) *)
+    Pointer(xmlDocGetRootElement) := GetProcAddress(libXmlHandle, 'xmlDocGetRootElement');
+    Pointer(xmlGetLastChild) := GetProcAddress(libXmlHandle, 'xmlGetLastChild');
+    Pointer(xmlNodeIsText) := GetProcAddress(libXmlHandle, 'xmlNodeIsText');
+    Pointer(xmlIsBlankNode) := GetProcAddress(libXmlHandle, 'xmlIsBlankNode');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+    Pointer(xmlDocSetRootElement) := GetProcAddress(libXmlHandle, 'xmlDocSetRootElement');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlNodeSetName) := GetProcAddress(libXmlHandle, 'xmlNodeSetName');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlAddChild) := GetProcAddress(libXmlHandle, 'xmlAddChild');
+    Pointer(xmlAddChildList) := GetProcAddress(libXmlHandle, 'xmlAddChildList');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+    Pointer(xmlReplaceNode) := GetProcAddress(libXmlHandle, 'xmlReplaceNode');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlAddPrevSibling) := GetProcAddress(libXmlHandle, 'xmlAddPrevSibling');
+  {$ENDIF} (* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED *)
+    Pointer(xmlAddSibling) := GetProcAddress(libXmlHandle, 'xmlAddSibling');
+    Pointer(xmlAddNextSibling) := GetProcAddress(libXmlHandle, 'xmlAddNextSibling');
+    Pointer(xmlUnlinkNode) := GetProcAddress(libXmlHandle, 'xmlUnlinkNode');
+    Pointer(xmlTextMerge) := GetProcAddress(libXmlHandle, 'xmlTextMerge');
+    Pointer(xmlTextConcat) := GetProcAddress(libXmlHandle, 'xmlTextConcat');
+    Pointer(xmlFreeNodeList) := GetProcAddress(libXmlHandle, 'xmlFreeNodeList');
+    Pointer(xmlFreeNode) := GetProcAddress(libXmlHandle, 'xmlFreeNode');
+    Pointer(xmlSetTreeDoc) := GetProcAddress(libXmlHandle, 'xmlSetTreeDoc');
+    Pointer(xmlSetListDoc) := GetProcAddress(libXmlHandle, 'xmlSetListDoc');
+    Pointer(xmlSearchNs) := GetProcAddress(libXmlHandle, 'xmlSearchNs');
+    Pointer(xmlSearchNsByHref) := GetProcAddress(libXmlHandle, 'xmlSearchNsByHref');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlGetNsList) := GetProcAddress(libXmlHandle, 'xmlGetNsList');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) *)
+    Pointer(xmlSetNs) := GetProcAddress(libXmlHandle, 'xmlSetNs');
+    Pointer(xmlCopyNamespace) := GetProcAddress(libXmlHandle, 'xmlCopyNamespace');
+    Pointer(xmlCopyNamespaceList) := GetProcAddress(libXmlHandle, 'xmlCopyNamespaceList');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or defined(LIBXML_HTML_ENABLED)}
+    Pointer(xmlSetProp) := GetProcAddress(libXmlHandle, 'xmlSetProp');
+    Pointer(xmlSetNsProp) := GetProcAddress(libXmlHandle, 'xmlSetNsProp');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) *)
+    Pointer(xmlGetNoNsProp) := GetProcAddress(libXmlHandle, 'xmlGetNoNsProp');
+    Pointer(xmlGetProp) := GetProcAddress(libXmlHandle, 'xmlGetProp');
+    Pointer(xmlHasProp) := GetProcAddress(libXmlHandle, 'xmlHasProp');
+    Pointer(xmlHasNsProp) := GetProcAddress(libXmlHandle, 'xmlHasNsProp');
+    Pointer(xmlGetNsProp) := GetProcAddress(libXmlHandle, 'xmlGetNsProp');
+    Pointer(xmlStringGetNodeList) := GetProcAddress(libXmlHandle, 'xmlStringGetNodeList');
+    Pointer(xmlStringLenGetNodeList) := GetProcAddress(libXmlHandle, 'xmlStringLenGetNodeList');
+    Pointer(xmlNodeListGetString) := GetProcAddress(libXmlHandle, 'xmlNodeListGetString');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlNodeListGetRawString) := GetProcAddress(libXmlHandle, 'xmlNodeListGetRawString');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlNodeSetContent) := GetProcAddress(libXmlHandle, 'xmlNodeSetContent');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlNodeSetContentLen) := GetProcAddress(libXmlHandle, 'xmlNodeSetContentLen');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlNodeAddContent) := GetProcAddress(libXmlHandle, 'xmlNodeAddContent');
+    Pointer(xmlNodeAddContentLen) := GetProcAddress(libXmlHandle, 'xmlNodeAddContentLen');
+    Pointer(xmlNodeGetContent) := GetProcAddress(libXmlHandle, 'xmlNodeGetContent');
+    Pointer(xmlNodeBufGetContent) := GetProcAddress(libXmlHandle, 'xmlNodeBufGetContent');
+    Pointer(xmlNodeGetLang) := GetProcAddress(libXmlHandle, 'xmlNodeGetLang');
+    Pointer(xmlNodeGetSpacePreserve) := GetProcAddress(libXmlHandle, 'xmlNodeGetSpacePreserve');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlNodeSetLang) := GetProcAddress(libXmlHandle, 'xmlNodeSetLang');
+    Pointer(xmlNodeSetSpacePreserve) := GetProcAddress(libXmlHandle, 'xmlNodeSetSpacePreserve');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlNodeGetBase) := GetProcAddress(libXmlHandle, 'xmlNodeGetBase');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED)}
+    Pointer(xmlNodeSetBase) := GetProcAddress(libXmlHandle, 'xmlNodeSetBase');
+  {$ENDIF}
+    Pointer(xmlRemoveProp) := GetProcAddress(libXmlHandle, 'xmlRemoveProp');
+  {$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlUnsetNsProp) := GetProcAddress(libXmlHandle, 'xmlUnsetNsProp');
+    Pointer(xmlUnsetProp) := GetProcAddress(libXmlHandle, 'xmlUnsetProp');
+  {$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlReconciliateNs) := GetProcAddress(libXmlHandle, 'xmlReconciliateNs');
+  {$ENDIF}
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlDocDumpFormatMemory) := GetProcAddress(libXmlHandle, 'xmlDocDumpFormatMemory');
+    Pointer(xmlDocDumpMemory) := GetProcAddress(libXmlHandle, 'xmlDocDumpMemory');
+    Pointer(xmlDocDumpMemoryEnc) := GetProcAddress(libXmlHandle, 'xmlDocDumpMemoryEnc');
+    Pointer(xmlDocDumpFormatMemoryEnc) := GetProcAddress(libXmlHandle, 'xmlDocDumpFormatMemoryEnc');
+    Pointer(xmlDocFormatDump) := GetProcAddress(libXmlHandle, 'xmlDocFormatDump');
+    Pointer(xmlDocDump) := GetProcAddress(libXmlHandle, 'xmlDocDump');
+    Pointer(xmlElemDump) := GetProcAddress(libXmlHandle, 'xmlElemDump');
+    Pointer(xmlSaveFormatFile) := GetProcAddress(libXmlHandle, 'xmlSaveFormatFile');
+    Pointer(xmlSaveFile) := GetProcAddress(libXmlHandle, 'xmlSaveFile');
+    Pointer(xmlBufNodeDump) := GetProcAddress(libXmlHandle, 'xmlBufNodeDump');
+    Pointer(xmlNodeDump) := GetProcAddress(libXmlHandle, 'xmlNodeDump');
+    Pointer(xmlSaveFileTo) := GetProcAddress(libXmlHandle, 'xmlSaveFileTo');
+    Pointer(xmlSaveFormatFileTo) := GetProcAddress(libXmlHandle, 'xmlSaveFormatFileTo');
+    Pointer(xmlNodeDumpOutput) := GetProcAddress(libXmlHandle, 'xmlNodeDumpOutput');
+    Pointer(xmlSaveFormatFileEnc) := GetProcAddress(libXmlHandle, 'xmlSaveFormatFileEnc');
+    Pointer(xmlSaveFileEnc) := GetProcAddress(libXmlHandle, 'xmlSaveFileEnc');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlIsXHTML) := GetProcAddress(libXmlHandle, 'xmlIsXHTML');
+    Pointer(xmlGetDocCompressMode) := GetProcAddress(libXmlHandle, 'xmlGetDocCompressMode');
+    Pointer(xmlSetDocCompressMode) := GetProcAddress(libXmlHandle, 'xmlSetDocCompressMode');
+    Pointer(xmlGetCompressMode) := GetProcAddress(libXmlHandle, 'xmlGetCompressMode');
+    Pointer(xmlSetCompressMode) := GetProcAddress(libXmlHandle, 'xmlSetCompressMode');
+    Pointer(xmlDOMWrapNewCtxt) := GetProcAddress(libXmlHandle, 'xmlDOMWrapNewCtxt');
+    Pointer(xmlDOMWrapFreeCtxt) := GetProcAddress(libXmlHandle, 'xmlDOMWrapFreeCtxt');
+    Pointer(xmlDOMWrapReconcileNamespaces) := GetProcAddress(libXmlHandle, 'xmlDOMWrapReconcileNamespaces');
+    Pointer(xmlDOMWrapAdoptNode) := GetProcAddress(libXmlHandle, 'xmlDOMWrapAdoptNode');
+    Pointer(xmlDOMWrapRemoveNode) := GetProcAddress(libXmlHandle, 'xmlDOMWrapRemoveNode');
+    Pointer(xmlDOMWrapCloneNode) := GetProcAddress(libXmlHandle, 'xmlDOMWrapCloneNode');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlChildElementCount) := GetProcAddress(libXmlHandle, 'xmlChildElementCount');
+    Pointer(xmlNextElementSibling) := GetProcAddress(libXmlHandle, 'xmlNextElementSibling');
+    Pointer(xmlFirstElementChild) := GetProcAddress(libXmlHandle, 'xmlFirstElementChild');
+    Pointer(xmlLastElementChild) := GetProcAddress(libXmlHandle, 'xmlLastElementChild');
+    Pointer(xmlPreviousElementSibling) := GetProcAddress(libXmlHandle, 'xmlPreviousElementSibling');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+
+    { list.inc }
+    Pointer(xmlListCreate) := GetProcAddress(libXmlHandle, 'xmlListCreate');
+    Pointer(xmlListDelete) := GetProcAddress(libXmlHandle, 'xmlListDelete');
+    Pointer(xmlListSearch) := GetProcAddress(libXmlHandle, 'xmlListSearch');
+    Pointer(xmlListReverseSearch) := GetProcAddress(libXmlHandle, 'xmlListReverseSearch');
+    Pointer(xmlListInsert) := GetProcAddress(libXmlHandle, 'xmlListInsert');
+    Pointer(xmlListAppend) := GetProcAddress(libXmlHandle, 'xmlListAppend');
+    Pointer(xmlListRemoveFirst) := GetProcAddress(libXmlHandle, 'xmlListRemoveFirst');
+    Pointer(xmlListRemoveLast) := GetProcAddress(libXmlHandle, 'xmlListRemoveLast');
+    Pointer(xmlListRemoveAll) := GetProcAddress(libXmlHandle, 'xmlListRemoveAll');
+    Pointer(xmlListClear) := GetProcAddress(libXmlHandle, 'xmlListClear');
+    Pointer(xmlListEmpty) := GetProcAddress(libXmlHandle, 'xmlListEmpty');
+    Pointer(xmlListFront) := GetProcAddress(libXmlHandle, 'xmlListFront');
+    Pointer(xmlListEnd) := GetProcAddress(libXmlHandle, 'xmlListEnd');
+    Pointer(xmlListSize) := GetProcAddress(libXmlHandle, 'xmlListSize');
+    Pointer(xmlListPopFront) := GetProcAddress(libXmlHandle, 'xmlListPopFront');
+    Pointer(xmlListPopBack) := GetProcAddress(libXmlHandle, 'xmlListPopBack');
+    Pointer(xmlListPushFront) := GetProcAddress(libXmlHandle, 'xmlListPushFront');
+    Pointer(xmlListPushBack) := GetProcAddress(libXmlHandle, 'xmlListPushBack');
+    Pointer(xmlListReverse) := GetProcAddress(libXmlHandle, 'xmlListReverse');
+    Pointer(xmlListSort) := GetProcAddress(libXmlHandle, 'xmlListSort');
+    Pointer(xmlListWalk) := GetProcAddress(libXmlHandle, 'xmlListWalk');
+    Pointer(xmlListReverseWalk) := GetProcAddress(libXmlHandle, 'xmlListReverseWalk');
+    Pointer(xmlListMerge) := GetProcAddress(libXmlHandle, 'xmlListMerge');
+    Pointer(xmlListDup) := GetProcAddress(libXmlHandle, 'xmlListDup');
+    Pointer(xmlListCopy) := GetProcAddress(libXmlHandle, 'xmlListCopy');
+    Pointer(xmlLinkGetData) := GetProcAddress(libXmlHandle, 'xmlLinkGetData');
+
+    { entities.inc }
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(xmlInitializePredefinedEntities) := GetProcAddress(libHandle, 'xmlInitializePredefinedEntities');
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+    Pointer(xmlNewEntity) := GetProcAddress(libXmlHandle, 'xmlNewEntity');
+    Pointer(xmlAddDocEntity) := GetProcAddress(libXmlHandle, 'xmlAddDocEntity');
+    Pointer(xmlAddDtdEntity) := GetProcAddress(libXmlHandle, 'xmlAddDtdEntity');
+    Pointer(xmlGetPredefinedEntity) := GetProcAddress(libXmlHandle, 'xmlGetPredefinedEntity');
+    Pointer(xmlGetDocEntity) := GetProcAddress(libXmlHandle, 'xmlGetDocEntity');
+    Pointer(xmlGetDtdEntity) := GetProcAddress(libXmlHandle, 'xmlGetDtdEntity');
+    Pointer(xmlGetParameterEntity) := GetProcAddress(libXmlHandle, 'xmlGetParameterEntity');
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(xmlEncodeEntities) := GetProcAddress(libHandle, 'xmlEncodeEntities');
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+    Pointer(xmlEncodeEntitiesReentrant) := GetProcAddress(libXmlHandle, 'xmlEncodeEntitiesReentrant');
+    Pointer(xmlEncodeSpecialChars) := GetProcAddress(libXmlHandle, 'xmlEncodeSpecialChars');
+    Pointer(xmlCreateEntitiesTable) := GetProcAddress(libXmlHandle, 'xmlCreateEntitiesTable');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyEntitiesTable) := GetProcAddress(libXmlHandle, 'xmlCopyEntitiesTable');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlFreeEntitiesTable) := GetProcAddress(libXmlHandle, 'xmlFreeEntitiesTable');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlDumpEntitiesTable) := GetProcAddress(libXmlHandle, 'xmlDumpEntitiesTable');
+    Pointer(xmlDumpEntityDecl) := GetProcAddress(libXmlHandle, 'xmlDumpEntityDecl');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(xmlCleanupPredefinedEntities) := GetProcAddress(libHandle, 'xmlCleanupPredefinedEntities');
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+
+    { xmlerror.inc }
+    Pointer(xmlSetGenericErrorFunc) := GetProcAddress(libXmlHandle, 'xmlSetGenericErrorFunc');
+    Pointer(initGenericErrorDefaultFunc) := GetProcAddress(libXmlHandle, 'initGenericErrorDefaultFunc');
+    Pointer(xmlSetStructuredErrorFunc) := GetProcAddress(libXmlHandle, 'xmlSetStructuredErrorFunc');
+    Pointer(xmlParserError) := GetProcAddress(libXmlHandle, 'xmlParserError');
+    Pointer(xmlParserWarning) := GetProcAddress(libXmlHandle, 'xmlParserWarning');
+    Pointer(xmlParserValidityError) := GetProcAddress(libXmlHandle, 'xmlParserValidityError');
+    Pointer(xmlParserValidityWarning) := GetProcAddress(libXmlHandle, 'xmlParserValidityWarning');
+    Pointer(xmlParserPrintFileInfo) := GetProcAddress(libXmlHandle, 'xmlParserPrintFileInfo');
+    Pointer(xmlParserPrintFileContext) := GetProcAddress(libXmlHandle, 'xmlParserPrintFileContext');
+    Pointer(xmlGetLastError) := GetProcAddress(libXmlHandle, 'xmlGetLastError');
+    Pointer(xmlResetLastError) := GetProcAddress(libXmlHandle, 'xmlResetLastError');
+    Pointer(xmlCtxtGetLastError) := GetProcAddress(libXmlHandle, 'xmlCtxtGetLastError');
+    Pointer(xmlCtxtResetLastError) := GetProcAddress(libXmlHandle, 'xmlCtxtResetLastError');
+    Pointer(xmlResetError) := GetProcAddress(libXmlHandle, 'xmlResetError');
+    Pointer(xmlCopyError) := GetProcAddress(libXmlHandle, 'xmlCopyError');
+    Pointer(__xmlRaiseError) := GetProcAddress(libXmlHandle, '__xmlRaiseError');
+    Pointer(__xmlSimpleError) := GetProcAddress(libXmlHandle, '__xmlSimpleError');
+
+    { xmlmemory.inc }
+    Pointer(xmlMemSetup) := GetProcAddress(libXmlHandle, 'xmlMemSetup');
+    Pointer(xmlMemGet) := GetProcAddress(libXmlHandle, 'xmlMemGet');
+    Pointer(xmlGcMemSetup) := GetProcAddress(libXmlHandle, 'xmlGcMemSetup');
+    Pointer(xmlGcMemGet) := GetProcAddress(libXmlHandle, 'xmlGcMemGet');
+    Pointer(xmlInitMemory) := GetProcAddress(libXmlHandle, 'xmlInitMemory');
+    Pointer(xmlCleanupMemory) := GetProcAddress(libXmlHandle, 'xmlCleanupMemory');
+    Pointer(xmlMemUsed) := GetProcAddress(libXmlHandle, 'xmlMemUsed');
+    Pointer(xmlMemBlocks) := GetProcAddress(libXmlHandle, 'xmlMemBlocks');
+    Pointer(xmlMemDisplay) := GetProcAddress(libXmlHandle, 'xmlMemDisplay');
+    Pointer(xmlMemDisplayLast) := GetProcAddress(libXmlHandle, 'xmlMemDisplayLast');
+    Pointer(xmlMemShow) := GetProcAddress(libXmlHandle, 'xmlMemShow');
+    Pointer(xmlMemoryDump) := GetProcAddress(libXmlHandle, 'xmlMemoryDump');
+    Pointer(xmlMemMalloc) := GetProcAddress(libXmlHandle, 'xmlMemMalloc');
+    Pointer(xmlMemRealloc) := GetProcAddress(libXmlHandle, 'xmlMemRealloc');
+    Pointer(xmlMemFree) := GetProcAddress(libXmlHandle, 'xmlMemFree');
+    Pointer(xmlMemoryStrdup) := GetProcAddress(libXmlHandle, 'xmlMemoryStrdup');
+    Pointer(xmlMallocLoc) := GetProcAddress(libXmlHandle, 'xmlMallocLoc');
+    Pointer(xmlReallocLoc) := GetProcAddress(libXmlHandle, 'xmlReallocLoc');
+    Pointer(xmlMallocAtomicLoc) := GetProcAddress(libXmlHandle, 'xmlMallocAtomicLoc');
+    Pointer(xmlMemStrdupLoc) := GetProcAddress(libXmlHandle, 'xmlMemStrdupLoc');
+
+    { pattern.inc }
+  {$IFDEF LIBXML_PATTERN_ENABLED}
+    Pointer(xmlFreePattern) := GetProcAddress(libXmlHandle, 'xmlFreePattern');
+    Pointer(xmlFreePatternList) := GetProcAddress(libXmlHandle, 'xmlFreePatternList');
+    Pointer(xmlPatterncompile) := GetProcAddress(libXmlHandle, 'xmlPatterncompile');
+    Pointer(xmlPatternMatch) := GetProcAddress(libXmlHandle, 'xmlPatternMatch');
+    Pointer(xmlPatternStreamable) := GetProcAddress(libXmlHandle, 'xmlPatternStreamable');
+    Pointer(xmlPatternMaxDepth) := GetProcAddress(libXmlHandle, 'xmlPatternMaxDepth');
+    Pointer(xmlPatternMinDepth) := GetProcAddress(libXmlHandle, 'xmlPatternMinDepth');
+    Pointer(xmlPatternFromRoot) := GetProcAddress(libXmlHandle, 'xmlPatternFromRoot');
+    Pointer(xmlPatternGetStreamCtxt) := GetProcAddress(libXmlHandle, 'xmlPatternGetStreamCtxt');
+    Pointer(xmlFreeStreamCtxt) := GetProcAddress(libXmlHandle, 'xmlFreeStreamCtxt');
+    Pointer(xmlStreamPushNode) := GetProcAddress(libXmlHandle, 'xmlStreamPushNode');
+    Pointer(xmlStreamPush) := GetProcAddress(libXmlHandle, 'xmlStreamPush');
+    Pointer(xmlStreamPushAttr) := GetProcAddress(libXmlHandle, 'xmlStreamPushAttr');
+    Pointer(xmlStreamPop) := GetProcAddress(libXmlHandle, 'xmlStreamPop');
+    Pointer(xmlStreamWantsAnyNode) := GetProcAddress(libXmlHandle, 'xmlStreamWantsAnyNode');
+  {$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+
+    { schemasInternals.inc }
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+    Pointer(xmlSchemaFreeType) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeType');
+    Pointer(xmlSchemaFreeWildcard) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeWildcard');
+  {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+    { hash.inc }
+    Pointer(xmlHashCreate) := GetProcAddress(libXmlHandle, 'xmlHashCreate');
+    Pointer(xmlHashCreateDict) := GetProcAddress(libXmlHandle, 'xmlHashCreateDict');
+    Pointer(xmlHashFree) := GetProcAddress(libXmlHandle, 'xmlHashFree');
+    Pointer(xmlHashDefaultDeallocator) := GetProcAddress(libXmlHandle, 'xmlHashDefaultDeallocator');
+    Pointer(xmlHashAddEntry) := GetProcAddress(libXmlHandle, 'xmlHashAddEntry');
+    Pointer(xmlHashUpdateEntry) := GetProcAddress(libXmlHandle, 'xmlHashUpdateEntry');
+    Pointer(xmlHashAddEntry2) := GetProcAddress(libXmlHandle, 'xmlHashAddEntry2');
+    Pointer(xmlHashUpdateEntry2) := GetProcAddress(libXmlHandle, 'xmlHashUpdateEntry2');
+    Pointer(xmlHashAddEntry3) := GetProcAddress(libXmlHandle, 'xmlHashAddEntry3');
+    Pointer(xmlHashUpdateEntry3) := GetProcAddress(libXmlHandle, 'xmlHashUpdateEntry3');
+    Pointer(xmlHashRemoveEntry) := GetProcAddress(libXmlHandle, 'xmlHashRemoveEntry');
+    Pointer(xmlHashRemoveEntry2) := GetProcAddress(libXmlHandle, 'xmlHashRemoveEntry2');
+    Pointer(xmlHashRemoveEntry3) := GetProcAddress(libXmlHandle, 'xmlHashRemoveEntry3');
+    Pointer(xmlHashLookup) := GetProcAddress(libXmlHandle, 'xmlHashLookup');
+    Pointer(xmlHashLookup2) := GetProcAddress(libXmlHandle, 'xmlHashLookup2');
+    Pointer(xmlHashLookup3) := GetProcAddress(libXmlHandle, 'xmlHashLookup3');
+    Pointer(xmlHashQLookup) := GetProcAddress(libXmlHandle, 'xmlHashQLookup');
+    Pointer(xmlHashQLookup2) := GetProcAddress(libXmlHandle, 'xmlHashQLookup2');
+    Pointer(xmlHashQLookup3) := GetProcAddress(libXmlHandle, 'xmlHashQLookup3');
+    Pointer(xmlHashCopy) := GetProcAddress(libXmlHandle, 'xmlHashCopy');
+    Pointer(xmlHashSize) := GetProcAddress(libXmlHandle, 'xmlHashSize');
+    Pointer(xmlHashScan) := GetProcAddress(libXmlHandle, 'xmlHashScan');
+    Pointer(xmlHashScan3) := GetProcAddress(libXmlHandle, 'xmlHashScan3');
+    Pointer(xmlHashScanFull) := GetProcAddress(libXmlHandle, 'xmlHashScanFull');
+    Pointer(xmlHashScanFull3) := GetProcAddress(libXmlHandle, 'xmlHashScanFull3');
+
+    { valid.inc }
+    Pointer(xmlAddNotationDecl) := GetProcAddress(libXmlHandle, 'xmlAddNotationDecl');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyNotationTable) := GetProcAddress(libXmlHandle, 'xmlCopyNotationTable');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlFreeNotationTable) := GetProcAddress(libXmlHandle, 'xmlFreeNotationTable');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlDumpNotationDecl) := GetProcAddress(libXmlHandle, 'xmlDumpNotationDecl');
+    Pointer(xmlDumpNotationTable) := GetProcAddress(libXmlHandle, 'xmlDumpNotationTable');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlNewDocElementContent) := GetProcAddress(libXmlHandle, 'xmlNewDocElementContent');
+    Pointer(xmlCopyDocElementContent) := GetProcAddress(libXmlHandle, 'xmlCopyDocElementContent');
+    Pointer(xmlFreeDocElementContent) := GetProcAddress(libXmlHandle, 'xmlFreeDocElementContent');
+    Pointer(xmlSnprintfElementContent) := GetProcAddress(libXmlHandle, 'xmlSnprintfElementContent');
+    Pointer(xmlAddElementDecl) := GetProcAddress(libXmlHandle, 'xmlAddElementDecl');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyElementTable) := GetProcAddress(libXmlHandle, 'xmlCopyElementTable');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlFreeElementTable) := GetProcAddress(libXmlHandle, 'xmlFreeElementTable');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlDumpElementTable) := GetProcAddress(libXmlHandle, 'xmlDumpElementTable');
+    Pointer(xmlDumpElementDecl) := GetProcAddress(libXmlHandle, 'xmlDumpElementDecl');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlCreateEnumeration) := GetProcAddress(libXmlHandle, 'xmlCreateEnumeration');
+    Pointer(xmlFreeEnumeration) := GetProcAddress(libXmlHandle, 'xmlFreeEnumeration');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyEnumeration) := GetProcAddress(libXmlHandle, 'xmlCopyEnumeration');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlAddAttributeDecl) := GetProcAddress(libXmlHandle, 'xmlAddAttributeDecl');
+  {$IFDEF LIBXML_TREE_ENABLED}
+    Pointer(xmlCopyAttributeTable) := GetProcAddress(libXmlHandle, 'xmlCopyAttributeTable');
+  {$ENDIF} (* LIBXML_TREE_ENABLED *)
+    Pointer(xmlFreeAttributeTable) := GetProcAddress(libXmlHandle, 'xmlFreeAttributeTable');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlDumpAttributeTable) := GetProcAddress(libXmlHandle, 'xmlDumpAttributeTable');
+    Pointer(xmlDumpAttributeDecl) := GetProcAddress(libXmlHandle, 'xmlDumpAttributeDecl');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlAddID) := GetProcAddress(libXmlHandle, 'xmlAddID');
+    Pointer(xmlFreeIDTable) := GetProcAddress(libXmlHandle, 'xmlFreeIDTable');
+    Pointer(xmlGetID) := GetProcAddress(libXmlHandle, 'xmlGetID');
+    Pointer(xmlIsID) := GetProcAddress(libXmlHandle, 'xmlIsID');
+    Pointer(xmlRemoveID) := GetProcAddress(libXmlHandle, 'xmlRemoveID');
+    Pointer(xmlAddRef) := GetProcAddress(libXmlHandle, 'xmlAddRef');
+    Pointer(xmlFreeRefTable) := GetProcAddress(libXmlHandle, 'xmlFreeRefTable');
+    Pointer(xmlIsRef) := GetProcAddress(libXmlHandle, 'xmlIsRef');
+    Pointer(xmlRemoveRef) := GetProcAddress(libXmlHandle, 'xmlRemoveRef');
+    Pointer(xmlGetRefs) := GetProcAddress(libXmlHandle, 'xmlGetRefs');
+  {$IFDEF LIBXML_VALID_ENABLED}
+    Pointer(xmlNewValidCtxt) := GetProcAddress(libXmlHandle, 'xmlNewValidCtxt');
+    Pointer(xmlFreeValidCtxt) := GetProcAddress(libXmlHandle, 'xmlFreeValidCtxt');
+    Pointer(xmlValidateRoot) := GetProcAddress(libXmlHandle, 'xmlValidateRoot');
+    Pointer(xmlValidateElementDecl) := GetProcAddress(libXmlHandle, 'xmlValidateElementDecl');
+    Pointer(xmlValidNormalizeAttributeValue) := GetProcAddress(libXmlHandle, 'xmlValidNormalizeAttributeValue');
+    Pointer(xmlValidCtxtNormalizeAttributeValue) := GetProcAddress(libXmlHandle, 'xmlValidCtxtNormalizeAttributeValue');
+    Pointer(xmlValidateAttributeDecl) := GetProcAddress(libXmlHandle, 'xmlValidateAttributeDecl');
+    Pointer(xmlValidateAttributeValue) := GetProcAddress(libXmlHandle, 'xmlValidateAttributeValue');
+    Pointer(xmlValidateNotationDecl) := GetProcAddress(libXmlHandle, 'xmlValidateNotationDecl');
+    Pointer(xmlValidateDtd) := GetProcAddress(libXmlHandle, 'xmlValidateDtd');
+    Pointer(xmlValidateDtdFinal) := GetProcAddress(libXmlHandle, 'xmlValidateDtdFinal');
+    Pointer(xmlValidateDocument) := GetProcAddress(libXmlHandle, 'xmlValidateDocument');
+    Pointer(xmlValidateElement) := GetProcAddress(libXmlHandle, 'xmlValidateElement');
+    Pointer(xmlValidateOneElement) := GetProcAddress(libXmlHandle, 'xmlValidateOneElement');
+    Pointer(xmlValidateOneAttribute) := GetProcAddress(libXmlHandle, 'xmlValidateOneAttribute');
+    Pointer(xmlValidateOneNamespace) := GetProcAddress(libXmlHandle, 'xmlValidateOneNamespace');
+    Pointer(xmlValidateDocumentFinal) := GetProcAddress(libXmlHandle, 'xmlValidateDocumentFinal');
+  {$ENDIF} (* LIBXML_VALID_ENABLED *)
+  {$IF defined(LIBXML_VALID_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlValidateNotationUse) := GetProcAddress(libXmlHandle, 'xmlValidateNotationUse');
+  {$ENDIF} (* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED *)
+    Pointer(xmlIsMixedElement) := GetProcAddress(libXmlHandle, 'xmlIsMixedElement');
+    Pointer(xmlGetDtdAttrDesc) := GetProcAddress(libXmlHandle, 'xmlGetDtdAttrDesc');
+    Pointer(xmlGetDtdQAttrDesc) := GetProcAddress(libXmlHandle, 'xmlGetDtdQAttrDesc');
+    Pointer(xmlGetDtdNotationDesc) := GetProcAddress(libXmlHandle, 'xmlGetDtdNotationDesc');
+    Pointer(xmlGetDtdQElementDesc) := GetProcAddress(libXmlHandle, 'xmlGetDtdQElementDesc');
+    Pointer(xmlGetDtdElementDesc) := GetProcAddress(libXmlHandle, 'xmlGetDtdElementDesc');
+  {$IFDEF LIBXML_VALID_ENABLED}
+    Pointer(xmlValidGetPotentialChildren) := GetProcAddress(libXmlHandle, 'xmlValidGetPotentialChildren');
+    Pointer(xmlValidGetValidElements) := GetProcAddress(libXmlHandle, 'xmlValidGetValidElements');
+    Pointer(xmlValidateNameValue) := GetProcAddress(libXmlHandle, 'xmlValidateNameValue');
+    Pointer(xmlValidateNamesValue) := GetProcAddress(libXmlHandle, 'xmlValidateNamesValue');
+    Pointer(xmlValidateNmtokenValue) := GetProcAddress(libXmlHandle, 'xmlValidateNmtokenValue');
+    Pointer(xmlValidateNmtokensValue) := GetProcAddress(libXmlHandle, 'xmlValidateNmtokensValue');
+  {$IFDEF LIBXML_REGEXP_ENABLED}
+    Pointer(xmlValidBuildContentModel) := GetProcAddress(libXmlHandle, 'xmlValidBuildContentModel');
+    Pointer(xmlValidatePushElement) := GetProcAddress(libXmlHandle, 'xmlValidatePushElement');
+    Pointer(xmlValidatePushCData) := GetProcAddress(libXmlHandle, 'xmlValidatePushCData');
+    Pointer(xmlValidatePopElement) := GetProcAddress(libXmlHandle, 'xmlValidatePopElement');
+  {$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+  {$ENDIF} (* LIBXML_VALID_ENABLED *)
+
+    { libxmlparser.inc }
+    Pointer(xmlInitParser) := GetProcAddress(libXmlHandle, 'xmlInitParser');
+    Pointer(xmlCleanupParser) := GetProcAddress(libXmlHandle, 'xmlCleanupParser');
+    Pointer(xmlParserInputRead) := GetProcAddress(libXmlHandle, 'xmlParserInputRead');
+    Pointer(xmlParserInputGrow) := GetProcAddress(libXmlHandle, 'xmlParserInputGrow');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlParseDoc) := GetProcAddress(libXmlHandle, 'xmlParseDoc');
+    Pointer(xmlParseFile) := GetProcAddress(libXmlHandle, 'xmlParseFile');
+    Pointer(xmlParseMemory) := GetProcAddress(libXmlHandle, 'xmlParseMemory');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlSubstituteEntitiesDefault) := GetProcAddress(libXmlHandle, 'xmlSubstituteEntitiesDefault');
+    Pointer(xmlKeepBlanksDefault) := GetProcAddress(libXmlHandle, 'xmlKeepBlanksDefault');
+    Pointer(xmlStopParser) := GetProcAddress(libXmlHandle, 'xmlStopParser');
+    Pointer(xmlPedanticParserDefault) := GetProcAddress(libXmlHandle, 'xmlPedanticParserDefault');
+    Pointer(xmlLineNumbersDefault) := GetProcAddress(libXmlHandle, 'xmlLineNumbersDefault');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlRecoverDoc) := GetProcAddress(libXmlHandle, 'xmlRecoverDoc');
+    Pointer(xmlRecoverMemory) := GetProcAddress(libXmlHandle, 'xmlRecoverMemory');
+    Pointer(xmlRecoverFile) := GetProcAddress(libXmlHandle, 'xmlRecoverFile');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlParseDocument) := GetProcAddress(libXmlHandle, 'xmlParseDocument');
+    Pointer(xmlParseExtParsedEnt) := GetProcAddress(libXmlHandle, 'xmlParseExtParsedEnt');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlSAXUserParseFile) := GetProcAddress(libXmlHandle, 'xmlSAXUserParseFile');
+    Pointer(xmlSAXUserParseMemory) := GetProcAddress(libXmlHandle, 'xmlSAXUserParseMemory');
+    Pointer(xmlSAXParseDoc) := GetProcAddress(libXmlHandle, 'xmlSAXParseDoc');
+    Pointer(xmlSAXParseMemory) := GetProcAddress(libXmlHandle, 'xmlSAXParseMemory');
+    Pointer(xmlSAXParseMemoryWithData) := GetProcAddress(libXmlHandle, 'xmlSAXParseMemoryWithData');
+    Pointer(xmlSAXParseFile) := GetProcAddress(libXmlHandle, 'xmlSAXParseFile');
+    Pointer(xmlSAXParseFileWithData) := GetProcAddress(libXmlHandle, 'xmlSAXParseFileWithData');
+    Pointer(xmlSAXParseEntity) := GetProcAddress(libXmlHandle, 'xmlSAXParseEntity');
+    Pointer(xmlParseEntity) := GetProcAddress(libXmlHandle, 'xmlParseEntity');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  {$IFDEF LIBXML_VALID_ENABLED}
+    Pointer(xmlSAXParseDTD) := GetProcAddress(libXmlHandle, 'xmlSAXParseDTD');
+    Pointer(xmlParseDTD) := GetProcAddress(libXmlHandle, 'xmlParseDTD');
+    Pointer(xmlIOParseDTD) := GetProcAddress(libXmlHandle, 'xmlIOParseDTD');
+  {$ENDIF} (* LIBXML_VALID_ENABLE *)
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlParseBalancedChunkMemory) := GetProcAddress(libXmlHandle, 'xmlParseBalancedChunkMemory');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlParseInNodeContext) := GetProcAddress(libXmlHandle, 'xmlParseInNodeContext');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlParseBalancedChunkMemoryRecover) := GetProcAddress(libXmlHandle, 'xmlParseBalancedChunkMemoryRecover');
+    Pointer(xmlParseExternalEntity) := GetProcAddress(libXmlHandle, 'xmlParseExternalEntity');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlParseCtxtExternalEntity) := GetProcAddress(libXmlHandle, 'xmlParseCtxtExternalEntity');
+    Pointer(xmlNewParserCtxt) := GetProcAddress(libXmlHandle, 'xmlNewParserCtxt');
+    Pointer(xmlInitParserCtxt) := GetProcAddress(libXmlHandle, 'xmlInitParserCtxt');
+    Pointer(xmlClearParserCtxt) := GetProcAddress(libXmlHandle, 'xmlClearParserCtxt');
+    Pointer(xmlFreeParserCtxt) := GetProcAddress(libXmlHandle, 'xmlFreeParserCtxt');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlSetupParserForBuffer) := GetProcAddress(libXmlHandle, 'xmlSetupParserForBuffer');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlCreateDocParserCtxt) := GetProcAddress(libXmlHandle, 'xmlCreateDocParserCtxt');
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(xmlGetFeaturesList) := GetProcAddress(libHandle, 'xmlGetFeaturesList');
+    Pointer(xmlGetFeature) := GetProcAddress(libHandle, 'xmlGetFeature');
+    Pointer(xmlSetFeature) := GetProcAddress(libHandle, 'xmlSetFeature');
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  {$IFDEF LIBXML_PUSH_ENABLED}
+    Pointer(xmlCreatePushParserCtxt) := GetProcAddress(libXmlHandle, 'xmlCreatePushParserCtxt');
+    Pointer(xmlParseChunk) := GetProcAddress(libXmlHandle, 'xmlParseChunk');
+  {$ENDIF} (* LIBXML_PUSH_ENABLED *)
+    Pointer(xmlCreateIOParserCtxt) := GetProcAddress(libXmlHandle, 'xmlCreateIOParserCtxt');
+    Pointer(xmlNewIOInputStream) := GetProcAddress(libXmlHandle, 'xmlNewIOInputStream');
+    Pointer(xmlParserFindNodeInfo) := GetProcAddress(libXmlHandle, 'xmlParserFindNodeInfo');
+    Pointer(xmlInitNodeInfoSeq) := GetProcAddress(libXmlHandle, 'xmlInitNodeInfoSeq');
+    Pointer(xmlClearNodeInfoSeq) := GetProcAddress(libXmlHandle, 'xmlClearNodeInfoSeq');
+    Pointer(xmlParserFindNodeInfoIndex) := GetProcAddress(libXmlHandle, 'xmlParserFindNodeInfoIndex');
+    Pointer(xmlParserAddNodeInfo) := GetProcAddress(libXmlHandle, 'xmlParserAddNodeInfo');
+    Pointer(xmlSetExternalEntityLoader) := GetProcAddress(libXmlHandle, 'xmlSetExternalEntityLoader');
+    Pointer(xmlGetExternalEntityLoader) := GetProcAddress(libXmlHandle, 'xmlGetExternalEntityLoader');
+    Pointer(xmlLoadExternalEntity) := GetProcAddress(libXmlHandle, 'xmlLoadExternalEntity');
+    Pointer(xmlByteConsumed) := GetProcAddress(libXmlHandle, 'xmlByteConsumed');
+    Pointer(xmlCtxtReset) := GetProcAddress(libXmlHandle, 'xmlCtxtReset');
+    Pointer(xmlCtxtResetPush) := GetProcAddress(libXmlHandle, 'xmlCtxtResetPush');
+    Pointer(xmlCtxtUseOptions) := GetProcAddress(libXmlHandle, 'xmlCtxtUseOptions');
+    Pointer(xmlReadDoc) := GetProcAddress(libXmlHandle, 'xmlReadDoc');
+    Pointer(xmlReadFile) := GetProcAddress(libXmlHandle, 'xmlReadFile');
+    Pointer(xmlReadMemory) := GetProcAddress(libXmlHandle, 'xmlReadMemory');
+    Pointer(xmlReadFd) := GetProcAddress(libXmlHandle, 'xmlReadFd');
+    Pointer(xmlReadIO) := GetProcAddress(libXmlHandle, 'xmlReadIO');
+    Pointer(xmlCtxtReadDoc) := GetProcAddress(libXmlHandle, 'xmlCtxtReadDoc');
+    Pointer(xmlCtxtReadFile) := GetProcAddress(libXmlHandle, 'xmlCtxtReadFile');
+    Pointer(xmlCtxtReadMemory) := GetProcAddress(libXmlHandle, 'xmlCtxtReadMemory');
+    Pointer(xmlCtxtReadFd) := GetProcAddress(libXmlHandle, 'xmlCtxtReadFd');
+    Pointer(xmlCtxtReadIO) := GetProcAddress(libXmlHandle, 'xmlCtxtReadIO');
+    Pointer(xmlHasFeature) := GetProcAddress(libXmlHandle, 'xmlHasFeature');
+
+    { schematron.inc }
+  {$IFDEF LIBXML_SCHEMATRON_ENABLED}
+    Pointer(xmlSchematronNewParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronNewParserCtxt');
+    Pointer(xmlSchematronNewMemParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronNewMemParserCtxt');
+    Pointer(xmlSchematronNewDocParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronNewDocParserCtxt');
+    Pointer(xmlSchematronFreeParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronFreeParserCtxt');
+    Pointer(xmlSchematronParse) := GetProcAddress(libXmlHandle, 'xmlSchematronParse');
+    Pointer(xmlSchematronFree) := GetProcAddress(libXmlHandle, 'xmlSchematronFree');
+    Pointer(xmlSchematronSetValidStructuredErrors) := GetProcAddress(libXmlHandle, 'xmlSchematronSetValidStructuredErrors');
+    Pointer(xmlSchematronNewValidCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronNewValidCtxt');
+    Pointer(xmlSchematronFreeValidCtxt) := GetProcAddress(libXmlHandle, 'xmlSchematronFreeValidCtxt');
+    Pointer(xmlSchematronValidateDoc) := GetProcAddress(libXmlHandle, 'xmlSchematronValidateDoc');
+  {$ENDIF} (* LIBXML_SCHEMATRON_ENABLED *)
+
+    { threads.inc }
+    Pointer(xmlNewMutex) := GetProcAddress(libXmlHandle, 'xmlNewMutex');
+    Pointer(xmlMutexLock) := GetProcAddress(libXmlHandle, 'xmlMutexLock');
+    Pointer(xmlMutexUnlock) := GetProcAddress(libXmlHandle, 'xmlMutexUnlock');
+    Pointer(xmlFreeMutex) := GetProcAddress(libXmlHandle, 'xmlFreeMutex');
+    Pointer(xmlNewRMutex) := GetProcAddress(libXmlHandle, 'xmlNewRMutex');
+    Pointer(xmlRMutexLock) := GetProcAddress(libXmlHandle, 'xmlRMutexLock');
+    Pointer(xmlRMutexUnlock) := GetProcAddress(libXmlHandle, 'xmlRMutexUnlock');
+    Pointer(xmlFreeRMutex) := GetProcAddress(libXmlHandle, 'xmlFreeRMutex');
+    Pointer(xmlInitThreads) := GetProcAddress(libXmlHandle, 'xmlInitThreads');
+    Pointer(xmlLockLibrary) := GetProcAddress(libXmlHandle, 'xmlLockLibrary');
+    Pointer(xmlUnlockLibrary) := GetProcAddress(libXmlHandle, 'xmlUnlockLibrary');
+    Pointer(xmlGetThreadId) := GetProcAddress(libXmlHandle, 'xmlGetThreadId');
+    Pointer(xmlIsMainThread) := GetProcAddress(libXmlHandle, 'xmlIsMainThread');
+    Pointer(xmlCleanupThreads) := GetProcAddress(libXmlHandle, 'xmlCleanupThreads');
+    Pointer(xmlGetGlobalState) := GetProcAddress(libXmlHandle, 'xmlGetGlobalState');
+
+    { uri.inc }
+    Pointer(xmlCreateURI) := GetProcAddress(libXmlHandle, 'xmlCreateURI');
+    Pointer(xmlBuildURI) := GetProcAddress(libXmlHandle, 'xmlBuildURI');
+    Pointer(xmlBuildRelativeURI) := GetProcAddress(libXmlHandle, 'xmlBuildRelativeURI');
+    Pointer(xmlParseURI) := GetProcAddress(libXmlHandle, 'xmlParseURI');
+    Pointer(xmlParseURIRaw) := GetProcAddress(libXmlHandle, 'xmlParseURIRaw');
+    Pointer(xmlParseURIReference) := GetProcAddress(libXmlHandle, 'xmlParseURIReference');
+    Pointer(xmlSaveUri) := GetProcAddress(libXmlHandle, 'xmlSaveUri');
+    Pointer(xmlPrintURI) := GetProcAddress(libXmlHandle, 'xmlPrintURI');
+    Pointer(xmlURIEscapeStr) := GetProcAddress(libXmlHandle, 'xmlURIEscapeStr');
+    Pointer(xmlURIUnescapeString) := GetProcAddress(libXmlHandle, 'xmlURIUnescapeString');
+    Pointer(xmlNormalizeURIPath) := GetProcAddress(libXmlHandle, 'xmlNormalizeURIPath');
+    Pointer(xmlURIEscape) := GetProcAddress(libXmlHandle, 'xmlURIEscape');
+    Pointer(xmlFreeURI) := GetProcAddress(libXmlHandle, 'xmlFreeURI');
+    Pointer(xmlCanonicPath) := GetProcAddress(libXmlHandle, 'xmlCanonicPath');
+    Pointer(xmlPathToURI) := GetProcAddress(libXmlHandle, 'xmlPathToURI');
+
+    { relaxng.inc }
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+    Pointer(xmlRelaxNGInitTypes) := GetProcAddress(libXmlHandle, 'xmlRelaxNGInitTypes');
+    Pointer(xmlRelaxNGCleanupTypes) := GetProcAddress(libXmlHandle, 'xmlRelaxNGCleanupTypes');
+    Pointer(xmlRelaxNGNewParserCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGNewParserCtxt');
+    Pointer(xmlRelaxNGNewMemParserCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGNewMemParserCtxt');
+    Pointer(xmlRelaxNGNewDocParserCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGNewDocParserCtxt');
+    Pointer(xmlRelaxParserSetFlag) := GetProcAddress(libXmlHandle, 'xmlRelaxParserSetFlag');
+    Pointer(xmlRelaxNGFreeParserCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGFreeParserCtxt');
+    Pointer(xmlRelaxNGSetParserErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGSetParserErrors');
+    Pointer(xmlRelaxNGGetParserErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGGetParserErrors');
+    Pointer(xmlRelaxNGSetParserStructuredErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGSetParserStructuredErrors');
+    Pointer(xmlRelaxNGParse) := GetProcAddress(libXmlHandle, 'xmlRelaxNGParse');
+    Pointer(xmlRelaxNGFree) := GetProcAddress(libXmlHandle, 'xmlRelaxNGFree');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlRelaxNGDump) := GetProcAddress(libXmlHandle, 'xmlRelaxNGDump');
+    Pointer(xmlRelaxNGDumpTree) := GetProcAddress(libXmlHandle, 'xmlRelaxNGDumpTree');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlRelaxNGSetValidErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGSetValidErrors');
+    Pointer(xmlRelaxNGGetValidErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGGetValidErrors');
+    Pointer(xmlRelaxNGSetValidStructuredErrors) := GetProcAddress(libXmlHandle, 'xmlRelaxNGSetValidStructuredErrors');
+    Pointer(xmlRelaxNGNewValidCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGNewValidCtxt');
+    Pointer(xmlRelaxNGFreeValidCtxt) := GetProcAddress(libXmlHandle, 'xmlRelaxNGFreeValidCtxt');
+    Pointer(xmlRelaxNGValidateDoc) := GetProcAddress(libXmlHandle, 'xmlRelaxNGValidateDoc');
+    Pointer(xmlRelaxNGValidatePushElement) := GetProcAddress(libXmlHandle, 'xmlRelaxNGValidatePushElement');
+    Pointer(xmlRelaxNGValidatePushCData) := GetProcAddress(libXmlHandle, 'xmlRelaxNGValidatePushCData');
+    Pointer(xmlRelaxNGValidatePopElement) := GetProcAddress(libXmlHandle, 'xmlRelaxNGValidatePopElement');
+    Pointer(xmlRelaxNGValidateFullElement) := GetProcAddress(libXmlHandle, 'xmlRelaxNGValidateFullElement');
+  {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+    { globals.inc }
+    Pointer(xmlInitGlobals) := GetProcAddress(libXmlHandle, 'xmlInitGlobals');
+    Pointer(xmlCleanupGlobals) := GetProcAddress(libXmlHandle, 'xmlCleanupGlobals');
+    Pointer(xmlParserInputBufferCreateFilenameDefault) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateFilenameDefault');
+    Pointer(xmlOutputBufferCreateFilenameDefault) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateFilenameDefault');
+    Pointer(xmlInitializeGlobalState) := GetProcAddress(libXmlHandle, 'xmlInitializeGlobalState');
+    Pointer(xmlThrDefSetGenericErrorFunc) := GetProcAddress(libXmlHandle, 'xmlThrDefSetGenericErrorFunc');
+    Pointer(xmlThrDefSetStructuredErrorFunc) := GetProcAddress(libXmlHandle, 'xmlThrDefSetStructuredErrorFunc');
+    Pointer(xmlRegisterNodeDefault) := GetProcAddress(libXmlHandle, 'xmlRegisterNodeDefault');
+    Pointer(xmlThrDefRegisterNodeDefault) := GetProcAddress(libXmlHandle, 'xmlThrDefRegisterNodeDefault');
+    Pointer(xmlDeregisterNodeDefault) := GetProcAddress(libXmlHandle, 'xmlDeregisterNodeDefault');
+    Pointer(xmlThrDefDeregisterNodeDefault) := GetProcAddress(libXmlHandle, 'xmlThrDefDeregisterNodeDefault');
+    Pointer(xmlThrDefOutputBufferCreateFilenameDefault) := GetProcAddress(libXmlHandle, 'xmlThrDefOutputBufferCreateFilenameDefault');
+    Pointer(xmlThrDefParserInputBufferCreateFilenameDefault) := GetProcAddress(libXmlHandle, 'xmlThrDefParserInputBufferCreateFilenameDefault');
+    Pointer(__docbDefaultSAXHandler) := GetProcAddress(libXmlHandle, '__docbDefaultSAXHandler');
+    Pointer(__htmlDefaultSAXHandler) := GetProcAddress(libXmlHandle, '__htmlDefaultSAXHandler');
+    Pointer(__xmlLastError) := GetProcAddress(libXmlHandle, '__xmlLastError');
+    Pointer(__oldXMLWDcompatibility) := GetProcAddress(libXmlHandle, '__oldXMLWDcompatibility');
+    Pointer(__xmlBufferAllocScheme) := GetProcAddress(libXmlHandle, '__xmlBufferAllocScheme');
+    Pointer(xmlThrDefBufferAllocScheme) := GetProcAddress(libXmlHandle, 'xmlThrDefBufferAllocScheme');
+    Pointer(__xmlDefaultBufferSize) := GetProcAddress(libXmlHandle, '__xmlDefaultBufferSize');
+    Pointer(xmlThrDefDefaultBufferSize) := GetProcAddress(libXmlHandle, 'xmlThrDefDefaultBufferSize');
+    Pointer(__xmlDefaultSAXHandler) := GetProcAddress(libXmlHandle, '__xmlDefaultSAXHandler');
+    Pointer(__xmlDefaultSAXLocator) := GetProcAddress(libXmlHandle, '__xmlDefaultSAXLocator');
+    Pointer(__xmlDoValidityCheckingDefaultValue) := GetProcAddress(libXmlHandle, '__xmlDoValidityCheckingDefaultValue');
+    Pointer(xmlThrDefDoValidityCheckingDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefDoValidityCheckingDefaultValue');
+    Pointer(__xmlGenericError) := GetProcAddress(libXmlHandle, '__xmlGenericError');
+    Pointer(__xmlStructuredError) := GetProcAddress(libXmlHandle, '__xmlStructuredError');
+    Pointer(__xmlGenericErrorContext) := GetProcAddress(libXmlHandle, '__xmlGenericErrorContext');
+    Pointer(__xmlGetWarningsDefaultValue) := GetProcAddress(libXmlHandle, '__xmlGetWarningsDefaultValue');
+    Pointer(xmlThrDefGetWarningsDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefGetWarningsDefaultValue');
+    Pointer(__xmlIndentTreeOutput) := GetProcAddress(libXmlHandle, '__xmlIndentTreeOutput');
+    Pointer(xmlThrDefIndentTreeOutput) := GetProcAddress(libXmlHandle, 'xmlThrDefIndentTreeOutput');
+    Pointer(__xmlTreeIndentString) := GetProcAddress(libXmlHandle, '__xmlTreeIndentString');
+    Pointer(xmlThrDefTreeIndentString) := GetProcAddress(libXmlHandle, 'xmlThrDefTreeIndentString');
+    Pointer(__xmlKeepBlanksDefaultValue) := GetProcAddress(libXmlHandle, '__xmlKeepBlanksDefaultValue');
+    Pointer(xmlThrDefKeepBlanksDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefKeepBlanksDefaultValue');
+    Pointer(__xmlLineNumbersDefaultValue) := GetProcAddress(libXmlHandle, '__xmlLineNumbersDefaultValue');
+    Pointer(xmlThrDefLineNumbersDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefLineNumbersDefaultValue');
+    Pointer(__xmlLoadExtDtdDefaultValue) := GetProcAddress(libXmlHandle, '__xmlLoadExtDtdDefaultValue');
+    Pointer(xmlThrDefLoadExtDtdDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefLoadExtDtdDefaultValue');
+    Pointer(__xmlParserDebugEntities) := GetProcAddress(libXmlHandle, '__xmlParserDebugEntities');
+    Pointer(xmlThrDefParserDebugEntities) := GetProcAddress(libXmlHandle, 'xmlThrDefParserDebugEntities');
+    Pointer(__xmlParserVersion) := GetProcAddress(libXmlHandle, '__xmlParserVersion');
+    Pointer(__xmlPedanticParserDefaultValue) := GetProcAddress(libXmlHandle, '__xmlPedanticParserDefaultValue');
+    Pointer(xmlThrDefPedanticParserDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefPedanticParserDefaultValue');
+    Pointer(__xmlSaveNoEmptyTags) := GetProcAddress(libXmlHandle, '__xmlSaveNoEmptyTags');
+    Pointer(xmlThrDefSaveNoEmptyTags) := GetProcAddress(libXmlHandle, 'xmlThrDefSaveNoEmptyTags');
+    Pointer(__xmlSubstituteEntitiesDefaultValue) := GetProcAddress(libXmlHandle, '__xmlSubstituteEntitiesDefaultValue');
+    Pointer(xmlThrDefSubstituteEntitiesDefaultValue) := GetProcAddress(libXmlHandle, 'xmlThrDefSubstituteEntitiesDefaultValue');
+    Pointer(__xmlRegisterNodeDefaultValue) := GetProcAddress(libXmlHandle, '__xmlRegisterNodeDefaultValue');
+    Pointer(__xmlDeregisterNodeDefaultValue) := GetProcAddress(libXmlHandle, '__xmlDeregisterNodeDefaultValue');
+    Pointer(__xmlParserInputBufferCreateFilenameValue) := GetProcAddress(libXmlHandle, '__xmlParserInputBufferCreateFilenameValue');
+    Pointer(__xmlOutputBufferCreateFilenameValue) := GetProcAddress(libXmlHandle, '__xmlOutputBufferCreateFilenameValue');
+
+    { nanoftp.inc }
+  {$IFDEF LIBXML_FTP_ENABLED}
+    Pointer(xmlNanoFTPInit) := GetProcAddress(libXmlHandle, 'xmlNanoFTPInit');
+    Pointer(xmlNanoFTPCleanup) := GetProcAddress(libXmlHandle, 'xmlNanoFTPCleanup');
+    Pointer(xmlNanoFTPNewCtxt) := GetProcAddress(libXmlHandle, 'xmlNanoFTPNewCtxt');
+    Pointer(xmlNanoFTPFreeCtxt) := GetProcAddress(libXmlHandle, 'xmlNanoFTPFreeCtxt');
+    Pointer(xmlNanoFTPConnectTo) := GetProcAddress(libXmlHandle, 'xmlNanoFTPConnectTo');
+    Pointer(xmlNanoFTPOpen) := GetProcAddress(libXmlHandle, 'xmlNanoFTPOpen');
+    Pointer(xmlNanoFTPConnect) := GetProcAddress(libXmlHandle, 'xmlNanoFTPConnect');
+    Pointer(xmlNanoFTPClose) := GetProcAddress(libXmlHandle, 'xmlNanoFTPClose');
+    Pointer(xmlNanoFTPQuit) := GetProcAddress(libXmlHandle, 'xmlNanoFTPQuit');
+    Pointer(xmlNanoFTPScanProxy) := GetProcAddress(libXmlHandle, 'xmlNanoFTPScanProxy');
+    Pointer(xmlNanoFTPProxy) := GetProcAddress(libXmlHandle, 'xmlNanoFTPProxy');
+    Pointer(xmlNanoFTPUpdateURL) := GetProcAddress(libXmlHandle, 'xmlNanoFTPUpdateURL');
+    Pointer(xmlNanoFTPGetResponse) := GetProcAddress(libXmlHandle, 'xmlNanoFTPGetResponse');
+    Pointer(xmlNanoFTPCheckResponse) := GetProcAddress(libXmlHandle, 'xmlNanoFTPCheckResponse');
+    Pointer(xmlNanoFTPCwd) := GetProcAddress(libXmlHandle, 'xmlNanoFTPCwd');
+    Pointer(xmlNanoFTPDele) := GetProcAddress(libXmlHandle, 'xmlNanoFTPDele');
+    Pointer(xmlNanoFTPGetConnection) := GetProcAddress(libXmlHandle, 'xmlNanoFTPGetConnection');
+    Pointer(xmlNanoFTPCloseConnection) := GetProcAddress(libXmlHandle, 'xmlNanoFTPCloseConnection');
+    Pointer(xmlNanoFTPList) := GetProcAddress(libXmlHandle, 'xmlNanoFTPList');
+    Pointer(xmlNanoFTPGetSocket) := GetProcAddress(libXmlHandle, 'xmlNanoFTPGetSocket');
+    Pointer(xmlNanoFTPGet) := GetProcAddress(libXmlHandle, 'xmlNanoFTPGet');
+    Pointer(xmlNanoFTPRead) := GetProcAddress(libXmlHandle, 'xmlNanoFTPRead');
+  {$ENDIF} (* LIBXML_FTP_ENABLED *)
+
+    { nanohttp.inc }
+  {$IFDEF LIBXML_HTTP_ENABLED}
+    Pointer(xmlNanoHTTPInit) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPInit');
+    Pointer(xmlNanoHTTPCleanup) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPCleanup');
+    Pointer(xmlNanoHTTPScanProxy) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPScanProxy');
+    Pointer(xmlNanoHTTPFetch) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPFetch');
+    Pointer(xmlNanoHTTPMethod) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPMethod');
+    Pointer(xmlNanoHTTPMethodRedir) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPMethodRedir');
+    Pointer(xmlNanoHTTPOpen) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPOpen');
+    Pointer(xmlNanoHTTPOpenRedir) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPOpenRedir');
+    Pointer(xmlNanoHTTPReturnCode) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPReturnCode');
+    Pointer(xmlNanoHTTPAuthHeader) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPAuthHeader');
+    Pointer(xmlNanoHTTPRedir) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPRedir');
+    Pointer(xmlNanoHTTPContentLength) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPContentLength');
+    Pointer(xmlNanoHTTPEncoding) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPEncoding');
+    Pointer(xmlNanoHTTPMimeType) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPMimeType');
+    Pointer(xmlNanoHTTPRead) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPRead');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlNanoHTTPSave) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPSave');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlNanoHTTPClose) := GetProcAddress(libXmlHandle, 'xmlNanoHTTPClose');
+  {$ENDIF} (* LIBXML_HTTP_ENABLED *)
+
+    { SAX.inc }
+  {$IFDEF LIBXML_LEGACY_ENABLED}
+    Pointer(getPublicId) := GetProcAddress(libHandle, 'getPublicId');
+    Pointer(getSystemId) := GetProcAddress(libHandle, 'getSystemId');
+    Pointer(setDocumentLocator) := GetProcAddress(libHandle, 'setDocumentLocator');
+    Pointer(getLineNumber) := GetProcAddress(libHandle, 'getLineNumber');
+    Pointer(getColumnNumber) := GetProcAddress(libHandle, 'getColumnNumber');
+    Pointer(isStandalone) := GetProcAddress(libHandle, 'isStandalone');
+    Pointer(hasInternalSubset) := GetProcAddress(libHandle, 'hasInternalSubset');
+    Pointer(hasExternalSubset) := GetProcAddress(libHandle, 'hasExternalSubset');
+    Pointer(internalSubset) := GetProcAddress(libHandle, 'internalSubset');
+    Pointer(externalSubset) := GetProcAddress(libHandle, 'externalSubset');
+    Pointer(getEntity) := GetProcAddress(libHandle, 'getEntity');
+    Pointer(getParameterEntity) := GetProcAddress(libHandle, 'getParameterEntity');
+    Pointer(resolveEntity) := GetProcAddress(libHandle, 'resolveEntity');
+    Pointer(entityDecl) := GetProcAddress(libHandle, 'entityDecl');
+    Pointer(attributeDecl) := GetProcAddress(libHandle, 'attributeDecl');
+    Pointer(elementDecl) := GetProcAddress(libHandle, 'elementDecl');
+    Pointer(notationDecl) := GetProcAddress(libHandle, 'notationDecl');
+    Pointer(unparsedEntityDecl) := GetProcAddress(libHandle, 'unparsedEntityDecl');
+    Pointer(startDocument) := GetProcAddress(libHandle, 'startDocument');
+    Pointer(endDocument) := GetProcAddress(libHandle, 'endDocument');
+    Pointer(attribute) := GetProcAddress(libHandle, 'attribute');
+    Pointer(startElement) := GetProcAddress(libHandle, 'startElement');
+    Pointer(endElement) := GetProcAddress(libHandle, 'endElement');
+    Pointer(reference) := GetProcAddress(libHandle, 'reference');
+    Pointer(characters) := GetProcAddress(libHandle, 'characters');
+    Pointer(ignorableWhitespace) := GetProcAddress(libHandle, 'ignorableWhitespace');
+    Pointer(processingInstruction) := GetProcAddress(libHandle, 'processingInstruction');
+    Pointer(globalNamespace) := GetProcAddress(libHandle, 'globalNamespace');
+    Pointer(setNamespace) := GetProcAddress(libHandle, 'setNamespace');
+    Pointer(getNamespace) := GetProcAddress(libHandle, 'getNamespace');
+    Pointer(checkNamespace) := GetProcAddress(libHandle, 'checkNamespace');
+    Pointer(namespaceDecl) := GetProcAddress(libHandle, 'namespaceDecl');
+    Pointer(comment) := GetProcAddress(libHandle, 'comment');
+    Pointer(cdataBlock) := GetProcAddress(libHandle, 'cdataBlock');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(initxmlDefaultSAXHandler) := GetProcAddress(libHandle, 'initxmlDefaultSAXHandler');
+  {$IFDEF LIBXML_HTML_ENABLED}
+    Pointer(inithtmlDefaultSAXHandler) := GetProcAddress(libHandle, 'inithtmlDefaultSAXHandler');
+  {$ENDIF}
+  {$IFDEF LIBXML_DOCB_ENABLED}
+    Pointer(initdocbDefaultSAXHandler) := GetProcAddress(libHandle, 'initdocbDefaultSAXHandler');
+  {$ENDIF}
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  {$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+
+    { SAX2.inc }
+    Pointer(xmlSAX2GetPublicId) := GetProcAddress(libXmlHandle, 'xmlSAX2GetPublicId');
+    Pointer(xmlSAX2GetSystemId) := GetProcAddress(libXmlHandle, 'xmlSAX2GetSystemId');
+    Pointer(xmlSAX2SetDocumentLocator) := GetProcAddress(libXmlHandle, 'xmlSAX2SetDocumentLocator');
+    Pointer(xmlSAX2GetLineNumber) := GetProcAddress(libXmlHandle, 'xmlSAX2GetLineNumber');
+    Pointer(xmlSAX2GetColumnNumber) := GetProcAddress(libXmlHandle, 'xmlSAX2GetColumnNumber');
+    Pointer(xmlSAX2IsStandalone) := GetProcAddress(libXmlHandle, 'xmlSAX2IsStandalone');
+    Pointer(xmlSAX2HasInternalSubset) := GetProcAddress(libXmlHandle, 'xmlSAX2HasInternalSubset');
+    Pointer(xmlSAX2HasExternalSubset) := GetProcAddress(libXmlHandle, 'xmlSAX2HasExternalSubset');
+    Pointer(xmlSAX2InternalSubset) := GetProcAddress(libXmlHandle, 'xmlSAX2InternalSubset');
+    Pointer(xmlSAX2ExternalSubset) := GetProcAddress(libXmlHandle, 'xmlSAX2ExternalSubset');
+    Pointer(xmlSAX2GetEntity) := GetProcAddress(libXmlHandle, 'xmlSAX2GetEntity');
+    Pointer(xmlSAX2GetParameterEntity) := GetProcAddress(libXmlHandle, 'xmlSAX2GetParameterEntity');
+    Pointer(xmlSAX2ResolveEntity) := GetProcAddress(libXmlHandle, 'xmlSAX2ResolveEntity');
+    Pointer(xmlSAX2EntityDecl) := GetProcAddress(libXmlHandle, 'xmlSAX2EntityDecl');
+    Pointer(xmlSAX2AttributeDecl) := GetProcAddress(libXmlHandle, 'xmlSAX2AttributeDecl');
+    Pointer(xmlSAX2ElementDecl) := GetProcAddress(libXmlHandle, 'xmlSAX2ElementDecl');
+    Pointer(xmlSAX2NotationDecl) := GetProcAddress(libXmlHandle, 'xmlSAX2NotationDecl');
+    Pointer(xmlSAX2UnparsedEntityDecl) := GetProcAddress(libXmlHandle, 'xmlSAX2UnparsedEntityDecl');
+    Pointer(xmlSAX2StartDocument) := GetProcAddress(libXmlHandle, 'xmlSAX2StartDocument');
+    Pointer(xmlSAX2EndDocument) := GetProcAddress(libXmlHandle, 'xmlSAX2EndDocument');
+  {$IF defined(LIBXML_SAX1_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+    Pointer(xmlSAX2StartElement) := GetProcAddress(libXmlHandle, 'xmlSAX2StartElement');
+    Pointer(xmlSAX2EndElement) := GetProcAddress(libXmlHandle, 'xmlSAX2EndElement');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED *)
+    Pointer(xmlSAX2StartElementNs) := GetProcAddress(libXmlHandle, 'xmlSAX2StartElementNs');
+    Pointer(xmlSAX2EndElementNs) := GetProcAddress(libXmlHandle, 'xmlSAX2EndElementNs');
+    Pointer(xmlSAX2Reference) := GetProcAddress(libXmlHandle, 'xmlSAX2Reference');
+    Pointer(xmlSAX2Characters) := GetProcAddress(libXmlHandle, 'xmlSAX2Characters');
+    Pointer(xmlSAX2IgnorableWhitespace) := GetProcAddress(libXmlHandle, 'xmlSAX2IgnorableWhitespace');
+    Pointer(xmlSAX2ProcessingInstruction) := GetProcAddress(libXmlHandle, 'xmlSAX2ProcessingInstruction');
+    Pointer(xmlSAX2Comment) := GetProcAddress(libXmlHandle, 'xmlSAX2Comment');
+    Pointer(xmlSAX2CDataBlock) := GetProcAddress(libXmlHandle, 'xmlSAX2CDataBlock');
+  {$IFDEF LIBXML_SAX1_ENABLED}
+    Pointer(xmlSAXDefaultVersion) := GetProcAddress(libXmlHandle, 'xmlSAXDefaultVersion');
+  {$ENDIF} (* LIBXML_SAX1_ENABLED *)
+    Pointer(xmlSAXVersion) := GetProcAddress(libXmlHandle, 'xmlSAXVersion');
+    Pointer(xmlSAX2InitDefaultSAXHandler) := GetProcAddress(libXmlHandle, 'xmlSAX2InitDefaultSAXHandler');
+  {$IFDEF LIBXML_HTML_ENABLED}
+    Pointer(xmlSAX2InitHtmlDefaultSAXHandler) := GetProcAddress(libXmlHandle, 'xmlSAX2InitHtmlDefaultSAXHandler');
+    Pointer(htmlDefaultSAXHandlerInit) := GetProcAddress(libXmlHandle, 'htmlDefaultSAXHandlerInit');
+  {$ENDIF}
+  {$IFDEF LIBXML_DOCB_ENABLED}
+    Pointer(xmlSAX2InitDocbDefaultSAXHandler) := GetProcAddress(libXmlHandle, 'xmlSAX2InitDocbDefaultSAXHandler');
+    Pointer(docbDefaultSAXHandlerInit) := GetProcAddress(libXmlHandle, 'docbDefaultSAXHandlerInit');
+  {$ENDIF}
+    Pointer(xmlDefaultSAXHandlerInit) := GetProcAddress(libXmlHandle, 'xmlDefaultSAXHandlerInit');
+
+    { HTMLtree.inc }
+  {$IFDEF LIBXML_HTML_ENABLED}
+    Pointer(htmlNewDoc) := GetProcAddress(libXmlHandle, 'htmlNewDoc');
+    Pointer(htmlNewDocNoDtD) := GetProcAddress(libXmlHandle, 'htmlNewDocNoDtD');
+    Pointer(htmlGetMetaEncoding) := GetProcAddress(libXmlHandle, 'htmlGetMetaEncoding');
+    Pointer(htmlSetMetaEncoding) := GetProcAddress(libXmlHandle, 'htmlSetMetaEncoding');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(htmlDocDumpMemory) := GetProcAddress(libXmlHandle, 'htmlDocDumpMemory');
+    Pointer(htmlDocDumpMemoryFormat) := GetProcAddress(libXmlHandle, 'htmlDocDumpMemoryFormat');
+    Pointer(htmlDocDump) := GetProcAddress(libXmlHandle, 'htmlDocDump');
+    Pointer(htmlSaveFile) := GetProcAddress(libXmlHandle, 'htmlSaveFile');
+    Pointer(htmlNodeDump) := GetProcAddress(libXmlHandle, 'htmlNodeDump');
+    Pointer(htmlNodeDumpFile) := GetProcAddress(libXmlHandle, 'htmlNodeDumpFile');
+    Pointer(htmlNodeDumpFileFormat) := GetProcAddress(libXmlHandle, 'htmlNodeDumpFileFormat');
+    Pointer(htmlSaveFileEnc) := GetProcAddress(libXmlHandle, 'htmlSaveFileEnc');
+    Pointer(htmlSaveFileFormat) := GetProcAddress(libXmlHandle, 'htmlSaveFileFormat');
+    Pointer(htmlNodeDumpFormatOutput) := GetProcAddress(libXmlHandle, 'htmlNodeDumpFormatOutput');
+    Pointer(htmlDocContentDumpOutput) := GetProcAddress(libXmlHandle, 'htmlDocContentDumpOutput');
+    Pointer(htmlDocContentDumpFormatOutput) := GetProcAddress(libXmlHandle, 'htmlDocContentDumpFormatOutput');
+    Pointer(htmlNodeDumpOutput) := GetProcAddress(libXmlHandle, 'htmlNodeDumpOutput');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(htmlIsBooleanAttr) := GetProcAddress(libXmlHandle, 'htmlIsBooleanAttr');
+  {$ENDIF} (* LIBXML_HTML_ENABLED *)
+
+    { HTMLparser.inc }
+  {$IFDEF LIBXML_HTML_ENABLED}
+    Pointer(htmlTagLookup) := GetProcAddress(libXmlHandle, 'htmlTagLookup');
+    Pointer(htmlEntityLookup) := GetProcAddress(libXmlHandle, 'htmlEntityLookup');
+    Pointer(htmlEntityValueLookup) := GetProcAddress(libXmlHandle, 'htmlEntityValueLookup');
+    Pointer(htmlIsAutoClosed) := GetProcAddress(libXmlHandle, 'htmlIsAutoClosed');
+    Pointer(htmlAutoCloseTag) := GetProcAddress(libXmlHandle, 'htmlAutoCloseTag');
+    Pointer(htmlParseEntityRef) := GetProcAddress(libXmlHandle, 'htmlParseEntityRef');
+    Pointer(htmlParseCharRef) := GetProcAddress(libXmlHandle, 'htmlParseCharRef');
+    Pointer(htmlParseElement) := GetProcAddress(libXmlHandle, 'htmlParseElement');
+    Pointer(htmlNewParserCtxt) := GetProcAddress(libXmlHandle, 'htmlNewParserCtxt');
+    Pointer(htmlCreateMemoryParserCtxt) := GetProcAddress(libXmlHandle, 'htmlCreateMemoryParserCtxt');
+    Pointer(htmlParseDocument) := GetProcAddress(libXmlHandle, 'htmlParseDocument');
+    Pointer(htmlSAXParseDoc) := GetProcAddress(libXmlHandle, 'htmlSAXParseDoc');
+    Pointer(htmlParseDoc) := GetProcAddress(libXmlHandle, 'htmlParseDoc');
+    Pointer(htmlSAXParseFile) := GetProcAddress(libXmlHandle, 'htmlSAXParseFile');
+    Pointer(htmlParseFile) := GetProcAddress(libXmlHandle, 'htmlParseFile');
+    Pointer(UTF8ToHtml) := GetProcAddress(libXmlHandle, 'UTF8ToHtml');
+    Pointer(htmlEncodeEntities) := GetProcAddress(libXmlHandle, 'htmlEncodeEntities');
+    Pointer(htmlIsScriptAttribute) := GetProcAddress(libXmlHandle, 'htmlIsScriptAttribute');
+    Pointer(htmlHandleOmittedElem) := GetProcAddress(libXmlHandle, 'htmlHandleOmittedElem');
+  {$IFDEF LIBXML_PUSH_ENABLED}
+    Pointer(htmlCreatePushParserCtxt) := GetProcAddress(libXmlHandle, 'htmlCreatePushParserCtxt');
+    Pointer(htmlParseChunk) := GetProcAddress(libXmlHandle, 'htmlParseChunk');
+  {$ENDIF} (* LIBXML_PUSH_ENABLED *)
+    Pointer(htmlFreeParserCtxt) := GetProcAddress(libXmlHandle, 'htmlFreeParserCtxt');
+  {$ENDIF} (* LIBXML_HTML_ENABLED *)
+
+    { xmlautomata.inc }
+  {$IFDEF LIBXML_REGEXP_ENABLED}
+  {$IFDEF LIBXML_AUTOMATA_ENABLED}
+    Pointer(xmlNewAutomata) := GetProcAddress(libXmlHandle, 'xmlNewAutomata');
+    Pointer(xmlFreeAutomata) := GetProcAddress(libXmlHandle, 'xmlFreeAutomata');
+    Pointer(xmlAutomataGetInitState) := GetProcAddress(libXmlHandle, 'xmlAutomataGetInitState');
+    Pointer(xmlAutomataSetFinalState) := GetProcAddress(libXmlHandle, 'xmlAutomataSetFinalState');
+    Pointer(xmlAutomataNewState) := GetProcAddress(libXmlHandle, 'xmlAutomataNewState');
+    Pointer(xmlAutomataNewTransition) := GetProcAddress(libXmlHandle, 'xmlAutomataNewTransition');
+    Pointer(xmlAutomataNewTransition2) := GetProcAddress(libXmlHandle, 'xmlAutomataNewTransition2');
+    Pointer(xmlAutomataNewNegTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewNegTrans');
+    Pointer(xmlAutomataNewCountTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewCountTrans');
+    Pointer(xmlAutomataNewCountTrans2) := GetProcAddress(libXmlHandle, 'xmlAutomataNewCountTrans2');
+    Pointer(xmlAutomataNewOnceTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewOnceTrans');
+    Pointer(xmlAutomataNewOnceTrans2) := GetProcAddress(libXmlHandle, 'xmlAutomataNewOnceTrans2');
+    Pointer(xmlAutomataNewAllTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewAllTrans');
+    Pointer(xmlAutomataNewEpsilon) := GetProcAddress(libXmlHandle, 'xmlAutomataNewEpsilon');
+    Pointer(xmlAutomataNewCountedTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewCountedTrans');
+    Pointer(xmlAutomataNewCounterTrans) := GetProcAddress(libXmlHandle, 'xmlAutomataNewCounterTrans');
+    Pointer(xmlAutomataNewCounter) := GetProcAddress(libXmlHandle, 'xmlAutomataNewCounter');
+    Pointer(xmlAutomataCompile) := GetProcAddress(libXmlHandle, 'xmlAutomataCompile');
+    Pointer(xmlAutomataIsDeterminist) := GetProcAddress(libXmlHandle, 'xmlAutomataIsDeterminist');
+  {$ENDIF} (* LIBXML_AUTOMATA_ENABLED *)
+  {$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+
+    { xmlIO.inc }
+    Pointer(xmlCleanupInputCallbacks) := GetProcAddress(libXmlHandle, 'xmlCleanupInputCallbacks');
+    Pointer(xmlPopInputCallbacks) := GetProcAddress(libXmlHandle, 'xmlPopInputCallbacks');
+    Pointer(xmlRegisterDefaultInputCallbacks) := GetProcAddress(libXmlHandle, 'xmlRegisterDefaultInputCallbacks');
+    Pointer(xmlAllocParserInputBuffer) := GetProcAddress(libXmlHandle, 'xmlAllocParserInputBuffer');
+    Pointer(xmlParserInputBufferCreateFilename) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateFilename');
+    Pointer(xmlParserInputBufferCreateFile) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateFile');
+    Pointer(xmlParserInputBufferCreateFd) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateFd');
+    Pointer(xmlParserInputBufferCreateMem) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateMem');
+    Pointer(xmlParserInputBufferCreateStatic) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateStatic');
+    Pointer(xmlParserInputBufferCreateIO) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferCreateIO');
+    Pointer(xmlParserInputBufferRead) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferRead');
+    Pointer(xmlParserInputBufferGrow) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferGrow');
+    Pointer(xmlParserInputBufferPush) := GetProcAddress(libXmlHandle, 'xmlParserInputBufferPush');
+    Pointer(xmlFreeParserInputBuffer) := GetProcAddress(libXmlHandle, 'xmlFreeParserInputBuffer');
+    Pointer(xmlParserGetDirectory) := GetProcAddress(libXmlHandle, 'xmlParserGetDirectory');
+    Pointer(xmlRegisterInputCallbacks) := GetProcAddress(libXmlHandle, 'xmlRegisterInputCallbacks');
+    Pointer(__xmlParserInputBufferCreateFilename) := GetProcAddress(libXmlHandle, '__xmlParserInputBufferCreateFilename');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlCleanupOutputCallbacks) := GetProcAddress(libXmlHandle, 'xmlCleanupOutputCallbacks');
+    Pointer(xmlRegisterDefaultOutputCallbacks) := GetProcAddress(libXmlHandle, 'xmlRegisterDefaultOutputCallbacks');
+    Pointer(xmlAllocOutputBuffer) := GetProcAddress(libXmlHandle, 'xmlAllocOutputBuffer');
+    Pointer(xmlOutputBufferCreateFilename) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateFilename');
+    Pointer(xmlOutputBufferCreateFile) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateFile');
+    Pointer(xmlOutputBufferCreateBuffer) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateBuffer');
+    Pointer(xmlOutputBufferCreateFd) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateFd');
+    Pointer(xmlOutputBufferCreateIO) := GetProcAddress(libXmlHandle, 'xmlOutputBufferCreateIO');
+    Pointer(xmlOutputBufferGetContent) := GetProcAddress(libXmlHandle, 'xmlOutputBufferGetContent');
+    Pointer(xmlOutputBufferGetSize) := GetProcAddress(libXmlHandle, 'xmlOutputBufferGetSize');
+    Pointer(xmlOutputBufferWrite) := GetProcAddress(libXmlHandle, 'xmlOutputBufferWrite');
+    Pointer(xmlOutputBufferWriteString) := GetProcAddress(libXmlHandle, 'xmlOutputBufferWriteString');
+    Pointer(xmlOutputBufferWriteEscape) := GetProcAddress(libXmlHandle, 'xmlOutputBufferWriteEscape');
+    Pointer(xmlOutputBufferFlush) := GetProcAddress(libXmlHandle, 'xmlOutputBufferFlush');
+    Pointer(xmlOutputBufferClose) := GetProcAddress(libXmlHandle, 'xmlOutputBufferClose');
+    Pointer(xmlRegisterOutputCallbacks) := GetProcAddress(libXmlHandle, 'xmlRegisterOutputCallbacks');
+    Pointer(__xmlOutputBufferCreateFilename) := GetProcAddress(libXmlHandle, '__xmlOutputBufferCreateFilename');
+  {$IFDEF LIBXML_HTTP_ENABLED}
+    Pointer(xmlRegisterHTTPPostCallbacks) := GetProcAddress(libXmlHandle, 'xmlRegisterHTTPPostCallbacks');
+  {$ENDIF} (* LIBXML_HTTP_ENABLED *)
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlCheckHTTPInput) := GetProcAddress(libXmlHandle, 'xmlCheckHTTPInput');
+    Pointer(xmlNoNetExternalEntityLoader) := GetProcAddress(libXmlHandle, 'xmlNoNetExternalEntityLoader');
+    Pointer(xmlCheckFilename) := GetProcAddress(libXmlHandle, 'xmlCheckFilename');
+    Pointer(xmlFileMatch) := GetProcAddress(libXmlHandle, 'xmlFileMatch');
+    Pointer(xmlFileOpen) := GetProcAddress(libXmlHandle, 'xmlFileOpen');
+    Pointer(xmlFileRead) := GetProcAddress(libXmlHandle, 'xmlFileRead');
+    Pointer(xmlFileClose) := GetProcAddress(libXmlHandle, 'xmlFileClose');
+  {$IFDEF LIBXML_HTTP_ENABLED}
+    Pointer(xmlIOHTTPMatch) := GetProcAddress(libXmlHandle, 'xmlIOHTTPMatch');
+    Pointer(xmlIOHTTPOpen) := GetProcAddress(libXmlHandle, 'xmlIOHTTPOpen');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlIOHTTPOpenW) := GetProcAddress(libXmlHandle, 'xmlIOHTTPOpenW');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlIOHTTPRead) := GetProcAddress(libXmlHandle, 'xmlIOHTTPRead');
+    Pointer(xmlIOHTTPClose) := GetProcAddress(libXmlHandle, 'xmlIOHTTPClose');
+  {$ENDIF} (* LIBXML_HTTP_ENABLED *)
+  {$IFDEF LIBXML_FTP_ENABLED}
+    Pointer(xmlIOFTPMatch) := GetProcAddress(libXmlHandle, 'xmlIOFTPMatch');
+    Pointer(xmlIOFTPOpen) := GetProcAddress(libXmlHandle, 'xmlIOFTPOpen');
+    Pointer(xmlIOFTPRead) := GetProcAddress(libXmlHandle, 'xmlIOFTPRead');
+    Pointer(xmlIOFTPClose) := GetProcAddress(libXmlHandle, 'xmlIOFTPClose');
+  {$ENDIF} (* LIBXML_FTP_ENABLED *)
+
+    { xmlmodule.inc }
+  {$IFDEF LIBXML_MODULES_ENABLED}
+    Pointer(xmlModuleOpen) := GetProcAddress(libXmlHandle, 'xmlModuleOpen');
+    Pointer(xmlModuleSymbol) := GetProcAddress(libXmlHandle, 'xmlModuleSymbol');
+    Pointer(xmlModuleClose) := GetProcAddress(libXmlHandle, 'xmlModuleClose');
+    Pointer(xmlModuleFree) := GetProcAddress(libXmlHandle, 'xmlModuleFree');
+  {$ENDIF} (* LIBXML_MODULES_ENABLED *)
+
+    { xmlreader.inc }
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+  {$IFDEF LIBXML_READER_ENABLED}
+    Pointer(xmlNewTextReader) := GetProcAddress(libXmlHandle, 'xmlNewTextReader');
+    Pointer(xmlNewTextReaderFilename) := GetProcAddress(libXmlHandle, 'xmlNewTextReaderFilename');
+    Pointer(xmlFreeTextReader) := GetProcAddress(libXmlHandle, 'xmlFreeTextReader');
+    Pointer(xmlTextReaderSetup) := GetProcAddress(libXmlHandle, 'xmlTextReaderSetup');
+    Pointer(xmlTextReaderRead) := GetProcAddress(libXmlHandle, 'xmlTextReaderRead');
+  {$IFDEF LIBXML_WRITER_ENABLED}
+    Pointer(xmlTextReaderReadInnerXml) := GetProcAddress(libXmlHandle, 'xmlTextReaderReadInnerXml');
+    Pointer(xmlTextReaderReadOuterXml) := GetProcAddress(libXmlHandle, 'xmlTextReaderReadOuterXml');
+  {$ENDIF}
+    Pointer(xmlTextReaderReadString) := GetProcAddress(libXmlHandle, 'xmlTextReaderReadString');
+    Pointer(xmlTextReaderReadAttributeValue) := GetProcAddress(libXmlHandle, 'xmlTextReaderReadAttributeValue');
+    Pointer(xmlTextReaderAttributeCount) := GetProcAddress(libXmlHandle, 'xmlTextReaderAttributeCount');
+    Pointer(xmlTextReaderDepth) := GetProcAddress(libXmlHandle, 'xmlTextReaderDepth');
+    Pointer(xmlTextReaderHasAttributes) := GetProcAddress(libXmlHandle, 'xmlTextReaderHasAttributes');
+    Pointer(xmlTextReaderHasValue) := GetProcAddress(libXmlHandle, 'xmlTextReaderHasValue');
+    Pointer(xmlTextReaderIsDefault) := GetProcAddress(libXmlHandle, 'xmlTextReaderIsDefault');
+    Pointer(xmlTextReaderIsEmptyElement) := GetProcAddress(libXmlHandle, 'xmlTextReaderIsEmptyElement');
+    Pointer(xmlTextReaderNodeType) := GetProcAddress(libXmlHandle, 'xmlTextReaderNodeType');
+    Pointer(xmlTextReaderQuoteChar) := GetProcAddress(libXmlHandle, 'xmlTextReaderQuoteChar');
+    Pointer(xmlTextReaderReadState) := GetProcAddress(libXmlHandle, 'xmlTextReaderReadState');
+    Pointer(xmlTextReaderIsNamespaceDecl) := GetProcAddress(libXmlHandle, 'xmlTextReaderIsNamespaceDecl');
+    Pointer(xmlTextReaderConstBaseUri) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstBaseUri');
+    Pointer(xmlTextReaderConstLocalName) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstLocalName');
+    Pointer(xmlTextReaderConstName) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstName');
+    Pointer(xmlTextReaderConstNamespaceUri) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstNamespaceUri');
+    Pointer(xmlTextReaderConstPrefix) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstPrefix');
+    Pointer(xmlTextReaderConstXmlLang) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstXmlLang');
+    Pointer(xmlTextReaderConstString) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstString');
+    Pointer(xmlTextReaderConstValue) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstValue');
+    Pointer(xmlTextReaderBaseUri) := GetProcAddress(libXmlHandle, 'xmlTextReaderBaseUri');
+    Pointer(xmlTextReaderLocalName) := GetProcAddress(libXmlHandle, 'xmlTextReaderLocalName');
+    Pointer(xmlTextReaderName) := GetProcAddress(libXmlHandle, 'xmlTextReaderName');
+    Pointer(xmlTextReaderNamespaceUri) := GetProcAddress(libXmlHandle, 'xmlTextReaderNamespaceUri');
+    Pointer(xmlTextReaderPrefix) := GetProcAddress(libXmlHandle, 'xmlTextReaderPrefix');
+    Pointer(xmlTextReaderXmlLang) := GetProcAddress(libXmlHandle, 'xmlTextReaderXmlLang');
+    Pointer(xmlTextReaderValue) := GetProcAddress(libXmlHandle, 'xmlTextReaderValue');
+    Pointer(xmlTextReaderClose) := GetProcAddress(libXmlHandle, 'xmlTextReaderClose');
+    Pointer(xmlTextReaderGetAttributeNo) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetAttributeNo');
+    Pointer(xmlTextReaderGetAttribute) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetAttribute');
+    Pointer(xmlTextReaderGetAttributeNs) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetAttributeNs');
+    Pointer(xmlTextReaderGetRemainder) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetRemainder');
+    Pointer(xmlTextReaderLookupNamespace) := GetProcAddress(libXmlHandle, 'xmlTextReaderLookupNamespace');
+    Pointer(xmlTextReaderMoveToAttributeNo) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToAttributeNo');
+    Pointer(xmlTextReaderMoveToAttribute) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToAttribute');
+    Pointer(xmlTextReaderMoveToAttributeNs) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToAttributeNs');
+    Pointer(xmlTextReaderMoveToFirstAttribute) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToFirstAttribute');
+    Pointer(xmlTextReaderMoveToNextAttribute) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToNextAttribute');
+    Pointer(xmlTextReaderMoveToElement) := GetProcAddress(libXmlHandle, 'xmlTextReaderMoveToElement');
+    Pointer(xmlTextReaderNormalization) := GetProcAddress(libXmlHandle, 'xmlTextReaderNormalization');
+    Pointer(xmlTextReaderConstEncoding) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstEncoding');
+    Pointer(xmlTextReaderSetParserProp) := GetProcAddress(libXmlHandle, 'xmlTextReaderSetParserProp');
+    Pointer(xmlTextReaderGetParserProp) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetParserProp');
+    Pointer(xmlTextReaderCurrentNode) := GetProcAddress(libXmlHandle, 'xmlTextReaderCurrentNode');
+    Pointer(xmlTextReaderGetParserLineNumber) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetParserLineNumber');
+    Pointer(xmlTextReaderGetParserColumnNumber) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetParserColumnNumber');
+    Pointer(xmlTextReaderPreserve) := GetProcAddress(libXmlHandle, 'xmlTextReaderPreserve');
+  {$IFDEF LIBXML_PATTERN_ENABLED}
+    Pointer(xmlTextReaderPreservePattern) := GetProcAddress(libXmlHandle, 'xmlTextReaderPreservePattern');
+  {$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+    Pointer(xmlTextReaderCurrentDoc) := GetProcAddress(libXmlHandle, 'xmlTextReaderCurrentDoc');
+    Pointer(xmlTextReaderExpand) := GetProcAddress(libXmlHandle, 'xmlTextReaderExpand');
+    Pointer(xmlTextReaderNext) := GetProcAddress(libXmlHandle, 'xmlTextReaderNext');
+    Pointer(xmlTextReaderNextSibling) := GetProcAddress(libXmlHandle, 'xmlTextReaderNextSibling');
+    Pointer(xmlTextReaderIsValid) := GetProcAddress(libXmlHandle, 'xmlTextReaderIsValid');
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+    Pointer(xmlTextReaderRelaxNGValidate) := GetProcAddress(libXmlHandle, 'xmlTextReaderRelaxNGValidate');
+    Pointer(xmlTextReaderRelaxNGSetSchema) := GetProcAddress(libXmlHandle, 'xmlTextReaderRelaxNGSetSchema');
+    Pointer(xmlTextReaderSchemaValidate) := GetProcAddress(libXmlHandle, 'xmlTextReaderSchemaValidate');
+    Pointer(xmlTextReaderSchemaValidateCtxt) := GetProcAddress(libXmlHandle, 'xmlTextReaderSchemaValidateCtxt');
+    Pointer(xmlTextReaderSetSchema) := GetProcAddress(libXmlHandle, 'xmlTextReaderSetSchema');
+  {$ENDIF}
+    Pointer(xmlTextReaderConstXmlVersion) := GetProcAddress(libXmlHandle, 'xmlTextReaderConstXmlVersion');
+    Pointer(xmlTextReaderStandalone) := GetProcAddress(libXmlHandle, 'xmlTextReaderStandalone');
+    Pointer(xmlTextReaderByteConsumed) := GetProcAddress(libXmlHandle, 'xmlTextReaderByteConsumed');
+    Pointer(xmlReaderWalker) := GetProcAddress(libXmlHandle, 'xmlReaderWalker');
+    Pointer(xmlReaderForDoc) := GetProcAddress(libXmlHandle, 'xmlReaderForDoc');
+    Pointer(xmlReaderForFile) := GetProcAddress(libXmlHandle, 'xmlReaderForFile');
+    Pointer(xmlReaderForMemory) := GetProcAddress(libXmlHandle, 'xmlReaderForMemory');
+    Pointer(xmlReaderForFd) := GetProcAddress(libXmlHandle, 'xmlReaderForFd');
+    Pointer(xmlReaderForIO) := GetProcAddress(libXmlHandle, 'xmlReaderForIO');
+    Pointer(xmlReaderNewWalker) := GetProcAddress(libXmlHandle, 'xmlReaderNewWalker');
+    Pointer(xmlReaderNewDoc) := GetProcAddress(libXmlHandle, 'xmlReaderNewDoc');
+    Pointer(xmlReaderNewFile) := GetProcAddress(libXmlHandle, 'xmlReaderNewFile');
+    Pointer(xmlReaderNewMemory) := GetProcAddress(libXmlHandle, 'xmlReaderNewMemory');
+    Pointer(xmlReaderNewFd) := GetProcAddress(libXmlHandle, 'xmlReaderNewFd');
+    Pointer(xmlReaderNewIO) := GetProcAddress(libXmlHandle, 'xmlReaderNewIO');
+    Pointer(xmlTextReaderLocatorLineNumber) := GetProcAddress(libXmlHandle, 'xmlTextReaderLocatorLineNumber');
+    Pointer(xmlTextReaderLocatorBaseURI) := GetProcAddress(libXmlHandle, 'xmlTextReaderLocatorBaseURI');
+    Pointer(xmlTextReaderSetErrorHandler) := GetProcAddress(libXmlHandle, 'xmlTextReaderSetErrorHandler');
+    Pointer(xmlTextReaderSetStructuredErrorHandler) := GetProcAddress(libXmlHandle, 'xmlTextReaderSetStructuredErrorHandler');
+    Pointer(xmlTextReaderGetErrorHandler) := GetProcAddress(libXmlHandle, 'xmlTextReaderGetErrorHandler');
+  {$ENDIF} (* LIBXML_READER_ENABLED *)
+  {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+    { xmlregexp.inc }
+  {$IFDEF LIBXML_REGEXP_ENABLED}
+    Pointer(xmlRegexpCompile) := GetProcAddress(libXmlHandle, 'xmlRegexpCompile');
+    Pointer(xmlRegFreeRegexp) := GetProcAddress(libXmlHandle, 'xmlRegFreeRegexp');
+    Pointer(xmlRegexpExec) := GetProcAddress(libXmlHandle, 'xmlRegexpExec');
+    Pointer(xmlRegexpPrint) := GetProcAddress(libXmlHandle, 'xmlRegexpPrint');
+    Pointer(xmlRegexpIsDeterminist) := GetProcAddress(libXmlHandle, 'xmlRegexpIsDeterminist');
+    Pointer(xmlRegNewExecCtxt) := GetProcAddress(libXmlHandle, 'xmlRegNewExecCtxt');
+    Pointer(xmlRegFreeExecCtxt) := GetProcAddress(libXmlHandle, 'xmlRegFreeExecCtxt');
+    Pointer(xmlRegExecPushString) := GetProcAddress(libXmlHandle, 'xmlRegExecPushString');
+    Pointer(xmlRegExecPushString2) := GetProcAddress(libXmlHandle, 'xmlRegExecPushString2');
+    Pointer(xmlRegExecNextValues) := GetProcAddress(libXmlHandle, 'xmlRegExecNextValues');
+    Pointer(xmlRegExecErrInfo) := GetProcAddress(libXmlHandle, 'xmlRegExecErrInfo');
+  {$IFDEF LIBXML_EXPR_ENABLED}
+    Pointer(xmlExpFreeCtxt) := GetProcAddress(libXmlHandle, 'xmlExpFreeCtxt');
+    Pointer(xmlExpNewCtxt) := GetProcAddress(libXmlHandle, 'xmlExpNewCtxt');
+    Pointer(xmlExpCtxtNbNodes) := GetProcAddress(libXmlHandle, 'xmlExpCtxtNbNodes');
+    Pointer(xmlExpCtxtNbCons) := GetProcAddress(libXmlHandle, 'xmlExpCtxtNbCons');
+    Pointer(xmlExpFree) := GetProcAddress(libXmlHandle, 'xmlExpFree');
+    Pointer(xmlExpRef) := GetProcAddress(libXmlHandle, 'xmlExpRef');
+    Pointer(xmlExpParse) := GetProcAddress(libXmlHandle, 'xmlExpParse');
+    Pointer(xmlExpNewAtom) := GetProcAddress(libXmlHandle, 'xmlExpNewAtom');
+    Pointer(xmlExpNewOr) := GetProcAddress(libXmlHandle, 'xmlExpNewOr');
+    Pointer(xmlExpNewSeq) := GetProcAddress(libXmlHandle, 'xmlExpNewSeq');
+    Pointer(xmlExpNewRange) := GetProcAddress(libXmlHandle, 'xmlExpNewRange');
+    Pointer(xmlExpIsNillable) := GetProcAddress(libXmlHandle, 'xmlExpIsNillable');
+    Pointer(xmlExpMaxToken) := GetProcAddress(libXmlHandle, 'xmlExpMaxToken');
+    Pointer(xmlExpGetLanguage) := GetProcAddress(libXmlHandle, 'xmlExpGetLanguage');
+    Pointer(xmlExpGetStart) := GetProcAddress(libXmlHandle, 'xmlExpGetStart');
+    Pointer(xmlExpStringDerive) := GetProcAddress(libXmlHandle, 'xmlExpStringDerive');
+    Pointer(xmlExpExpDerive) := GetProcAddress(libXmlHandle, 'xmlExpExpDerive');
+    Pointer(xmlExpSubsume) := GetProcAddress(libXmlHandle, 'xmlExpSubsume');
+    Pointer(xmlExpDump) := GetProcAddress(libXmlHandle, 'xmlExpDump');
+  {$ENDIF} (* LIBXML_EXPR_ENABLED *)
+  {$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+
+    { xmlsave.inc }
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlSaveToFd) := GetProcAddress(libXmlHandle, 'xmlSaveToFd');
+    Pointer(xmlSaveToFilename) := GetProcAddress(libXmlHandle, 'xmlSaveToFilename');
+    Pointer(xmlSaveToBuffer) := GetProcAddress(libXmlHandle, 'xmlSaveToBuffer');
+    Pointer(xmlSaveToIO) := GetProcAddress(libXmlHandle, 'xmlSaveToIO');
+    Pointer(xmlSaveDoc) := GetProcAddress(libXmlHandle, 'xmlSaveDoc');
+    Pointer(xmlSaveTree) := GetProcAddress(libXmlHandle, 'xmlSaveTree');
+    Pointer(xmlSaveFlush) := GetProcAddress(libXmlHandle, 'xmlSaveFlush');
+    Pointer(xmlSaveClose) := GetProcAddress(libXmlHandle, 'xmlSaveClose');
+    Pointer(xmlSaveSetEscape) := GetProcAddress(libXmlHandle, 'xmlSaveSetEscape');
+    Pointer(xmlSaveSetAttrEscape) := GetProcAddress(libXmlHandle, 'xmlSaveSetAttrEscape');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+    { xmlschemas.inc }
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+    Pointer(xmlSchemaNewParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaNewParserCtxt');
+    Pointer(xmlSchemaNewMemParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaNewMemParserCtxt');
+    Pointer(xmlSchemaNewDocParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaNewDocParserCtxt');
+    Pointer(xmlSchemaFreeParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeParserCtxt');
+    Pointer(xmlSchemaSetParserErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaSetParserErrors');
+    Pointer(xmlSchemaSetParserStructuredErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaSetParserStructuredErrors');
+    Pointer(xmlSchemaGetParserErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaGetParserErrors');
+    Pointer(xmlSchemaIsValid) := GetProcAddress(libXmlHandle, 'xmlSchemaIsValid');
+    Pointer(xmlSchemaParse) := GetProcAddress(libXmlHandle, 'xmlSchemaParse');
+    Pointer(xmlSchemaFree) := GetProcAddress(libXmlHandle, 'xmlSchemaFree');
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlSchemaDump) := GetProcAddress(libXmlHandle, 'xmlSchemaDump');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+    Pointer(xmlSchemaSetValidErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaSetValidErrors');
+    Pointer(xmlSchemaSetValidStructuredErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaSetValidStructuredErrors');
+    Pointer(xmlSchemaGetValidErrors) := GetProcAddress(libXmlHandle, 'xmlSchemaGetValidErrors');
+    Pointer(xmlSchemaSetValidOptions) := GetProcAddress(libXmlHandle, 'xmlSchemaSetValidOptions');
+    Pointer(xmlSchemaValidCtxtGetOptions) := GetProcAddress(libXmlHandle, 'xmlSchemaValidCtxtGetOptions');
+    Pointer(xmlSchemaNewValidCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaNewValidCtxt');
+    Pointer(xmlSchemaValidCtxtGetParserCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaValidCtxtGetParserCtxt');
+    Pointer(xmlSchemaFreeValidCtxt) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeValidCtxt');
+    Pointer(xmlSchemaValidateDoc) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateDoc');
+    Pointer(xmlSchemaValidateOneElement) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateOneElement');
+    Pointer(xmlSchemaValidateStream) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateStream');
+    Pointer(xmlSchemaValidateFile) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateFile');
+    Pointer(xmlSchemaValidateSetFilename) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateSetFilename');
+    Pointer(xmlSchemaValidateSetLocator) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateSetLocator');
+    Pointer(xmlSchemaSAXPlug) := GetProcAddress(libXmlHandle, 'xmlSchemaSAXPlug');
+    Pointer(xmlSchemaSAXUnplug) := GetProcAddress(libXmlHandle, 'xmlSchemaSAXUnplug');
+  {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+    { xmlschemastypes.inc }
+  {$IFDEF LIBXML_SCHEMAS_ENABLED}
+    Pointer(xmlSchemaInitTypes) := GetProcAddress(libXmlHandle, 'xmlSchemaInitTypes');
+    Pointer(xmlSchemaCleanupTypes) := GetProcAddress(libXmlHandle, 'xmlSchemaCleanupTypes');
+    Pointer(xmlSchemaGetPredefinedType) := GetProcAddress(libXmlHandle, 'xmlSchemaGetPredefinedType');
+    Pointer(xmlSchemaValidatePredefinedType) := GetProcAddress(libXmlHandle, 'xmlSchemaValidatePredefinedType');
+    Pointer(xmlSchemaValPredefTypeNode) := GetProcAddress(libXmlHandle, 'xmlSchemaValPredefTypeNode');
+    Pointer(xmlSchemaValidateFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateFacet');
+    Pointer(xmlSchemaValidateFacetWhtsp) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateFacetWhtsp');
+    Pointer(xmlSchemaFreeValue) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeValue');
+    Pointer(xmlSchemaNewFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaNewFacet');
+    Pointer(xmlSchemaCheckFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaCheckFacet');
+    Pointer(xmlSchemaFreeFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaFreeFacet');
+    Pointer(xmlSchemaCompareValues) := GetProcAddress(libXmlHandle, 'xmlSchemaCompareValues');
+    Pointer(xmlSchemaGetBuiltInListSimpleTypeItemType) := GetProcAddress(libXmlHandle, 'xmlSchemaGetBuiltInListSimpleTypeItemType');
+    Pointer(xmlSchemaValidateListSimpleTypeFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateListSimpleTypeFacet');
+    Pointer(xmlSchemaGetBuiltInType) := GetProcAddress(libXmlHandle, 'xmlSchemaGetBuiltInType');
+    Pointer(xmlSchemaIsBuiltInTypeFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaIsBuiltInTypeFacet');
+    Pointer(xmlSchemaCollapseString) := GetProcAddress(libXmlHandle, 'xmlSchemaCollapseString');
+    Pointer(xmlSchemaWhiteSpaceReplace) := GetProcAddress(libXmlHandle, 'xmlSchemaWhiteSpaceReplace');
+    Pointer(xmlSchemaGetFacetValueAsULong) := GetProcAddress(libXmlHandle, 'xmlSchemaGetFacetValueAsULong');
+    Pointer(xmlSchemaValidateLengthFacet) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateLengthFacet');
+    Pointer(xmlSchemaValidateLengthFacetWhtsp) := GetProcAddress(libXmlHandle, 'xmlSchemaValidateLengthFacetWhtsp');
+    Pointer(xmlSchemaValPredefTypeNodeNoNorm) := GetProcAddress(libXmlHandle, 'xmlSchemaValPredefTypeNodeNoNorm');
+    Pointer(xmlSchemaGetCanonValue) := GetProcAddress(libXmlHandle, 'xmlSchemaGetCanonValue');
+    Pointer(xmlSchemaGetCanonValueWhtsp) := GetProcAddress(libXmlHandle, 'xmlSchemaGetCanonValueWhtsp');
+    Pointer(xmlSchemaValueAppend) := GetProcAddress(libXmlHandle, 'xmlSchemaValueAppend');
+    Pointer(xmlSchemaValueGetNext) := GetProcAddress(libXmlHandle, 'xmlSchemaValueGetNext');
+    Pointer(xmlSchemaValueGetAsString) := GetProcAddress(libXmlHandle, 'xmlSchemaValueGetAsString');
+    Pointer(xmlSchemaValueGetAsBoolean) := GetProcAddress(libXmlHandle, 'xmlSchemaValueGetAsBoolean');
+    Pointer(xmlSchemaNewStringValue) := GetProcAddress(libXmlHandle, 'xmlSchemaNewStringValue');
+    Pointer(xmlSchemaNewNOTATIONValue) := GetProcAddress(libXmlHandle, 'xmlSchemaNewNOTATIONValue');
+    Pointer(xmlSchemaNewQNameValue) := GetProcAddress(libXmlHandle, 'xmlSchemaNewQNameValue');
+    Pointer(xmlSchemaCompareValuesWhtsp) := GetProcAddress(libXmlHandle, 'xmlSchemaCompareValuesWhtsp');
+    Pointer(xmlSchemaCopyValue) := GetProcAddress(libXmlHandle, 'xmlSchemaCopyValue');
+    Pointer(xmlSchemaGetValType) := GetProcAddress(libXmlHandle, 'xmlSchemaGetValType');
+  {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+    { xmlstring.inc }
+    Pointer(xmlStrdup) := GetProcAddress(libXmlHandle, 'xmlStrdup');
+    Pointer(xmlStrndup) := GetProcAddress(libXmlHandle, 'xmlStrndup');
+    Pointer(xmlCharStrndup) := GetProcAddress(libXmlHandle, 'xmlCharStrndup');
+    Pointer(xmlCharStrdup) := GetProcAddress(libXmlHandle, 'xmlCharStrdup');
+    Pointer(xmlStrsub) := GetProcAddress(libXmlHandle, 'xmlStrsub');
+    Pointer(xmlStrchr) := GetProcAddress(libXmlHandle, 'xmlStrchr');
+    Pointer(xmlStrstr) := GetProcAddress(libXmlHandle, 'xmlStrstr');
+    Pointer(xmlStrcasestr) := GetProcAddress(libXmlHandle, 'xmlStrcasestr');
+    Pointer(xmlStrcmp) := GetProcAddress(libXmlHandle, 'xmlStrcmp');
+    Pointer(xmlStrncmp) := GetProcAddress(libXmlHandle, 'xmlStrncmp');
+    Pointer(xmlStrcasecmp) := GetProcAddress(libXmlHandle, 'xmlStrcasecmp');
+    Pointer(xmlStrncasecmp) := GetProcAddress(libXmlHandle, 'xmlStrncasecmp');
+    Pointer(xmlStrEqual) := GetProcAddress(libXmlHandle, 'xmlStrEqual');
+    Pointer(xmlStrQEqual) := GetProcAddress(libXmlHandle, 'xmlStrQEqual');
+    Pointer(xmlStrlen) := GetProcAddress(libXmlHandle, 'xmlStrlen');
+    Pointer(xmlStrcat) := GetProcAddress(libXmlHandle, 'xmlStrcat');
+    Pointer(xmlStrncat) := GetProcAddress(libXmlHandle, 'xmlStrncat');
+    Pointer(xmlStrncatNew) := GetProcAddress(libXmlHandle, 'xmlStrncatNew');
+    Pointer(xmlStrPrintf) := GetProcAddress(libXmlHandle, 'xmlStrPrintf');
+    Pointer(xmlStrVPrintf) := GetProcAddress(libXmlHandle, 'xmlStrVPrintf');
+    Pointer(xmlGetUTF8Char) := GetProcAddress(libXmlHandle, 'xmlGetUTF8Char');
+    Pointer(xmlCheckUTF8) := GetProcAddress(libXmlHandle, 'xmlCheckUTF8');
+    Pointer(xmlUTF8Strsize) := GetProcAddress(libXmlHandle, 'xmlUTF8Strsize');
+    Pointer(xmlUTF8Strndup) := GetProcAddress(libXmlHandle, 'xmlUTF8Strndup');
+    Pointer(xmlUTF8Strpos) := GetProcAddress(libXmlHandle, 'xmlUTF8Strpos');
+    Pointer(xmlUTF8Strloc) := GetProcAddress(libXmlHandle, 'xmlUTF8Strloc');
+    Pointer(xmlUTF8Strsub) := GetProcAddress(libXmlHandle, 'xmlUTF8Strsub');
+    Pointer(xmlUTF8Strlen) := GetProcAddress(libXmlHandle, 'xmlUTF8Strlen');
+    Pointer(xmlUTF8Size) := GetProcAddress(libXmlHandle, 'xmlUTF8Size');
+    Pointer(xmlUTF8Charcmp) := GetProcAddress(libXmlHandle, 'xmlUTF8Charcmp');
+
+    { xmlunicode.inc }
+  {$IFDEF LIBXML_UNICODE_ENABLED}
+    Pointer(xmlUCSIsAegeanNumbers) := GetProcAddress(libXmlHandle, 'xmlUCSIsAegeanNumbers');
+    Pointer(xmlUCSIsAlphabeticPresentationForms) := GetProcAddress(libXmlHandle, 'xmlUCSIsAlphabeticPresentationForms');
+    Pointer(xmlUCSIsArabic) := GetProcAddress(libXmlHandle, 'xmlUCSIsArabic');
+    Pointer(xmlUCSIsArabicPresentationFormsA) := GetProcAddress(libXmlHandle, 'xmlUCSIsArabicPresentationFormsA');
+    Pointer(xmlUCSIsArabicPresentationFormsB) := GetProcAddress(libXmlHandle, 'xmlUCSIsArabicPresentationFormsB');
+    Pointer(xmlUCSIsArmenian) := GetProcAddress(libXmlHandle, 'xmlUCSIsArmenian');
+    Pointer(xmlUCSIsArrows) := GetProcAddress(libXmlHandle, 'xmlUCSIsArrows');
+    Pointer(xmlUCSIsBasicLatin) := GetProcAddress(libXmlHandle, 'xmlUCSIsBasicLatin');
+    Pointer(xmlUCSIsBengali) := GetProcAddress(libXmlHandle, 'xmlUCSIsBengali');
+    Pointer(xmlUCSIsBlockElements) := GetProcAddress(libXmlHandle, 'xmlUCSIsBlockElements');
+    Pointer(xmlUCSIsBopomofo) := GetProcAddress(libXmlHandle, 'xmlUCSIsBopomofo');
+    Pointer(xmlUCSIsBopomofoExtended) := GetProcAddress(libXmlHandle, 'xmlUCSIsBopomofoExtended');
+    Pointer(xmlUCSIsBoxDrawing) := GetProcAddress(libXmlHandle, 'xmlUCSIsBoxDrawing');
+    Pointer(xmlUCSIsBraillePatterns) := GetProcAddress(libXmlHandle, 'xmlUCSIsBraillePatterns');
+    Pointer(xmlUCSIsBuhid) := GetProcAddress(libXmlHandle, 'xmlUCSIsBuhid');
+    Pointer(xmlUCSIsByzantineMusicalSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsByzantineMusicalSymbols');
+    Pointer(xmlUCSIsCJKCompatibility) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKCompatibility');
+    Pointer(xmlUCSIsCJKCompatibilityForms) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKCompatibilityForms');
+    Pointer(xmlUCSIsCJKCompatibilityIdeographs) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKCompatibilityIdeographs');
+    Pointer(xmlUCSIsCJKCompatibilityIdeographsSupplement) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKCompatibilityIdeographsSupplement');
+    Pointer(xmlUCSIsCJKRadicalsSupplement) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKRadicalsSupplement');
+    Pointer(xmlUCSIsCJKSymbolsandPunctuation) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKSymbolsandPunctuation');
+    Pointer(xmlUCSIsCJKUnifiedIdeographs) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKUnifiedIdeographs');
+    Pointer(xmlUCSIsCJKUnifiedIdeographsExtensionA) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKUnifiedIdeographsExtensionA');
+    Pointer(xmlUCSIsCJKUnifiedIdeographsExtensionB) := GetProcAddress(libXmlHandle, 'xmlUCSIsCJKUnifiedIdeographsExtensionB');
+    Pointer(xmlUCSIsCherokee) := GetProcAddress(libXmlHandle, 'xmlUCSIsCherokee');
+    Pointer(xmlUCSIsCombiningDiacriticalMarks) := GetProcAddress(libXmlHandle, 'xmlUCSIsCombiningDiacriticalMarks');
+    Pointer(xmlUCSIsCombiningDiacriticalMarksforSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsCombiningDiacriticalMarksforSymbols');
+    Pointer(xmlUCSIsCombiningHalfMarks) := GetProcAddress(libXmlHandle, 'xmlUCSIsCombiningHalfMarks');
+    Pointer(xmlUCSIsCombiningMarksforSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsCombiningMarksforSymbols');
+    Pointer(xmlUCSIsControlPictures) := GetProcAddress(libXmlHandle, 'xmlUCSIsControlPictures');
+    Pointer(xmlUCSIsCurrencySymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsCurrencySymbols');
+    Pointer(xmlUCSIsCypriotSyllabary) := GetProcAddress(libXmlHandle, 'xmlUCSIsCypriotSyllabary');
+    Pointer(xmlUCSIsCyrillic) := GetProcAddress(libXmlHandle, 'xmlUCSIsCyrillic');
+    Pointer(xmlUCSIsCyrillicSupplement) := GetProcAddress(libXmlHandle, 'xmlUCSIsCyrillicSupplement');
+    Pointer(xmlUCSIsDeseret) := GetProcAddress(libXmlHandle, 'xmlUCSIsDeseret');
+    Pointer(xmlUCSIsDevanagari) := GetProcAddress(libXmlHandle, 'xmlUCSIsDevanagari');
+    Pointer(xmlUCSIsDingbats) := GetProcAddress(libXmlHandle, 'xmlUCSIsDingbats');
+    Pointer(xmlUCSIsEnclosedAlphanumerics) := GetProcAddress(libXmlHandle, 'xmlUCSIsEnclosedAlphanumerics');
+    Pointer(xmlUCSIsEnclosedCJKLettersandMonths) := GetProcAddress(libXmlHandle, 'xmlUCSIsEnclosedCJKLettersandMonths');
+    Pointer(xmlUCSIsEthiopic) := GetProcAddress(libXmlHandle, 'xmlUCSIsEthiopic');
+    Pointer(xmlUCSIsGeneralPunctuation) := GetProcAddress(libXmlHandle, 'xmlUCSIsGeneralPunctuation');
+    Pointer(xmlUCSIsGeometricShapes) := GetProcAddress(libXmlHandle, 'xmlUCSIsGeometricShapes');
+    Pointer(xmlUCSIsGeorgian) := GetProcAddress(libXmlHandle, 'xmlUCSIsGeorgian');
+    Pointer(xmlUCSIsGothic) := GetProcAddress(libXmlHandle, 'xmlUCSIsGothic');
+    Pointer(xmlUCSIsGreek) := GetProcAddress(libXmlHandle, 'xmlUCSIsGreek');
+    Pointer(xmlUCSIsGreekExtended) := GetProcAddress(libXmlHandle, 'xmlUCSIsGreekExtended');
+    Pointer(xmlUCSIsGreekandCoptic) := GetProcAddress(libXmlHandle, 'xmlUCSIsGreekandCoptic');
+    Pointer(xmlUCSIsGujarati) := GetProcAddress(libXmlHandle, 'xmlUCSIsGujarati');
+    Pointer(xmlUCSIsGurmukhi) := GetProcAddress(libXmlHandle, 'xmlUCSIsGurmukhi');
+    Pointer(xmlUCSIsHalfwidthandFullwidthForms) := GetProcAddress(libXmlHandle, 'xmlUCSIsHalfwidthandFullwidthForms');
+    Pointer(xmlUCSIsHangulCompatibilityJamo) := GetProcAddress(libXmlHandle, 'xmlUCSIsHangulCompatibilityJamo');
+    Pointer(xmlUCSIsHangulJamo) := GetProcAddress(libXmlHandle, 'xmlUCSIsHangulJamo');
+    Pointer(xmlUCSIsHangulSyllables) := GetProcAddress(libXmlHandle, 'xmlUCSIsHangulSyllables');
+    Pointer(xmlUCSIsHanunoo) := GetProcAddress(libXmlHandle, 'xmlUCSIsHanunoo');
+    Pointer(xmlUCSIsHebrew) := GetProcAddress(libXmlHandle, 'xmlUCSIsHebrew');
+    Pointer(xmlUCSIsHighPrivateUseSurrogates) := GetProcAddress(libXmlHandle, 'xmlUCSIsHighPrivateUseSurrogates');
+    Pointer(xmlUCSIsHighSurrogates) := GetProcAddress(libXmlHandle, 'xmlUCSIsHighSurrogates');
+    Pointer(xmlUCSIsHiragana) := GetProcAddress(libXmlHandle, 'xmlUCSIsHiragana');
+    Pointer(xmlUCSIsIPAExtensions) := GetProcAddress(libXmlHandle, 'xmlUCSIsIPAExtensions');
+    Pointer(xmlUCSIsIdeographicDescriptionCharacters) := GetProcAddress(libXmlHandle, 'xmlUCSIsIdeographicDescriptionCharacters');
+    Pointer(xmlUCSIsKanbun) := GetProcAddress(libXmlHandle, 'xmlUCSIsKanbun');
+    Pointer(xmlUCSIsKangxiRadicals) := GetProcAddress(libXmlHandle, 'xmlUCSIsKangxiRadicals');
+    Pointer(xmlUCSIsKannada) := GetProcAddress(libXmlHandle, 'xmlUCSIsKannada');
+    Pointer(xmlUCSIsKatakana) := GetProcAddress(libXmlHandle, 'xmlUCSIsKatakana');
+    Pointer(xmlUCSIsKatakanaPhoneticExtensions) := GetProcAddress(libXmlHandle, 'xmlUCSIsKatakanaPhoneticExtensions');
+    Pointer(xmlUCSIsKhmer) := GetProcAddress(libXmlHandle, 'xmlUCSIsKhmer');
+    Pointer(xmlUCSIsKhmerSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsKhmerSymbols');
+    Pointer(xmlUCSIsLao) := GetProcAddress(libXmlHandle, 'xmlUCSIsLao');
+    Pointer(xmlUCSIsLatin1Supplement) := GetProcAddress(libXmlHandle, 'xmlUCSIsLatin1Supplement');
+    Pointer(xmlUCSIsLatinExtendedA) := GetProcAddress(libXmlHandle, 'xmlUCSIsLatinExtendedA');
+    Pointer(xmlUCSIsLatinExtendedB) := GetProcAddress(libXmlHandle, 'xmlUCSIsLatinExtendedB');
+    Pointer(xmlUCSIsLatinExtendedAdditional) := GetProcAddress(libXmlHandle, 'xmlUCSIsLatinExtendedAdditional');
+    Pointer(xmlUCSIsLetterlikeSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsLetterlikeSymbols');
+    Pointer(xmlUCSIsLimbu) := GetProcAddress(libXmlHandle, 'xmlUCSIsLimbu');
+    Pointer(xmlUCSIsLinearBIdeograms) := GetProcAddress(libXmlHandle, 'xmlUCSIsLinearBIdeograms');
+    Pointer(xmlUCSIsLinearBSyllabary) := GetProcAddress(libXmlHandle, 'xmlUCSIsLinearBSyllabary');
+    Pointer(xmlUCSIsLowSurrogates) := GetProcAddress(libXmlHandle, 'xmlUCSIsLowSurrogates');
+    Pointer(xmlUCSIsMalayalam) := GetProcAddress(libXmlHandle, 'xmlUCSIsMalayalam');
+    Pointer(xmlUCSIsMathematicalAlphanumericSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsMathematicalAlphanumericSymbols');
+    Pointer(xmlUCSIsMathematicalOperators) := GetProcAddress(libXmlHandle, 'xmlUCSIsMathematicalOperators');
+    Pointer(xmlUCSIsMiscellaneousMathematicalSymbolsA) := GetProcAddress(libXmlHandle, 'xmlUCSIsMiscellaneousMathematicalSymbolsA');
+    Pointer(xmlUCSIsMiscellaneousMathematicalSymbolsB) := GetProcAddress(libXmlHandle, 'xmlUCSIsMiscellaneousMathematicalSymbolsB');
+    Pointer(xmlUCSIsMiscellaneousSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsMiscellaneousSymbols');
+    Pointer(xmlUCSIsMiscellaneousSymbolsandArrows) := GetProcAddress(libXmlHandle, 'xmlUCSIsMiscellaneousSymbolsandArrows');
+    Pointer(xmlUCSIsMiscellaneousTechnical) := GetProcAddress(libXmlHandle, 'xmlUCSIsMiscellaneousTechnical');
+    Pointer(xmlUCSIsMongolian) := GetProcAddress(libXmlHandle, 'xmlUCSIsMongolian');
+    Pointer(xmlUCSIsMusicalSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsMusicalSymbols');
+    Pointer(xmlUCSIsMyanmar) := GetProcAddress(libXmlHandle, 'xmlUCSIsMyanmar');
+    Pointer(xmlUCSIsNumberForms) := GetProcAddress(libXmlHandle, 'xmlUCSIsNumberForms');
+    Pointer(xmlUCSIsOgham) := GetProcAddress(libXmlHandle, 'xmlUCSIsOgham');
+    Pointer(xmlUCSIsOldItalic) := GetProcAddress(libXmlHandle, 'xmlUCSIsOldItalic');
+    Pointer(xmlUCSIsOpticalCharacterRecognition) := GetProcAddress(libXmlHandle, 'xmlUCSIsOpticalCharacterRecognition');
+    Pointer(xmlUCSIsOriya) := GetProcAddress(libXmlHandle, 'xmlUCSIsOriya');
+    Pointer(xmlUCSIsOsmanya) := GetProcAddress(libXmlHandle, 'xmlUCSIsOsmanya');
+    Pointer(xmlUCSIsPhoneticExtensions) := GetProcAddress(libXmlHandle, 'xmlUCSIsPhoneticExtensions');
+    Pointer(xmlUCSIsPrivateUse) := GetProcAddress(libXmlHandle, 'xmlUCSIsPrivateUse');
+    Pointer(xmlUCSIsPrivateUseArea) := GetProcAddress(libXmlHandle, 'xmlUCSIsPrivateUseArea');
+    Pointer(xmlUCSIsRunic) := GetProcAddress(libXmlHandle, 'xmlUCSIsRunic');
+    Pointer(xmlUCSIsShavian) := GetProcAddress(libXmlHandle, 'xmlUCSIsShavian');
+    Pointer(xmlUCSIsSinhala) := GetProcAddress(libXmlHandle, 'xmlUCSIsSinhala');
+    Pointer(xmlUCSIsSmallFormVariants) := GetProcAddress(libXmlHandle, 'xmlUCSIsSmallFormVariants');
+    Pointer(xmlUCSIsSpacingModifierLetters) := GetProcAddress(libXmlHandle, 'xmlUCSIsSpacingModifierLetters');
+    Pointer(xmlUCSIsSpecials) := GetProcAddress(libXmlHandle, 'xmlUCSIsSpecials');
+    Pointer(xmlUCSIsSuperscriptsandSubscripts) := GetProcAddress(libXmlHandle, 'xmlUCSIsSuperscriptsandSubscripts');
+    Pointer(xmlUCSIsSupplementalArrowsA) := GetProcAddress(libXmlHandle, 'xmlUCSIsSupplementalArrowsA');
+    Pointer(xmlUCSIsSupplementalArrowsB) := GetProcAddress(libXmlHandle, 'xmlUCSIsSupplementalArrowsB');
+    Pointer(xmlUCSIsSupplementalMathematicalOperators) := GetProcAddress(libXmlHandle, 'xmlUCSIsSupplementalMathematicalOperators');
+    Pointer(xmlUCSIsSupplementaryPrivateUseAreaA) := GetProcAddress(libXmlHandle, 'xmlUCSIsSupplementaryPrivateUseAreaA');
+    Pointer(xmlUCSIsSupplementaryPrivateUseAreaB) := GetProcAddress(libXmlHandle, 'xmlUCSIsSupplementaryPrivateUseAreaB');
+    Pointer(xmlUCSIsSyriac) := GetProcAddress(libXmlHandle, 'xmlUCSIsSyriac');
+    Pointer(xmlUCSIsTagalog) := GetProcAddress(libXmlHandle, 'xmlUCSIsTagalog');
+    Pointer(xmlUCSIsTagbanwa) := GetProcAddress(libXmlHandle, 'xmlUCSIsTagbanwa');
+    Pointer(xmlUCSIsTags) := GetProcAddress(libXmlHandle, 'xmlUCSIsTags');
+    Pointer(xmlUCSIsTaiLe) := GetProcAddress(libXmlHandle, 'xmlUCSIsTaiLe');
+    Pointer(xmlUCSIsTaiXuanJingSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsTaiXuanJingSymbols');
+    Pointer(xmlUCSIsTamil) := GetProcAddress(libXmlHandle, 'xmlUCSIsTamil');
+    Pointer(xmlUCSIsTelugu) := GetProcAddress(libXmlHandle, 'xmlUCSIsTelugu');
+    Pointer(xmlUCSIsThaana) := GetProcAddress(libXmlHandle, 'xmlUCSIsThaana');
+    Pointer(xmlUCSIsThai) := GetProcAddress(libXmlHandle, 'xmlUCSIsThai');
+    Pointer(xmlUCSIsTibetan) := GetProcAddress(libXmlHandle, 'xmlUCSIsTibetan');
+    Pointer(xmlUCSIsUgaritic) := GetProcAddress(libXmlHandle, 'xmlUCSIsUgaritic');
+    Pointer(xmlUCSIsUnifiedCanadianAboriginalSyllabics) := GetProcAddress(libXmlHandle, 'xmlUCSIsUnifiedCanadianAboriginalSyllabics');
+    Pointer(xmlUCSIsVariationSelectors) := GetProcAddress(libXmlHandle, 'xmlUCSIsVariationSelectors');
+    Pointer(xmlUCSIsVariationSelectorsSupplement) := GetProcAddress(libXmlHandle, 'xmlUCSIsVariationSelectorsSupplement');
+    Pointer(xmlUCSIsYiRadicals) := GetProcAddress(libXmlHandle, 'xmlUCSIsYiRadicals');
+    Pointer(xmlUCSIsYiSyllables) := GetProcAddress(libXmlHandle, 'xmlUCSIsYiSyllables');
+    Pointer(xmlUCSIsYijingHexagramSymbols) := GetProcAddress(libXmlHandle, 'xmlUCSIsYijingHexagramSymbols');
+    Pointer(xmlUCSIsBlock) := GetProcAddress(libXmlHandle, 'xmlUCSIsBlock');
+    Pointer(xmlUCSIsCatC) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatC');
+    Pointer(xmlUCSIsCatCc) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatCc');
+    Pointer(xmlUCSIsCatCf) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatCf');
+    Pointer(xmlUCSIsCatCo) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatCo');
+    Pointer(xmlUCSIsCatCs) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatCs');
+    Pointer(xmlUCSIsCatL) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatL');
+    Pointer(xmlUCSIsCatLl) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatLl');
+    Pointer(xmlUCSIsCatLm) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatLm');
+    Pointer(xmlUCSIsCatLo) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatLo');
+    Pointer(xmlUCSIsCatLt) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatLt');
+    Pointer(xmlUCSIsCatLu) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatLu');
+    Pointer(xmlUCSIsCatM) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatM');
+    Pointer(xmlUCSIsCatMc) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatMc');
+    Pointer(xmlUCSIsCatMe) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatMe');
+    Pointer(xmlUCSIsCatMn) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatMn');
+    Pointer(xmlUCSIsCatN) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatN');
+    Pointer(xmlUCSIsCatNd) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatNd');
+    Pointer(xmlUCSIsCatNl) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatNl');
+    Pointer(xmlUCSIsCatNo) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatNo');
+    Pointer(xmlUCSIsCatP) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatP');
+    Pointer(xmlUCSIsCatPc) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPc');
+    Pointer(xmlUCSIsCatPd) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPd');
+    Pointer(xmlUCSIsCatPe) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPe');
+    Pointer(xmlUCSIsCatPf) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPf');
+    Pointer(xmlUCSIsCatPi) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPi');
+    Pointer(xmlUCSIsCatPo) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPo');
+    Pointer(xmlUCSIsCatPs) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatPs');
+    Pointer(xmlUCSIsCatS) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatS');
+    Pointer(xmlUCSIsCatSc) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatSc');
+    Pointer(xmlUCSIsCatSk) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatSk');
+    Pointer(xmlUCSIsCatSm) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatSm');
+    Pointer(xmlUCSIsCatSo) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatSo');
+    Pointer(xmlUCSIsCatZ) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatZ');
+    Pointer(xmlUCSIsCatZl) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatZl');
+    Pointer(xmlUCSIsCatZp) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatZp');
+    Pointer(xmlUCSIsCatZs) := GetProcAddress(libXmlHandle, 'xmlUCSIsCatZs');
+    Pointer(xmlUCSIsCat) := GetProcAddress(libXmlHandle, 'xmlUCSIsCat');
+  {$ENDIF} (* LIBXML_UNICODE_ENABLED *)
+
+    { xmlwriter.inc }
+  {$IFDEF LIBXML_WRITER_ENABLED}
+    Pointer(xmlNewTextWriter) := GetProcAddress(libXmlHandle, 'xmlNewTextWriter');
+    Pointer(xmlNewTextWriterFilename) := GetProcAddress(libXmlHandle, 'xmlNewTextWriterFilename');
+    Pointer(xmlNewTextWriterMemory) := GetProcAddress(libXmlHandle, 'xmlNewTextWriterMemory');
+    Pointer(xmlNewTextWriterPushParser) := GetProcAddress(libXmlHandle, 'xmlNewTextWriterPushParser');
+    Pointer(xmlNewTextWriterDoc) := GetProcAddress(libXmlHandle, 'xmlNewTextWriterDoc');
+    Pointer(xmlNewTextWriterTree) := GetProcAddress(libXmlHandle, 'xmlNewTextWriterTree');
+    Pointer(xmlFreeTextWriter) := GetProcAddress(libXmlHandle, 'xmlFreeTextWriter');
+    Pointer(xmlTextWriterStartDocument) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartDocument');
+    Pointer(xmlTextWriterEndDocument) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndDocument');
+    Pointer(xmlTextWriterStartComment) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartComment');
+    Pointer(xmlTextWriterEndComment) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndComment');
+    Pointer(xmlTextWriterWriteFormatComment) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatComment');
+    Pointer(xmlTextWriterWriteVFormatComment) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatComment');
+    Pointer(xmlTextWriterWriteComment) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteComment');
+    Pointer(xmlTextWriterStartElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartElement');
+    Pointer(xmlTextWriterStartElementNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartElementNS');
+    Pointer(xmlTextWriterEndElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndElement');
+    Pointer(xmlTextWriterFullEndElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterFullEndElement');
+    Pointer(xmlTextWriterWriteFormatElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatElement');
+    Pointer(xmlTextWriterWriteVFormatElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatElement');
+    Pointer(xmlTextWriterWriteElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteElement');
+    Pointer(xmlTextWriterWriteFormatElementNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatElementNS');
+    Pointer(xmlTextWriterWriteVFormatElementNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatElementNS');
+    Pointer(xmlTextWriterWriteElementNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteElementNS');
+    Pointer(xmlTextWriterWriteFormatRaw) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatRaw');
+    Pointer(xmlTextWriterWriteVFormatRaw) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatRaw');
+    Pointer(xmlTextWriterWriteRawLen) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteRawLen');
+    Pointer(xmlTextWriterWriteRaw) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteRaw');
+    Pointer(xmlTextWriterWriteFormatString) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatString');
+    Pointer(xmlTextWriterWriteVFormatString) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatString');
+    Pointer(xmlTextWriterWriteString) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteString');
+    Pointer(xmlTextWriterWriteBase64) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteBase64');
+    Pointer(xmlTextWriterWriteBinHex) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteBinHex');
+    Pointer(xmlTextWriterStartAttribute) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartAttribute');
+    Pointer(xmlTextWriterStartAttributeNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartAttributeNS');
+    Pointer(xmlTextWriterEndAttribute) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndAttribute');
+    Pointer(xmlTextWriterWriteFormatAttribute) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatAttribute');
+    Pointer(xmlTextWriterWriteVFormatAttribute) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatAttribute');
+    Pointer(xmlTextWriterWriteAttribute) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteAttribute');
+    Pointer(xmlTextWriterWriteFormatAttributeNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatAttributeNS');
+    Pointer(xmlTextWriterWriteVFormatAttributeNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatAttributeNS');
+    Pointer(xmlTextWriterWriteAttributeNS) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteAttributeNS');
+    Pointer(xmlTextWriterStartPI) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartPI');
+    Pointer(xmlTextWriterEndPI) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndPI');
+    Pointer(xmlTextWriterWriteFormatPI) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatPI');
+    Pointer(xmlTextWriterWriteVFormatPI) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatPI');
+    Pointer(xmlTextWriterWritePI) := GetProcAddress(libXmlHandle, 'xmlTextWriterWritePI');
+    Pointer(xmlTextWriterStartCDATA) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartCDATA');
+    Pointer(xmlTextWriterEndCDATA) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndCDATA');
+    Pointer(xmlTextWriterWriteFormatCDATA) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatCDATA');
+    Pointer(xmlTextWriterWriteVFormatCDATA) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatCDATA');
+    Pointer(xmlTextWriterWriteCDATA) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteCDATA');
+    Pointer(xmlTextWriterStartDTD) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartDTD');
+    Pointer(xmlTextWriterEndDTD) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndDTD');
+    Pointer(xmlTextWriterWriteFormatDTD) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatDTD');
+    Pointer(xmlTextWriterWriteVFormatDTD) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatDTD');
+    Pointer(xmlTextWriterWriteDTD) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTD');
+    Pointer(xmlTextWriterStartDTDElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartDTDElement');
+    Pointer(xmlTextWriterEndDTDElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndDTDElement');
+    Pointer(xmlTextWriterWriteFormatDTDElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatDTDElement');
+    Pointer(xmlTextWriterWriteVFormatDTDElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatDTDElement');
+    Pointer(xmlTextWriterWriteDTDElement) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDElement');
+    Pointer(xmlTextWriterStartDTDAttlist) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartDTDAttlist');
+    Pointer(xmlTextWriterEndDTDAttlist) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndDTDAttlist');
+    Pointer(xmlTextWriterWriteFormatDTDAttlist) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatDTDAttlist');
+    Pointer(xmlTextWriterWriteVFormatDTDAttlist) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatDTDAttlist');
+    Pointer(xmlTextWriterWriteDTDAttlist) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDAttlist');
+    Pointer(xmlTextWriterStartDTDEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterStartDTDEntity');
+    Pointer(xmlTextWriterEndDTDEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterEndDTDEntity');
+    Pointer(xmlTextWriterWriteFormatDTDInternalEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteFormatDTDInternalEntity');
+    Pointer(xmlTextWriterWriteVFormatDTDInternalEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteVFormatDTDInternalEntity');
+    Pointer(xmlTextWriterWriteDTDInternalEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDInternalEntity');
+    Pointer(xmlTextWriterWriteDTDExternalEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDExternalEntity');
+    Pointer(xmlTextWriterWriteDTDExternalEntityContents) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDExternalEntityContents');
+    Pointer(xmlTextWriterWriteDTDEntity) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDEntity');
+    Pointer(xmlTextWriterWriteDTDNotation) := GetProcAddress(libXmlHandle, 'xmlTextWriterWriteDTDNotation');
+    Pointer(xmlTextWriterSetIndent) := GetProcAddress(libXmlHandle, 'xmlTextWriterSetIndent');
+    Pointer(xmlTextWriterSetIndentString) := GetProcAddress(libXmlHandle, 'xmlTextWriterSetIndentString');
+    Pointer(xmlTextWriterSetQuoteChar) := GetProcAddress(libXmlHandle, 'xmlTextWriterSetQuoteChar');
+    Pointer(xmlTextWriterFlush) := GetProcAddress(libXmlHandle, 'xmlTextWriterFlush');
+    Pointer(xmlTextWriterClose) := GetProcAddress(libXmlHandle, 'xmlTextWriterClose');
+  {$ENDIF} (* LIBXML_WRITER_ENABLED *)
+
+    { c14n.inc }
+  {$IFDEF LIBXML_C14N_ENABLED}
+  {$IFDEF LIBXML_OUTPUT_ENABLED}
+    Pointer(xmlC14NDocSaveTo) := GetProcAddress(libXmlHandle, 'xmlC14NDocSaveTo');
+    Pointer(xmlC14NDocDumpMemory) := GetProcAddress(libXmlHandle, 'xmlC14NDocDumpMemory');
+    Pointer(xmlC14NDocSave) := GetProcAddress(libXmlHandle, 'xmlC14NDocSave');
+    Pointer(xmlC14NExecute) := GetProcAddress(libXmlHandle, 'xmlC14NExecute');
+  {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  {$ENDIF} (* LIBXML_C14N_ENABLED *)
+
+    { xpath.inc }
+  {$IFDEF LIBXML_XPATH_ENABLED}
+    Pointer(xmlXPathFreeObject) := GetProcAddress(libXmlHandle, 'xmlXPathFreeObject');
+    Pointer(xmlXPathNodeSetCreate) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetCreate');
+    Pointer(xmlXPathFreeNodeSetList) := GetProcAddress(libXmlHandle, 'xmlXPathFreeNodeSetList');
+    Pointer(xmlXPathFreeNodeSet) := GetProcAddress(libXmlHandle, 'xmlXPathFreeNodeSet');
+    Pointer(xmlXPathObjectCopy) := GetProcAddress(libXmlHandle, 'xmlXPathObjectCopy');
+    Pointer(xmlXPathCmpNodes) := GetProcAddress(libXmlHandle, 'xmlXPathCmpNodes');
+    Pointer(xmlXPathCastNumberToBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathCastNumberToBoolean');
+    Pointer(xmlXPathCastStringToBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathCastStringToBoolean');
+    Pointer(xmlXPathCastNodeSetToBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathCastNodeSetToBoolean');
+    Pointer(xmlXPathCastToBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathCastToBoolean');
+    Pointer(xmlXPathCastBooleanToNumber) := GetProcAddress(libXmlHandle, 'xmlXPathCastBooleanToNumber');
+    Pointer(xmlXPathCastStringToNumber) := GetProcAddress(libXmlHandle, 'xmlXPathCastStringToNumber');
+    Pointer(xmlXPathCastNodeToNumber) := GetProcAddress(libXmlHandle, 'xmlXPathCastNodeToNumber');
+    Pointer(xmlXPathCastNodeSetToNumber) := GetProcAddress(libXmlHandle, 'xmlXPathCastNodeSetToNumber');
+    Pointer(xmlXPathCastToNumber) := GetProcAddress(libXmlHandle, 'xmlXPathCastToNumber');
+    Pointer(xmlXPathCastBooleanToString) := GetProcAddress(libXmlHandle, 'xmlXPathCastBooleanToString');
+    Pointer(xmlXPathCastNumberToString) := GetProcAddress(libXmlHandle, 'xmlXPathCastNumberToString');
+    Pointer(xmlXPathCastNodeToString) := GetProcAddress(libXmlHandle, 'xmlXPathCastNodeToString');
+    Pointer(xmlXPathCastNodeSetToString) := GetProcAddress(libXmlHandle, 'xmlXPathCastNodeSetToString');
+    Pointer(xmlXPathCastToString) := GetProcAddress(libXmlHandle, 'xmlXPathCastToString');
+    Pointer(xmlXPathConvertBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathConvertBoolean');
+    Pointer(xmlXPathConvertNumber) := GetProcAddress(libXmlHandle, 'xmlXPathConvertNumber');
+    Pointer(xmlXPathConvertString) := GetProcAddress(libXmlHandle, 'xmlXPathConvertString');
+    Pointer(xmlXPathNewContext) := GetProcAddress(libXmlHandle, 'xmlXPathNewContext');
+    Pointer(xmlXPathFreeContext) := GetProcAddress(libXmlHandle, 'xmlXPathFreeContext');
+    Pointer(xmlXPathContextSetCache) := GetProcAddress(libXmlHandle, 'xmlXPathContextSetCache');
+    Pointer(xmlXPathOrderDocElems) := GetProcAddress(libXmlHandle, 'xmlXPathOrderDocElems');
+    Pointer(xmlXPathSetContextNode) := GetProcAddress(libXmlHandle, 'xmlXPathSetContextNode');
+    Pointer(xmlXPathNodeEval) := GetProcAddress(libXmlHandle, 'xmlXPathNodeEval');
+    Pointer(xmlXPathEval) := GetProcAddress(libXmlHandle, 'xmlXPathEval');
+    Pointer(xmlXPathEvalExpression) := GetProcAddress(libXmlHandle, 'xmlXPathEvalExpression');
+    Pointer(xmlXPathEvalPredicate) := GetProcAddress(libXmlHandle, 'xmlXPathEvalPredicate');
+    Pointer(xmlXPathCompile) := GetProcAddress(libXmlHandle, 'xmlXPathCompile');
+    Pointer(xmlXPathCtxtCompile) := GetProcAddress(libXmlHandle, 'xmlXPathCtxtCompile');
+    Pointer(xmlXPathCompiledEval) := GetProcAddress(libXmlHandle, 'xmlXPathCompiledEval');
+    Pointer(xmlXPathCompiledEvalToBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathCompiledEvalToBoolean');
+    Pointer(xmlXPathFreeCompExpr) := GetProcAddress(libXmlHandle, 'xmlXPathFreeCompExpr');
+  {$ENDIF} (* LIBXML_XPATH_ENABLED *)
+  {$if defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+    Pointer(xmlXPathInit) := GetProcAddress(libXmlHandle, 'xmlXPathInit');
+    Pointer(xmlXPathIsNaN) := GetProcAddress(libXmlHandle, 'xmlXPathIsNaN');
+    Pointer(xmlXPathIsInf) := GetProcAddress(libXmlHandle, 'xmlXPathIsInf');
+  {$ENDIF} (* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*)
+
+
+    { xpathInternals.inc }
+  {$IFDEF LIBXML_XPATH_ENABLED}
+    Pointer(xmlXPathRegisterVariableLookup) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterVariableLookup');
+    Pointer(xmlXPathRegisterFuncLookup) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterFuncLookup');
+  //procedure __xmlXPatherror(ctxt
+    Pointer(xmlXPathErr) := GetProcAddress(libXmlHandle, 'xmlXPathErr');
+  {$IFDEF LIBXML_DEBUG_ENABLED}
+    Pointer(xmlXPathDebugDumpObject) := GetProcAddress(libXmlHandle, 'xmlXPathDebugDumpObject');
+    Pointer(xmlXPathDebugDumpCompExpr) := GetProcAddress(libXmlHandle, 'xmlXPathDebugDumpCompExpr');
+  {$ENDIF}
+    Pointer(xmlXPathNodeSetContains) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetContains');
+    Pointer(xmlXPathDifference) := GetProcAddress(libXmlHandle, 'xmlXPathDifference');
+    Pointer(xmlXPathIntersection) := GetProcAddress(libXmlHandle, 'xmlXPathIntersection');
+    Pointer(xmlXPathDistinctSorted) := GetProcAddress(libXmlHandle, 'xmlXPathDistinctSorted');
+    Pointer(xmlXPathDistinct) := GetProcAddress(libXmlHandle, 'xmlXPathDistinct');
+    Pointer(xmlXPathHasSameNodes) := GetProcAddress(libXmlHandle, 'xmlXPathHasSameNodes');
+    Pointer(xmlXPathNodeLeadingSorted) := GetProcAddress(libXmlHandle, 'xmlXPathNodeLeadingSorted');
+    Pointer(xmlXPathLeadingSorted) := GetProcAddress(libXmlHandle, 'xmlXPathLeadingSorted');
+    Pointer(xmlXPathNodeLeading) := GetProcAddress(libXmlHandle, 'xmlXPathNodeLeading');
+    Pointer(xmlXPathLeading) := GetProcAddress(libXmlHandle, 'xmlXPathLeading');
+    Pointer(xmlXPathNodeTrailingSorted) := GetProcAddress(libXmlHandle, 'xmlXPathNodeTrailingSorted');
+    Pointer(xmlXPathTrailingSorted) := GetProcAddress(libXmlHandle, 'xmlXPathTrailingSorted');
+    Pointer(xmlXPathNodeTrailing) := GetProcAddress(libXmlHandle, 'xmlXPathNodeTrailing');
+    Pointer(xmlXPathTrailing) := GetProcAddress(libXmlHandle, 'xmlXPathTrailing');
+    Pointer(xmlXPathRegisterNs) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterNs');
+    Pointer(xmlXPathNsLookup) := GetProcAddress(libXmlHandle, 'xmlXPathNsLookup');
+    Pointer(xmlXPathRegisteredNsCleanup) := GetProcAddress(libXmlHandle, 'xmlXPathRegisteredNsCleanup');
+    Pointer(xmlXPathRegisterFunc) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterFunc');
+    Pointer(xmlXPathRegisterFuncNS) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterFuncNS');
+    Pointer(xmlXPathRegisterVariable) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterVariable');
+    Pointer(xmlXPathRegisterVariableNS) := GetProcAddress(libXmlHandle, 'xmlXPathRegisterVariableNS');
+    Pointer(xmlXPathFunctionLookup) := GetProcAddress(libXmlHandle, 'xmlXPathFunctionLookup');
+    Pointer(xmlXPathFunctionLookupNS) := GetProcAddress(libXmlHandle, 'xmlXPathFunctionLookupNS');
+    Pointer(xmlXPathRegisteredFuncsCleanup) := GetProcAddress(libXmlHandle, 'xmlXPathRegisteredFuncsCleanup');
+    Pointer(xmlXPathVariableLookup) := GetProcAddress(libXmlHandle, 'xmlXPathVariableLookup');
+    Pointer(xmlXPathVariableLookupNS) := GetProcAddress(libXmlHandle, 'xmlXPathVariableLookupNS');
+    Pointer(xmlXPathRegisteredVariablesCleanup) := GetProcAddress(libXmlHandle, 'xmlXPathRegisteredVariablesCleanup');
+    Pointer(xmlXPathNewParserContext) := GetProcAddress(libXmlHandle, 'xmlXPathNewParserContext');
+    Pointer(xmlXPathFreeParserContext) := GetProcAddress(libXmlHandle, 'xmlXPathFreeParserContext');
+    Pointer(valuePop) := GetProcAddress(libXmlHandle, 'valuePop');
+    Pointer(valuePush) := GetProcAddress(libXmlHandle, 'valuePush');
+    Pointer(xmlXPathNewString) := GetProcAddress(libXmlHandle, 'xmlXPathNewString');
+    Pointer(xmlXPathNewCString) := GetProcAddress(libXmlHandle, 'xmlXPathNewCString');
+    Pointer(xmlXPathWrapString) := GetProcAddress(libXmlHandle, 'xmlXPathWrapString');
+    Pointer(xmlXPathWrapCString) := GetProcAddress(libXmlHandle, 'xmlXPathWrapCString');
+    Pointer(xmlXPathNewFloat) := GetProcAddress(libXmlHandle, 'xmlXPathNewFloat');
+    Pointer(xmlXPathNewBoolean) := GetProcAddress(libXmlHandle, 'xmlXPathNewBoolean');
+    Pointer(xmlXPathNewNodeSet) := GetProcAddress(libXmlHandle, 'xmlXPathNewNodeSet');
+    Pointer(xmlXPathNewValueTree) := GetProcAddress(libXmlHandle, 'xmlXPathNewValueTree');
+    Pointer(xmlXPathNodeSetAddUnique) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetAddUnique');
+    Pointer(xmlXPathNodeSetAdd) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetAdd');
+    Pointer(xmlXPathNodeSetAddNs) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetAddNs');
+    Pointer(xmlXPathNodeSetSort) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetSort');
+    Pointer(xmlXPathRoot) := GetProcAddress(libXmlHandle, 'xmlXPathRoot');
+    Pointer(xmlXPathEvalExpr) := GetProcAddress(libXmlHandle, 'xmlXPathEvalExpr');
+    Pointer(xmlXPathParseName) := GetProcAddress(libXmlHandle, 'xmlXPathParseName');
+    Pointer(xmlXPathParseNCName) := GetProcAddress(libXmlHandle, 'xmlXPathParseNCName');
+    Pointer(xmlXPathEqualValues) := GetProcAddress(libXmlHandle, 'xmlXPathEqualValues');
+    Pointer(xmlXPathNotEqualValues) := GetProcAddress(libXmlHandle, 'xmlXPathNotEqualValues');
+    Pointer(xmlXPathCompareValues) := GetProcAddress(libXmlHandle, 'xmlXPathCompareValues');
+    Pointer(xmlXPathValueFlipSign) := GetProcAddress(libXmlHandle, 'xmlXPathValueFlipSign');
+    Pointer(xmlXPathAddValues) := GetProcAddress(libXmlHandle, 'xmlXPathAddValues');
+    Pointer(xmlXPathSubValues) := GetProcAddress(libXmlHandle, 'xmlXPathSubValues');
+    Pointer(xmlXPathMultValues) := GetProcAddress(libXmlHandle, 'xmlXPathMultValues');
+    Pointer(xmlXPathDivValues) := GetProcAddress(libXmlHandle, 'xmlXPathDivValues');
+    Pointer(xmlXPathModValues) := GetProcAddress(libXmlHandle, 'xmlXPathModValues');
+    Pointer(xmlXPathIsNodeType) := GetProcAddress(libXmlHandle, 'xmlXPathIsNodeType');
+    Pointer(xmlXPathNextSelf) := GetProcAddress(libXmlHandle, 'xmlXPathNextSelf');
+    Pointer(xmlXPathNextChild) := GetProcAddress(libXmlHandle, 'xmlXPathNextChild');
+    Pointer(xmlXPathNextDescendant) := GetProcAddress(libXmlHandle, 'xmlXPathNextDescendant');
+    Pointer(xmlXPathNextDescendantOrSelf) := GetProcAddress(libXmlHandle, 'xmlXPathNextDescendantOrSelf');
+    Pointer(xmlXPathNextParent) := GetProcAddress(libXmlHandle, 'xmlXPathNextParent');
+    Pointer(xmlXPathNextAncestorOrSelf) := GetProcAddress(libXmlHandle, 'xmlXPathNextAncestorOrSelf');
+    Pointer(xmlXPathNextFollowingSibling) := GetProcAddress(libXmlHandle, 'xmlXPathNextFollowingSibling');
+    Pointer(xmlXPathNextFollowing) := GetProcAddress(libXmlHandle, 'xmlXPathNextFollowing');
+    Pointer(xmlXPathNextNamespace) := GetProcAddress(libXmlHandle, 'xmlXPathNextNamespace');
+    Pointer(xmlXPathNextAttribute) := GetProcAddress(libXmlHandle, 'xmlXPathNextAttribute');
+    Pointer(xmlXPathNextPreceding) := GetProcAddress(libXmlHandle, 'xmlXPathNextPreceding');
+    Pointer(xmlXPathNextAncestor) := GetProcAddress(libXmlHandle, 'xmlXPathNextAncestor');
+    Pointer(xmlXPathNextPrecedingSibling) := GetProcAddress(libXmlHandle, 'xmlXPathNextPrecedingSibling');
+    Pointer(xmlXPathLastFunction) := GetProcAddress(libXmlHandle, 'xmlXPathLastFunction');
+    Pointer(xmlXPathPositionFunction) := GetProcAddress(libXmlHandle, 'xmlXPathPositionFunction');
+    Pointer(xmlXPathCountFunction) := GetProcAddress(libXmlHandle, 'xmlXPathCountFunction');
+    Pointer(xmlXPathIdFunction) := GetProcAddress(libXmlHandle, 'xmlXPathIdFunction');
+    Pointer(xmlXPathLocalNameFunction) := GetProcAddress(libXmlHandle, 'xmlXPathLocalNameFunction');
+    Pointer(xmlXPathNamespaceURIFunction) := GetProcAddress(libXmlHandle, 'xmlXPathNamespaceURIFunction');
+    Pointer(xmlXPathStringFunction) := GetProcAddress(libXmlHandle, 'xmlXPathStringFunction');
+    Pointer(xmlXPathStringLengthFunction) := GetProcAddress(libXmlHandle, 'xmlXPathStringLengthFunction');
+    Pointer(xmlXPathConcatFunction) := GetProcAddress(libXmlHandle, 'xmlXPathConcatFunction');
+    Pointer(xmlXPathContainsFunction) := GetProcAddress(libXmlHandle, 'xmlXPathContainsFunction');
+    Pointer(xmlXPathStartsWithFunction) := GetProcAddress(libXmlHandle, 'xmlXPathStartsWithFunction');
+    Pointer(xmlXPathSubstringFunction) := GetProcAddress(libXmlHandle, 'xmlXPathSubstringFunction');
+    Pointer(xmlXPathSubstringBeforeFunction) := GetProcAddress(libXmlHandle, 'xmlXPathSubstringBeforeFunction');
+    Pointer(xmlXPathSubstringAfterFunction) := GetProcAddress(libXmlHandle, 'xmlXPathSubstringAfterFunction');
+    Pointer(xmlXPathNormalizeFunction) := GetProcAddress(libXmlHandle, 'xmlXPathNormalizeFunction');
+    Pointer(xmlXPathTranslateFunction) := GetProcAddress(libXmlHandle, 'xmlXPathTranslateFunction');
+    Pointer(xmlXPathNotFunction) := GetProcAddress(libXmlHandle, 'xmlXPathNotFunction');
+    Pointer(xmlXPathTrueFunction) := GetProcAddress(libXmlHandle, 'xmlXPathTrueFunction');
+    Pointer(xmlXPathFalseFunction) := GetProcAddress(libXmlHandle, 'xmlXPathFalseFunction');
+    Pointer(xmlXPathLangFunction) := GetProcAddress(libXmlHandle, 'xmlXPathLangFunction');
+    Pointer(xmlXPathNumberFunction) := GetProcAddress(libXmlHandle, 'xmlXPathNumberFunction');
+    Pointer(xmlXPathSumFunction) := GetProcAddress(libXmlHandle, 'xmlXPathSumFunction');
+    Pointer(xmlXPathFloorFunction) := GetProcAddress(libXmlHandle, 'xmlXPathFloorFunction');
+    Pointer(xmlXPathCeilingFunction) := GetProcAddress(libXmlHandle, 'xmlXPathCeilingFunction');
+    Pointer(xmlXPathRoundFunction) := GetProcAddress(libXmlHandle, 'xmlXPathRoundFunction');
+    Pointer(xmlXPathBooleanFunction) := GetProcAddress(libXmlHandle, 'xmlXPathBooleanFunction');
+    Pointer(xmlXPathNodeSetFreeNs) := GetProcAddress(libXmlHandle, 'xmlXPathNodeSetFreeNs');
+  {$ENDIF} (* LIBXML_XPATH_ENABLED *)
+
+    { xlink.inc }
+  {$IFDEF LIBXML_XPTR_ENABLED}
+    Pointer(xlinkGetDefaultDetect) := GetProcAddress(libXmlHandle, 'xlinkGetDefaultDetect');
+    Pointer(xlinkSetDefaultDetect) := GetProcAddress(libXmlHandle, 'xlinkSetDefaultDetect');
+    Pointer(xlinkGetDefaultHandler) := GetProcAddress(libXmlHandle, 'xlinkGetDefaultHandler');
+    Pointer(xlinkSetDefaultHandler) := GetProcAddress(libXmlHandle, 'xlinkSetDefaultHandler');
+    Pointer(xlinkIsLink) := GetProcAddress(libXmlHandle, 'xlinkIsLink');
+  {$ENDIF} (* LIBXML_XPTR_ENABLED *)
+
+    { xinclude.inc }
+  {$IFDEF LIBXML_XINCLUDE_ENABLED}
+    Pointer(xmlXIncludeProcess) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcess');
+    Pointer(xmlXIncludeProcessFlags) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessFlags');
+    Pointer(xmlXIncludeProcessFlagsData) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessFlagsData');
+    Pointer(xmlXIncludeProcessTreeFlagsData) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessTreeFlagsData');
+    Pointer(xmlXIncludeProcessTree) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessTree');
+    Pointer(xmlXIncludeProcessTreeFlags) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessTreeFlags');
+    Pointer(xmlXIncludeNewContext) := GetProcAddress(libXmlHandle, 'xmlXIncludeNewContext');
+    Pointer(xmlXIncludeSetFlags) := GetProcAddress(libXmlHandle, 'xmlXIncludeSetFlags');
+    Pointer(xmlXIncludeFreeContext) := GetProcAddress(libXmlHandle, 'xmlXIncludeFreeContext');
+    Pointer(xmlXIncludeProcessNode) := GetProcAddress(libXmlHandle, 'xmlXIncludeProcessNode');
+  {$ENDIF} (* LIBXML_XINCLUDE_ENABLED *)
+
+    { xpointer.inc }
+  {$IFDEF LIBXML_XPTR_ENABLED}
+    Pointer(xmlXPtrLocationSetCreate) := GetProcAddress(libXmlHandle, 'xmlXPtrLocationSetCreate');
+    Pointer(xmlXPtrFreeLocationSet) := GetProcAddress(libXmlHandle, 'xmlXPtrFreeLocationSet');
+    Pointer(xmlXPtrLocationSetMerge) := GetProcAddress(libXmlHandle, 'xmlXPtrLocationSetMerge');
+    Pointer(xmlXPtrNewRange) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRange');
+    Pointer(xmlXPtrNewRangePoints) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRangePoints');
+    Pointer(xmlXPtrNewRangeNodePoint) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRangeNodePoint');
+    Pointer(xmlXPtrNewRangePointNode) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRangePointNode');
+    Pointer(xmlXPtrNewRangeNodes) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRangeNodes');
+    Pointer(xmlXPtrNewLocationSetNodes) := GetProcAddress(libXmlHandle, 'xmlXPtrNewLocationSetNodes');
+    Pointer(xmlXPtrNewLocationSetNodeSet) := GetProcAddress(libXmlHandle, 'xmlXPtrNewLocationSetNodeSet');
+    Pointer(xmlXPtrNewRangeNodeObject) := GetProcAddress(libXmlHandle, 'xmlXPtrNewRangeNodeObject');
+    Pointer(xmlXPtrNewCollapsedRange) := GetProcAddress(libXmlHandle, 'xmlXPtrNewCollapsedRange');
+    Pointer(xmlXPtrLocationSetAdd) := GetProcAddress(libXmlHandle, 'xmlXPtrLocationSetAdd');
+    Pointer(xmlXPtrWrapLocationSet) := GetProcAddress(libXmlHandle, 'xmlXPtrWrapLocationSet');
+    Pointer(xmlXPtrLocationSetDel) := GetProcAddress(libXmlHandle, 'xmlXPtrLocationSetDel');
+    Pointer(xmlXPtrLocationSetRemove) := GetProcAddress(libXmlHandle, 'xmlXPtrLocationSetRemove');
+    Pointer(xmlXPtrNewContext) := GetProcAddress(libXmlHandle, 'xmlXPtrNewContext');
+    Pointer(xmlXPtrEval) := GetProcAddress(libXmlHandle, 'xmlXPtrEval');
+    Pointer(xmlXPtrRangeToFunction) := GetProcAddress(libXmlHandle, 'xmlXPtrRangeToFunction');
+    Pointer(xmlXPtrBuildNodeList) := GetProcAddress(libXmlHandle, 'xmlXPtrBuildNodeList');
+    Pointer(xmlXPtrEvalRangePredicate) := GetProcAddress(libXmlHandle, 'xmlXPtrEvalRangePredicate');
+  {$ENDIF} (* LIBXML_XPTR_ENABLED *)
+
+    SetExceptionMask([exInvalidOp,exDenormalized,exZeroDivide,exOverflow,exUnderflow,exPrecision]);
+
+  (*
+   * overloading the memory functions
+   *)
+    if InstallFpcMemFunc then
+      xmlMemSetup(@fpcxmlFree, @fpcxmlMalloc, @fpcxmlRealloc, @fpcxmlStrdup);
+
+  (*
+   * this initialize the library and check potential ABI mismatches
+   * between the version it was compiled for and the actual shared
+   * library used.
+   *)
+    mask:=GetExceptionMask;
+    SetExceptionMask([exInvalidOp,exDenormalized,exZeroDivide,exOverflow,exUnderflow,exPrecision]);
+
+    LIBXML_TEST_VERSION;
+
+    SetExceptionMask(mask);
+
+  (*
+   * overloading the error functions
+   *)
+    //xmlSetGenericErrorFunc(nil, @fpcxmlGenericErrorHandler);
+    //xmlSetStructuredErrorFunc(nil, @fpcxmlStructuredErrorHandler);
+    Result := True;
+  end
+  else
+    Result := False;
+end;
+
+procedure FreeLibXML;
+begin
+  if libXmlHandle = NilHandle then
+    Exit;
+
+  if xmlCleanupParser <> nil then
+    xmlCleanupParser();
+
+  FreeLibrary(libXmlHandle);
+  libXmlHandle := NilHandle;
+
+{$IFDEF NIL_FUNCVARS_ON_FREE}
+  { xmlregexp.inc }
+  {__emptyExp := nil;
+  __forbiddenExp := nil;}
+
+  { paserInternals.inc }
+  //__xmlParserMaxDepth := nil;
+
+  {  }
+  {xmlStringComment := nil;
+  xmlStringText := nil;
+  xmlStringTextNoenc := nil;}
+
+  { chvalid.inc }
+  __xmlIsBaseCharGroup := nil;
+  __xmlIsCharGroup := nil;
+  __xmlIsCombiningGroup := nil;
+  __xmlIsDigitGroup := nil;
+  __xmlIsExtenderGroup := nil;
+  __xmlIsIdeographicGroup := nil;
+  __xmlIsPubidChar_tab := nil;
+
+  { globals.inc }
+  varxmlMalloc := nil;
+  varxmlMallocAtomic := nil;
+  varxmlRealloc := nil;
+  varxmlFree := nil;
+  varxmlMemStrdup := nil;
+
+  { xpath.inc }
+  {__xmlXPathNAN := nil;
+  __xmlXPathNINF := nil;
+  __xmlXPathPINF := nil;}
+
+
+  { xmlversion.inc }
+  xmlCheckVersion := nil;
+
+  { catalog.inc }
+{$IFDEF LIBXML_CATALOG_ENABLED}
+  xmlNewCatalog := nil;
+  xmlLoadACatalog := nil;
+  xmlLoadSGMLSuperCatalog := nil;
+  xmlConvertSGMLCatalog := nil;
+  //xmlLoadACatalog
+  xmlACatalogAdd := nil;
+  xmlACatalogRemove := nil;
+  xmlACatalogResolve := nil;
+  xmlACatalogResolveSystem := nil;
+  xmlACatalogResolvePublic := nil;
+  xmlACatalogResolveURI := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlACatalogDump := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlFreeCatalog := nil;
+  xmlCatalogIsEmpty := nil;
+  xmlInitializeCatalog := nil;
+  xmlLoadCatalog := nil;
+  xmlLoadCatalogs := nil;
+  xmlCatalogCleanup := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlCatalogDump := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlCatalogResolve := nil;
+  xmlCatalogResolveSystem := nil;
+  xmlCatalogResolvePublic := nil;
+  xmlCatalogResolveURI := nil;
+  xmlCatalogAdd := nil;
+  xmlCatalogRemove := nil;
+  xmlParseCatalogFile := nil;
+  xmlCatalogConvert := nil;
+  xmlCatalogFreeLocal := nil;
+  xmlCatalogAddLocal := nil;
+  xmlCatalogLocalResolve := nil;
+  xmlCatalogLocalResolveURI := nil;
+  xmlCatalogSetDebug := nil;
+  xmlCatalogSetDefaultPrefer := nil;
+  xmlCatalogSetDefaults := nil;
+  xmlCatalogGetDefaults := nil;
+{$ENDIF} (* LIBXML_CATALOG_ENABLED *)
+
+  { chvalid.inc }
+  xmlCharInRange := nil;
+  xmlIsBaseChar := nil;
+  xmlIsBlank := nil;
+  xmlIsChar := nil;
+  xmlIsCombining := nil;
+  xmlIsDigit := nil;
+  xmlIsExtender := nil;
+  xmlIsIdeographic := nil;
+  xmlIsPubidChar := nil;
+
+  { dict.inc }
+  xmlInitializeDict := nil;
+  xmlDictCreate := nil;
+  xmlDictSetLimit := nil;
+  xmlDictGetUsage := nil;
+  xmlDictCreateSub := nil;
+  xmlDictReference := nil;
+  xmlDictFree := nil;
+  xmlDictLookup := nil;
+  xmlDictExists := nil;
+  xmlDictQLookup := nil;
+  xmlDictOwns := nil;
+  xmlDictSize := nil;
+  xmlDictCleanup := nil;
+
+  { encoding.inc }
+  xmlInitCharEncodingHandlers := nil;
+  xmlCleanupCharEncodingHandlers := nil;
+  xmlRegisterCharEncodingHandler := nil;
+  xmlGetCharEncodingHandler := nil;
+  xmlFindCharEncodingHandler := nil;
+  xmlNewCharEncodingHandler := nil;
+  xmlAddEncodingAlias := nil;
+  xmlDelEncodingAlias := nil;
+  xmlGetEncodingAlias := nil;
+  xmlCleanupEncodingAliases := nil;
+  xmlParseCharEncoding := nil;
+  xmlGetCharEncodingName := nil;
+  xmlDetectCharEncoding := nil;
+  xmlCharEncOutFunc := nil;
+  xmlCharEncInFunc := nil;
+  xmlCharEncFirstLine := nil;
+  xmlCharEncCloseFunc := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  UTF8Toisolat1 := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  isolat1ToUTF8 := nil;
+
+  { tree.inc }
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or
+  defined(LIBXML_DEBUG_ENABLED) or defined (LIBXML_HTML_ENABLED) or defined(LIBXML_SAX1_ENABLED) or
+  defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+  xmlValidateNCName := nil;
+{$ENDIF}
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlValidateQName := nil;
+  xmlValidateName := nil;
+  xmlValidateNMToken := nil;
+{$ENDIF}
+  xmlBuildQName := nil;
+  xmlSplitQName2 := nil;
+  xmlSplitQName3 := nil;
+  xmlSetBufferAllocationScheme := nil;
+  xmlGetBufferAllocationScheme := nil;
+  xmlBufferCreate := nil;
+  xmlBufferCreateSize := nil;
+  xmlBufferCreateStatic := nil;
+  xmlBufferResize := nil;
+  xmlBufferFree := nil;
+  xmlBufferDump := nil;
+  xmlBufferAdd := nil;
+  xmlBufferAddHead := nil;
+  xmlBufferCat := nil;
+  xmlBufferCCat := nil;
+  xmlBufferShrink := nil;
+  xmlBufferGrow := nil;
+  xmlBufferEmpty := nil;
+  xmlBufferContent := nil;
+  xmlBufferDetach := nil;
+  xmlBufferSetAllocationScheme := nil;
+  xmlBufferLength := nil;
+  xmlCreateIntSubset := nil;
+  xmlNewDtd := nil;
+  xmlGetIntSubset := nil;
+  xmlFreeDtd := nil;
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlNewGlobalNs := nil;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlNewNs := nil;
+  xmlFreeNs := nil;
+  xmlFreeNsList := nil;
+  xmlNewDoc := nil;
+  xmlFreeDoc := nil;
+  xmlNewDocProp := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlNewProp := nil;
+{$ENDIF}
+  xmlNewNsProp := nil;
+  xmlNewNsPropEatName := nil;
+  xmlFreePropList := nil;
+  xmlFreeProp := nil;
+  xmlCopyProp := nil;
+  xmlCopyPropList := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyDtd := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlCopyDoc := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+  xmlNewDocNode := nil;
+  xmlNewDocNodeEatName := nil;
+  xmlNewNode := nil;
+  xmlNewNodeEatName := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlNewChild := nil;
+{$ENDIF}
+  xmlNewDocText := nil;
+  xmlNewText := nil;
+  xmlNewDocPI := nil;
+  xmlNewPI := nil;
+  xmlNewDocTextLen := nil;
+  xmlNewTextLen := nil;
+  xmlNewDocComment := nil;
+  xmlNewComment := nil;
+  xmlNewCDataBlock := nil;
+  xmlNewCharRef := nil;
+  xmlNewReference := nil;
+  xmlCopyNode := nil;
+  xmlDocCopyNode := nil;
+  xmlDocCopyNodeList := nil;
+  xmlCopyNodeList := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNewTextChild := nil;
+  xmlNewDocRawNode := nil;
+  xmlNewDocFragment := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlGetLineNo := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_DEBUG_ENABLED)}
+  xmlGetNodePath := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) *)
+  xmlDocGetRootElement := nil;
+  xmlGetLastChild := nil;
+  xmlNodeIsText := nil;
+  xmlIsBlankNode := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+  xmlDocSetRootElement := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetName := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlAddChild := nil;
+  xmlAddChildList := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_WRITER_ENABLED)}
+  xmlReplaceNode := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) *)
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlAddPrevSibling := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED *)
+  xmlAddSibling := nil;
+  xmlAddNextSibling := nil;
+  xmlUnlinkNode := nil;
+  xmlTextMerge := nil;
+  xmlTextConcat := nil;
+  xmlFreeNodeList := nil;
+  xmlFreeNode := nil;
+  xmlSetTreeDoc := nil;
+  xmlSetListDoc := nil;
+  xmlSearchNs := nil;
+  xmlSearchNsByHref := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlGetNsList := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) *)
+  xmlSetNs := nil;
+  xmlCopyNamespace := nil;
+  xmlCopyNamespaceList := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED) or defined(LIBXML_HTML_ENABLED)}
+  xmlSetProp := nil;
+  xmlSetNsProp := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) *)
+  xmlGetNoNsProp := nil;
+  xmlGetProp := nil;
+  xmlHasProp := nil;
+  xmlHasNsProp := nil;
+  xmlGetNsProp := nil;
+  xmlStringGetNodeList := nil;
+  xmlStringLenGetNodeList := nil;
+  xmlNodeListGetString := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeListGetRawString := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeSetContent := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetContentLen := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeAddContent := nil;
+  xmlNodeAddContentLen := nil;
+  xmlNodeGetContent := nil;
+  xmlNodeBufGetContent := nil;
+  xmlNodeGetLang := nil;
+  xmlNodeGetSpacePreserve := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlNodeSetLang := nil;
+  xmlNodeSetSpacePreserve := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlNodeGetBase := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_XINCLUDE_ENABLED)}
+  xmlNodeSetBase := nil;
+{$ENDIF}
+  xmlRemoveProp := nil;
+{$IF defined(LIBXML_TREE_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlUnsetNsProp := nil;
+  xmlUnsetProp := nil;
+{$ENDIF} (* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) *)
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlReconciliateNs := nil;
+{$ENDIF}
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDocDumpFormatMemory := nil;
+  xmlDocDumpMemory := nil;
+  xmlDocDumpMemoryEnc := nil;
+  xmlDocDumpFormatMemoryEnc := nil;
+  xmlDocFormatDump := nil;
+  xmlDocDump := nil;
+  xmlElemDump := nil;
+  xmlSaveFormatFile := nil;
+  xmlSaveFile := nil;
+  xmlBufNodeDump := nil;
+  xmlNodeDump := nil;
+  xmlSaveFileTo := nil;
+  xmlSaveFormatFileTo := nil;
+  xmlNodeDumpOutput := nil;
+  xmlSaveFormatFileEnc := nil;
+  xmlSaveFileEnc := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlIsXHTML := nil;
+  xmlGetDocCompressMode := nil;
+  xmlSetDocCompressMode := nil;
+  xmlGetCompressMode := nil;
+  xmlSetCompressMode := nil;
+  xmlDOMWrapNewCtxt := nil;
+  xmlDOMWrapFreeCtxt := nil;
+  xmlDOMWrapReconcileNamespaces := nil;
+  xmlDOMWrapAdoptNode := nil;
+  xmlDOMWrapRemoveNode := nil;
+  xmlDOMWrapCloneNode := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlChildElementCount := nil;
+  xmlNextElementSibling := nil;
+  xmlFirstElementChild := nil;
+  xmlLastElementChild := nil;
+  xmlPreviousElementSibling := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+
+  { list.inc }
+  xmlListCreate := nil;
+  xmlListDelete := nil;
+  xmlListSearch := nil;
+  xmlListReverseSearch := nil;
+  xmlListInsert := nil;
+  xmlListAppend := nil;
+  xmlListRemoveFirst := nil;
+  xmlListRemoveLast := nil;
+  xmlListRemoveAll := nil;
+  xmlListClear := nil;
+  xmlListEmpty := nil;
+  xmlListFront := nil;
+  xmlListEnd := nil;
+  xmlListSize := nil;
+  xmlListPopFront := nil;
+  xmlListPopBack := nil;
+  xmlListPushFront := nil;
+  xmlListPushBack := nil;
+  xmlListReverse := nil;
+  xmlListSort := nil;
+  xmlListWalk := nil;
+  xmlListReverseWalk := nil;
+  xmlListMerge := nil;
+  xmlListDup := nil;
+  xmlListCopy := nil;
+  xmlLinkGetData := nil;
+
+  { entities.inc }
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlInitializePredefinedEntities := nil;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlNewEntity := nil;
+  xmlAddDocEntity := nil;
+  xmlAddDtdEntity := nil;
+  xmlGetPredefinedEntity := nil;
+  xmlGetDocEntity := nil;
+  xmlGetDtdEntity := nil;
+  xmlGetParameterEntity := nil;
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlEncodeEntities := nil;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+  xmlEncodeEntitiesReentrant := nil;
+  xmlEncodeSpecialChars := nil;
+  xmlCreateEntitiesTable := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyEntitiesTable := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeEntitiesTable := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpEntitiesTable := nil;
+  xmlDumpEntityDecl := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlCleanupPredefinedEntities := nil;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+
+  { xmlerror.inc }
+  xmlSetGenericErrorFunc := nil;
+  initGenericErrorDefaultFunc := nil;
+  xmlSetStructuredErrorFunc := nil;
+  xmlParserError := nil;
+  xmlParserWarning := nil;
+  xmlParserValidityError := nil;
+  xmlParserValidityWarning := nil;
+  xmlParserPrintFileInfo := nil;
+  xmlParserPrintFileContext := nil;
+  xmlGetLastError := nil;
+  xmlResetLastError := nil;
+  xmlCtxtGetLastError := nil;
+  xmlCtxtResetLastError := nil;
+  xmlResetError := nil;
+  xmlCopyError := nil;
+  __xmlRaiseError := nil;
+  __xmlSimpleError := nil;
+
+  { xmlmemory.inc }
+  xmlMemSetup := nil;
+  xmlMemGet := nil;
+  xmlGcMemSetup := nil;
+  xmlGcMemGet := nil;
+  xmlInitMemory := nil;
+  xmlCleanupMemory := nil;
+  xmlMemUsed := nil;
+  xmlMemBlocks := nil;
+  xmlMemDisplay := nil;
+  xmlMemDisplayLast := nil;
+  xmlMemShow := nil;
+  xmlMemoryDump := nil;
+  xmlMemMalloc := nil;
+  xmlMemRealloc := nil;
+  xmlMemFree := nil;
+  xmlMemoryStrdup := nil;
+  xmlMallocLoc := nil;
+  xmlReallocLoc := nil;
+  xmlMallocAtomicLoc := nil;
+  xmlMemStrdupLoc := nil;
+
+  { pattern.inc }
+{$IFDEF LIBXML_PATTERN_ENABLED}
+  xmlFreePattern := nil;
+  xmlFreePatternList := nil;
+  xmlPatterncompile := nil;
+  xmlPatternMatch := nil;
+  xmlPatternStreamable := nil;
+  xmlPatternMaxDepth := nil;
+  xmlPatternMinDepth := nil;
+  xmlPatternFromRoot := nil;
+  xmlPatternGetStreamCtxt := nil;
+  xmlFreeStreamCtxt := nil;
+  xmlStreamPushNode := nil;
+  xmlStreamPush := nil;
+  xmlStreamPushAttr := nil;
+  xmlStreamPop := nil;
+  xmlStreamWantsAnyNode := nil;
+{$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+
+  { schemasInternals.inc }
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+  xmlSchemaFreeType := nil;
+  xmlSchemaFreeWildcard := nil;
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+  { hash.inc }
+  xmlHashCreate := nil;
+  xmlHashCreateDict := nil;
+  xmlHashFree := nil;
+  xmlHashDefaultDeallocator := nil;
+  xmlHashAddEntry := nil;
+  xmlHashUpdateEntry := nil;
+  xmlHashAddEntry2 := nil;
+  xmlHashUpdateEntry2 := nil;
+  xmlHashAddEntry3 := nil;
+  xmlHashUpdateEntry3 := nil;
+  xmlHashRemoveEntry := nil;
+  xmlHashRemoveEntry2 := nil;
+  xmlHashRemoveEntry3 := nil;
+  xmlHashLookup := nil;
+  xmlHashLookup2 := nil;
+  xmlHashLookup3 := nil;
+  xmlHashQLookup := nil;
+  xmlHashQLookup2 := nil;
+  xmlHashQLookup3 := nil;
+  xmlHashCopy := nil;
+  xmlHashSize := nil;
+  xmlHashScan := nil;
+  xmlHashScan3 := nil;
+  xmlHashScanFull := nil;
+  xmlHashScanFull3 := nil;
+
+  { valid.inc }
+  xmlAddNotationDecl := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyNotationTable := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeNotationTable := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpNotationDecl := nil;
+  xmlDumpNotationTable := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlNewDocElementContent := nil;
+  xmlCopyDocElementContent := nil;
+  xmlFreeDocElementContent := nil;
+  xmlSnprintfElementContent := nil;
+  xmlAddElementDecl := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyElementTable := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeElementTable := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpElementTable := nil;
+  xmlDumpElementDecl := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlCreateEnumeration := nil;
+  xmlFreeEnumeration := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyEnumeration := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlAddAttributeDecl := nil;
+{$IFDEF LIBXML_TREE_ENABLED}
+  xmlCopyAttributeTable := nil;
+{$ENDIF} (* LIBXML_TREE_ENABLED *)
+  xmlFreeAttributeTable := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlDumpAttributeTable := nil;
+  xmlDumpAttributeDecl := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlAddID := nil;
+  xmlFreeIDTable := nil;
+  xmlGetID := nil;
+  xmlIsID := nil;
+  xmlRemoveID := nil;
+  xmlAddRef := nil;
+  xmlFreeRefTable := nil;
+  xmlIsRef := nil;
+  xmlRemoveRef := nil;
+  xmlGetRefs := nil;
+{$IFDEF LIBXML_VALID_ENABLED}
+  xmlNewValidCtxt := nil;
+  xmlFreeValidCtxt := nil;
+  xmlValidateRoot := nil;
+  xmlValidateElementDecl := nil;
+  xmlValidNormalizeAttributeValue := nil;
+  xmlValidCtxtNormalizeAttributeValue := nil;
+  xmlValidateAttributeDecl := nil;
+  xmlValidateAttributeValue := nil;
+  xmlValidateNotationDecl := nil;
+  xmlValidateDtd := nil;
+  xmlValidateDtdFinal := nil;
+  xmlValidateDocument := nil;
+  xmlValidateElement := nil;
+  xmlValidateOneElement := nil;
+  xmlValidateOneAttribute := nil;
+  xmlValidateOneNamespace := nil;
+  xmlValidateDocumentFinal := nil;
+{$ENDIF} (* LIBXML_VALID_ENABLED *)
+{$IF defined(LIBXML_VALID_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlValidateNotationUse := nil;
+{$ENDIF} (* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED *)
+  xmlIsMixedElement := nil;
+  xmlGetDtdAttrDesc := nil;
+  xmlGetDtdQAttrDesc := nil;
+  xmlGetDtdNotationDesc := nil;
+  xmlGetDtdQElementDesc := nil;
+  xmlGetDtdElementDesc := nil;
+{$IFDEF LIBXML_VALID_ENABLED}
+  xmlValidGetPotentialChildren := nil;
+  xmlValidGetValidElements := nil;
+  xmlValidateNameValue := nil;
+  xmlValidateNamesValue := nil;
+  xmlValidateNmtokenValue := nil;
+  xmlValidateNmtokensValue := nil;
+{$IFDEF LIBXML_REGEXP_ENABLED}
+  xmlValidBuildContentModel := nil;
+  xmlValidatePushElement := nil;
+  xmlValidatePushCData := nil;
+  xmlValidatePopElement := nil;
+{$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+{$ENDIF} (* LIBXML_VALID_ENABLED *)
+
+  { libxmlparser.inc }
+  xmlInitParser := nil;
+  xmlCleanupParser := nil;
+  xmlParserInputRead := nil;
+  xmlParserInputGrow := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseDoc := nil;
+  xmlParseFile := nil;
+  xmlParseMemory := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlSubstituteEntitiesDefault := nil;
+  xmlKeepBlanksDefault := nil;
+  xmlStopParser := nil;
+  xmlPedanticParserDefault := nil;
+  xmlLineNumbersDefault := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlRecoverDoc := nil;
+  xmlRecoverMemory := nil;
+  xmlRecoverFile := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlParseDocument := nil;
+  xmlParseExtParsedEnt := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSAXUserParseFile := nil;
+  xmlSAXUserParseMemory := nil;
+  xmlSAXParseDoc := nil;
+  xmlSAXParseMemory := nil;
+  xmlSAXParseMemoryWithData := nil;
+  xmlSAXParseFile := nil;
+  xmlSAXParseFileWithData := nil;
+  xmlSAXParseEntity := nil;
+  xmlParseEntity := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+{$IFDEF LIBXML_VALID_ENABLED}
+  xmlSAXParseDTD := nil;
+  xmlParseDTD := nil;
+  xmlIOParseDTD := nil;
+{$ENDIF} (* LIBXML_VALID_ENABLE *)
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseBalancedChunkMemory := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlParseInNodeContext := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlParseBalancedChunkMemoryRecover := nil;
+  xmlParseExternalEntity := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlParseCtxtExternalEntity := nil;
+  xmlNewParserCtxt := nil;
+  xmlInitParserCtxt := nil;
+  xmlClearParserCtxt := nil;
+  xmlFreeParserCtxt := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSetupParserForBuffer := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlCreateDocParserCtxt := nil;
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  xmlGetFeaturesList := nil;
+  xmlGetFeature := nil;
+  xmlSetFeature := nil;
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+{$IFDEF LIBXML_PUSH_ENABLED}
+  xmlCreatePushParserCtxt := nil;
+  xmlParseChunk := nil;
+{$ENDIF} (* LIBXML_PUSH_ENABLED *)
+  xmlCreateIOParserCtxt := nil;
+  xmlNewIOInputStream := nil;
+  xmlParserFindNodeInfo := nil;
+  xmlInitNodeInfoSeq := nil;
+  xmlClearNodeInfoSeq := nil;
+  xmlParserFindNodeInfoIndex := nil;
+  xmlParserAddNodeInfo := nil;
+  xmlSetExternalEntityLoader := nil;
+  xmlGetExternalEntityLoader := nil;
+  xmlLoadExternalEntity := nil;
+  xmlByteConsumed := nil;
+  xmlCtxtReset := nil;
+  xmlCtxtResetPush := nil;
+  xmlCtxtUseOptions := nil;
+  xmlReadDoc := nil;
+  xmlReadFile := nil;
+  xmlReadMemory := nil;
+  xmlReadFd := nil;
+  xmlReadIO := nil;
+  xmlCtxtReadDoc := nil;
+  xmlCtxtReadFile := nil;
+  xmlCtxtReadMemory := nil;
+  xmlCtxtReadFd := nil;
+  xmlCtxtReadIO := nil;
+  xmlHasFeature := nil;
+
+  { schematron.inc }
+{$IFDEF LIBXML_SCHEMATRON_ENABLED}
+  xmlSchematronNewParserCtxt := nil;
+  xmlSchematronNewMemParserCtxt := nil;
+  xmlSchematronNewDocParserCtxt := nil;
+  xmlSchematronFreeParserCtxt := nil;
+  xmlSchematronParse := nil;
+  xmlSchematronFree := nil;
+  xmlSchematronSetValidStructuredErrors := nil;
+  xmlSchematronNewValidCtxt := nil;
+  xmlSchematronFreeValidCtxt := nil;
+  xmlSchematronValidateDoc := nil;
+{$ENDIF} (* LIBXML_SCHEMATRON_ENABLED *)
+
+  { threads.inc }
+  xmlNewMutex := nil;
+  xmlMutexLock := nil;
+  xmlMutexUnlock := nil;
+  xmlFreeMutex := nil;
+  xmlNewRMutex := nil;
+  xmlRMutexLock := nil;
+  xmlRMutexUnlock := nil;
+  xmlFreeRMutex := nil;
+  xmlInitThreads := nil;
+  xmlLockLibrary := nil;
+  xmlUnlockLibrary := nil;
+  xmlGetThreadId := nil;
+  xmlIsMainThread := nil;
+  xmlCleanupThreads := nil;
+  xmlGetGlobalState := nil;
+
+  { uri.inc }
+  xmlCreateURI := nil;
+  xmlBuildURI := nil;
+  xmlBuildRelativeURI := nil;
+  xmlParseURI := nil;
+  xmlParseURIRaw := nil;
+  xmlParseURIReference := nil;
+  xmlSaveUri := nil;
+  xmlPrintURI := nil;
+  xmlURIEscapeStr := nil;
+  xmlURIUnescapeString := nil;
+  xmlNormalizeURIPath := nil;
+  xmlURIEscape := nil;
+  xmlFreeURI := nil;
+  xmlCanonicPath := nil;
+  xmlPathToURI := nil;
+
+  { relaxng.inc }
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+  xmlRelaxNGInitTypes := nil;
+  xmlRelaxNGCleanupTypes := nil;
+  xmlRelaxNGNewParserCtxt := nil;
+  xmlRelaxNGNewMemParserCtxt := nil;
+  xmlRelaxNGNewDocParserCtxt := nil;
+  xmlRelaxParserSetFlag := nil;
+  xmlRelaxNGFreeParserCtxt := nil;
+  xmlRelaxNGSetParserErrors := nil;
+  xmlRelaxNGGetParserErrors := nil;
+  xmlRelaxNGSetParserStructuredErrors := nil;
+  xmlRelaxNGParse := nil;
+  xmlRelaxNGFree := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlRelaxNGDump := nil;
+  xmlRelaxNGDumpTree := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlRelaxNGSetValidErrors := nil;
+  xmlRelaxNGGetValidErrors := nil;
+  xmlRelaxNGSetValidStructuredErrors := nil;
+  xmlRelaxNGNewValidCtxt := nil;
+  xmlRelaxNGFreeValidCtxt := nil;
+  xmlRelaxNGValidateDoc := nil;
+  xmlRelaxNGValidatePushElement := nil;
+  xmlRelaxNGValidatePushCData := nil;
+  xmlRelaxNGValidatePopElement := nil;
+  xmlRelaxNGValidateFullElement := nil;
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+  { globals.inc }
+  xmlInitGlobals := nil;
+  xmlCleanupGlobals := nil;
+  xmlParserInputBufferCreateFilenameDefault := nil;
+  xmlOutputBufferCreateFilenameDefault := nil;
+  xmlInitializeGlobalState := nil;
+  xmlThrDefSetGenericErrorFunc := nil;
+  xmlThrDefSetStructuredErrorFunc := nil;
+  xmlRegisterNodeDefault := nil;
+  xmlThrDefRegisterNodeDefault := nil;
+  xmlDeregisterNodeDefault := nil;
+  xmlThrDefDeregisterNodeDefault := nil;
+  xmlThrDefOutputBufferCreateFilenameDefault := nil;
+  xmlThrDefParserInputBufferCreateFilenameDefault := nil;
+  __docbDefaultSAXHandler := nil;
+  __htmlDefaultSAXHandler := nil;
+  __xmlLastError := nil;
+  __oldXMLWDcompatibility := nil;
+  __xmlBufferAllocScheme := nil;
+  xmlThrDefBufferAllocScheme := nil;
+  __xmlDefaultBufferSize := nil;
+  xmlThrDefDefaultBufferSize := nil;
+  __xmlDefaultSAXHandler := nil;
+  __xmlDefaultSAXLocator := nil;
+  __xmlDoValidityCheckingDefaultValue := nil;
+  xmlThrDefDoValidityCheckingDefaultValue := nil;
+  __xmlGenericError := nil;
+  __xmlStructuredError := nil;
+  __xmlGenericErrorContext := nil;
+  __xmlGetWarningsDefaultValue := nil;
+  xmlThrDefGetWarningsDefaultValue := nil;
+  __xmlIndentTreeOutput := nil;
+  xmlThrDefIndentTreeOutput := nil;
+  __xmlTreeIndentString := nil;
+  xmlThrDefTreeIndentString := nil;
+  __xmlKeepBlanksDefaultValue := nil;
+  xmlThrDefKeepBlanksDefaultValue := nil;
+  __xmlLineNumbersDefaultValue := nil;
+  xmlThrDefLineNumbersDefaultValue := nil;
+  __xmlLoadExtDtdDefaultValue := nil;
+  xmlThrDefLoadExtDtdDefaultValue := nil;
+  __xmlParserDebugEntities := nil;
+  xmlThrDefParserDebugEntities := nil;
+  __xmlParserVersion := nil;
+  __xmlPedanticParserDefaultValue := nil;
+  xmlThrDefPedanticParserDefaultValue := nil;
+  __xmlSaveNoEmptyTags := nil;
+  xmlThrDefSaveNoEmptyTags := nil;
+  __xmlSubstituteEntitiesDefaultValue := nil;
+  xmlThrDefSubstituteEntitiesDefaultValue := nil;
+  __xmlRegisterNodeDefaultValue := nil;
+  __xmlDeregisterNodeDefaultValue := nil;
+  __xmlParserInputBufferCreateFilenameValue := nil;
+  __xmlOutputBufferCreateFilenameValue := nil;
+
+  { nanoftp.inc }
+{$IFDEF LIBXML_FTP_ENABLED}
+  xmlNanoFTPInit := nil;
+  xmlNanoFTPCleanup := nil;
+  xmlNanoFTPNewCtxt := nil;
+  xmlNanoFTPFreeCtxt := nil;
+  xmlNanoFTPConnectTo := nil;
+  xmlNanoFTPOpen := nil;
+  xmlNanoFTPConnect := nil;
+  xmlNanoFTPClose := nil;
+  xmlNanoFTPQuit := nil;
+  xmlNanoFTPScanProxy := nil;
+  xmlNanoFTPProxy := nil;
+  xmlNanoFTPUpdateURL := nil;
+  xmlNanoFTPGetResponse := nil;
+  xmlNanoFTPCheckResponse := nil;
+  xmlNanoFTPCwd := nil;
+  xmlNanoFTPDele := nil;
+  xmlNanoFTPGetConnection := nil;
+  xmlNanoFTPCloseConnection := nil;
+  xmlNanoFTPList := nil;
+  xmlNanoFTPGetSocket := nil;
+  xmlNanoFTPGet := nil;
+  xmlNanoFTPRead := nil;
+{$ENDIF} (* LIBXML_FTP_ENABLED *)
+
+  { nanohttp.inc }
+{$IFDEF LIBXML_HTTP_ENABLED}
+  xmlNanoHTTPInit := nil;
+  xmlNanoHTTPCleanup := nil;
+  xmlNanoHTTPScanProxy := nil;
+  xmlNanoHTTPFetch := nil;
+  xmlNanoHTTPMethod := nil;
+  xmlNanoHTTPMethodRedir := nil;
+  xmlNanoHTTPOpen := nil;
+  xmlNanoHTTPOpenRedir := nil;
+  xmlNanoHTTPReturnCode := nil;
+  xmlNanoHTTPAuthHeader := nil;
+  xmlNanoHTTPRedir := nil;
+  xmlNanoHTTPContentLength := nil;
+  xmlNanoHTTPEncoding := nil;
+  xmlNanoHTTPMimeType := nil;
+  xmlNanoHTTPRead := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlNanoHTTPSave := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlNanoHTTPClose := nil;
+{$ENDIF} (* LIBXML_HTTP_ENABLED *)
+
+  { SAX.inc }
+{$IFDEF LIBXML_LEGACY_ENABLED}
+  getPublicId := nil;
+  getSystemId := nil;
+  setDocumentLocator := nil;
+  getLineNumber := nil;
+  getColumnNumber := nil;
+  isStandalone := nil;
+  hasInternalSubset := nil;
+  hasExternalSubset := nil;
+  internalSubset := nil;
+  externalSubset := nil;
+  getEntity := nil;
+  getParameterEntity := nil;
+  resolveEntity := nil;
+  entityDecl := nil;
+  attributeDecl := nil;
+  elementDecl := nil;
+  notationDecl := nil;
+  unparsedEntityDecl := nil;
+  startDocument := nil;
+  endDocument := nil;
+  attribute := nil;
+  startElement := nil;
+  endElement := nil;
+  reference := nil;
+  characters := nil;
+  ignorableWhitespace := nil;
+  processingInstruction := nil;
+  globalNamespace := nil;
+  setNamespace := nil;
+  getNamespace := nil;
+  checkNamespace := nil;
+  namespaceDecl := nil;
+  comment := nil;
+  cdataBlock := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  initxmlDefaultSAXHandler := nil;
+{$IFDEF LIBXML_HTML_ENABLED}
+  inithtmlDefaultSAXHandler := nil;
+{$ENDIF}
+{$IFDEF LIBXML_DOCB_ENABLED}
+  initdocbDefaultSAXHandler := nil;
+{$ENDIF}
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+{$ENDIF} (* LIBXML_LEGACY_ENABLED *)
+
+  { SAX2.inc }
+  xmlSAX2GetPublicId := nil;
+  xmlSAX2GetSystemId := nil;
+  xmlSAX2SetDocumentLocator := nil;
+  xmlSAX2GetLineNumber := nil;
+  xmlSAX2GetColumnNumber := nil;
+  xmlSAX2IsStandalone := nil;
+  xmlSAX2HasInternalSubset := nil;
+  xmlSAX2HasExternalSubset := nil;
+  xmlSAX2InternalSubset := nil;
+  xmlSAX2ExternalSubset := nil;
+  xmlSAX2GetEntity := nil;
+  xmlSAX2GetParameterEntity := nil;
+  xmlSAX2ResolveEntity := nil;
+  xmlSAX2EntityDecl := nil;
+  xmlSAX2AttributeDecl := nil;
+  xmlSAX2ElementDecl := nil;
+  xmlSAX2NotationDecl := nil;
+  xmlSAX2UnparsedEntityDecl := nil;
+  xmlSAX2StartDocument := nil;
+  xmlSAX2EndDocument := nil;
+{$IF defined(LIBXML_SAX1_ENABLED) or defined(LIBXML_HTML_ENABLED) or defined(LIBXML_WRITER_ENABLED) or defined(LIBXML_DOCB_ENABLED)}
+  xmlSAX2StartElement := nil;
+  xmlSAX2EndElement := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED *)
+  xmlSAX2StartElementNs := nil;
+  xmlSAX2EndElementNs := nil;
+  xmlSAX2Reference := nil;
+  xmlSAX2Characters := nil;
+  xmlSAX2IgnorableWhitespace := nil;
+  xmlSAX2ProcessingInstruction := nil;
+  xmlSAX2Comment := nil;
+  xmlSAX2CDataBlock := nil;
+{$IFDEF LIBXML_SAX1_ENABLED}
+  xmlSAXDefaultVersion := nil;
+{$ENDIF} (* LIBXML_SAX1_ENABLED *)
+  xmlSAXVersion := nil;
+  xmlSAX2InitDefaultSAXHandler := nil;
+{$IFDEF LIBXML_HTML_ENABLED}
+  xmlSAX2InitHtmlDefaultSAXHandler := nil;
+  htmlDefaultSAXHandlerInit := nil;
+{$ENDIF}
+{$IFDEF LIBXML_DOCB_ENABLED}
+  xmlSAX2InitDocbDefaultSAXHandler := nil;
+  docbDefaultSAXHandlerInit := nil;
+{$ENDIF}
+  xmlDefaultSAXHandlerInit := nil;
+
+  { HTMLtree.inc }
+{$IFDEF LIBXML_HTML_ENABLED}
+  htmlNewDoc := nil;
+  htmlNewDocNoDtD := nil;
+  htmlGetMetaEncoding := nil;
+  htmlSetMetaEncoding := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  htmlDocDumpMemory := nil;
+  htmlDocDumpMemoryFormat := nil;
+  htmlDocDump := nil;
+  htmlSaveFile := nil;
+  htmlNodeDump := nil;
+  htmlNodeDumpFile := nil;
+  htmlNodeDumpFileFormat := nil;
+  htmlSaveFileEnc := nil;
+  htmlSaveFileFormat := nil;
+  htmlNodeDumpFormatOutput := nil;
+  htmlDocContentDumpOutput := nil;
+  htmlDocContentDumpFormatOutput := nil;
+  htmlNodeDumpOutput := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  htmlIsBooleanAttr := nil;
+{$ENDIF} (* LIBXML_HTML_ENABLED *)
+
+  { HTMLparser.inc }
+{$IFDEF LIBXML_HTML_ENABLED}
+  htmlTagLookup := nil;
+  htmlEntityLookup := nil;
+  htmlEntityValueLookup := nil;
+  htmlIsAutoClosed := nil;
+  htmlAutoCloseTag := nil;
+  htmlParseEntityRef := nil;
+  htmlParseCharRef := nil;
+  htmlParseElement := nil;
+  htmlNewParserCtxt := nil;
+  htmlCreateMemoryParserCtxt := nil;
+  htmlParseDocument := nil;
+  htmlSAXParseDoc := nil;
+  htmlParseDoc := nil;
+  htmlSAXParseFile := nil;
+  htmlParseFile := nil;
+  UTF8ToHtml := nil;
+  htmlEncodeEntities := nil;
+  htmlIsScriptAttribute := nil;
+  htmlHandleOmittedElem := nil;
+{$IFDEF LIBXML_PUSH_ENABLED}
+  htmlCreatePushParserCtxt := nil;
+  htmlParseChunk := nil;
+{$ENDIF} (* LIBXML_PUSH_ENABLED *)
+  htmlFreeParserCtxt := nil;
+{$ENDIF} (* LIBXML_HTML_ENABLED *)
+
+  { xmlautomata.inc }
+{$IFDEF LIBXML_REGEXP_ENABLED}
+{$IFDEF LIBXML_AUTOMATA_ENABLED}
+  xmlNewAutomata := nil;
+  xmlFreeAutomata := nil;
+  xmlAutomataGetInitState := nil;
+  xmlAutomataSetFinalState := nil;
+  xmlAutomataNewState := nil;
+  xmlAutomataNewTransition := nil;
+  xmlAutomataNewTransition2 := nil;
+  xmlAutomataNewNegTrans := nil;
+  xmlAutomataNewCountTrans := nil;
+  xmlAutomataNewCountTrans2 := nil;
+  xmlAutomataNewOnceTrans := nil;
+  xmlAutomataNewOnceTrans2 := nil;
+  xmlAutomataNewAllTrans := nil;
+  xmlAutomataNewEpsilon := nil;
+  xmlAutomataNewCountedTrans := nil;
+  xmlAutomataNewCounterTrans := nil;
+  xmlAutomataNewCounter := nil;
+  xmlAutomataCompile := nil;
+  xmlAutomataIsDeterminist := nil;
+{$ENDIF} (* LIBXML_AUTOMATA_ENABLED *)
+{$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+
+  { xmlIO.inc }
+  xmlCleanupInputCallbacks := nil;
+  xmlPopInputCallbacks := nil;
+  xmlRegisterDefaultInputCallbacks := nil;
+  xmlAllocParserInputBuffer := nil;
+  xmlParserInputBufferCreateFilename := nil;
+  xmlParserInputBufferCreateFile := nil;
+  xmlParserInputBufferCreateFd := nil;
+  xmlParserInputBufferCreateMem := nil;
+  xmlParserInputBufferCreateStatic := nil;
+  xmlParserInputBufferCreateIO := nil;
+  xmlParserInputBufferRead := nil;
+  xmlParserInputBufferGrow := nil;
+  xmlParserInputBufferPush := nil;
+  xmlFreeParserInputBuffer := nil;
+  xmlParserGetDirectory := nil;
+  xmlRegisterInputCallbacks := nil;
+  __xmlParserInputBufferCreateFilename := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlCleanupOutputCallbacks := nil;
+  xmlRegisterDefaultOutputCallbacks := nil;
+  xmlAllocOutputBuffer := nil;
+  xmlOutputBufferCreateFilename := nil;
+  xmlOutputBufferCreateFile := nil;
+  xmlOutputBufferCreateBuffer := nil;
+  xmlOutputBufferCreateFd := nil;
+  xmlOutputBufferCreateIO := nil;
+  xmlOutputBufferGetContent := nil;
+  xmlOutputBufferGetSize := nil;
+  xmlOutputBufferWrite := nil;
+  xmlOutputBufferWriteString := nil;
+  xmlOutputBufferWriteEscape := nil;
+  xmlOutputBufferFlush := nil;
+  xmlOutputBufferClose := nil;
+  xmlRegisterOutputCallbacks := nil;
+  __xmlOutputBufferCreateFilename := nil;
+{$IFDEF LIBXML_HTTP_ENABLED}
+  xmlRegisterHTTPPostCallbacks := nil;
+{$ENDIF} (* LIBXML_HTTP_ENABLED *)
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlCheckHTTPInput := nil;
+  xmlNoNetExternalEntityLoader := nil;
+  xmlCheckFilename := nil;
+  xmlFileMatch := nil;
+  xmlFileOpen := nil;
+  xmlFileRead := nil;
+  xmlFileClose := nil;
+{$IFDEF LIBXML_HTTP_ENABLED}
+  xmlIOHTTPMatch := nil;
+  xmlIOHTTPOpen := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlIOHTTPOpenW := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlIOHTTPRead := nil;
+  xmlIOHTTPClose := nil;
+{$ENDIF} (* LIBXML_HTTP_ENABLED *)
+{$IFDEF LIBXML_FTP_ENABLED}
+  xmlIOFTPMatch := nil;
+  xmlIOFTPOpen := nil;
+  xmlIOFTPRead := nil;
+  xmlIOFTPClose := nil;
+{$ENDIF} (* LIBXML_FTP_ENABLED *)
+
+  { xmlmodule.inc }
+{$IFDEF LIBXML_MODULES_ENABLED}
+  xmlModuleOpen := nil;
+  xmlModuleSymbol := nil;
+  xmlModuleClose := nil;
+  xmlModuleFree := nil;
+{$ENDIF} (* LIBXML_MODULES_ENABLED *)
+
+  { xmlreader.inc }
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+{$IFDEF LIBXML_READER_ENABLED}
+  xmlNewTextReader := nil;
+  xmlNewTextReaderFilename := nil;
+  xmlFreeTextReader := nil;
+  xmlTextReaderSetup := nil;
+  xmlTextReaderRead := nil;
+{$IFDEF LIBXML_WRITER_ENABLED}
+  xmlTextReaderReadInnerXml := nil;
+  xmlTextReaderReadOuterXml := nil;
+{$ENDIF}
+  xmlTextReaderReadString := nil;
+  xmlTextReaderReadAttributeValue := nil;
+  xmlTextReaderAttributeCount := nil;
+  xmlTextReaderDepth := nil;
+  xmlTextReaderHasAttributes := nil;
+  xmlTextReaderHasValue := nil;
+  xmlTextReaderIsDefault := nil;
+  xmlTextReaderIsEmptyElement := nil;
+  xmlTextReaderNodeType := nil;
+  xmlTextReaderQuoteChar := nil;
+  xmlTextReaderReadState := nil;
+  xmlTextReaderIsNamespaceDecl := nil;
+  xmlTextReaderConstBaseUri := nil;
+  xmlTextReaderConstLocalName := nil;
+  xmlTextReaderConstName := nil;
+  xmlTextReaderConstNamespaceUri := nil;
+  xmlTextReaderConstPrefix := nil;
+  xmlTextReaderConstXmlLang := nil;
+  xmlTextReaderConstString := nil;
+  xmlTextReaderConstValue := nil;
+  xmlTextReaderBaseUri := nil;
+  xmlTextReaderLocalName := nil;
+  xmlTextReaderName := nil;
+  xmlTextReaderNamespaceUri := nil;
+  xmlTextReaderPrefix := nil;
+  xmlTextReaderXmlLang := nil;
+  xmlTextReaderValue := nil;
+  xmlTextReaderClose := nil;
+  xmlTextReaderGetAttributeNo := nil;
+  xmlTextReaderGetAttribute := nil;
+  xmlTextReaderGetAttributeNs := nil;
+  xmlTextReaderGetRemainder := nil;
+  xmlTextReaderLookupNamespace := nil;
+  xmlTextReaderMoveToAttributeNo := nil;
+  xmlTextReaderMoveToAttribute := nil;
+  xmlTextReaderMoveToAttributeNs := nil;
+  xmlTextReaderMoveToFirstAttribute := nil;
+  xmlTextReaderMoveToNextAttribute := nil;
+  xmlTextReaderMoveToElement := nil;
+  xmlTextReaderNormalization := nil;
+  xmlTextReaderConstEncoding := nil;
+  xmlTextReaderSetParserProp := nil;
+  xmlTextReaderGetParserProp := nil;
+  xmlTextReaderCurrentNode := nil;
+  xmlTextReaderGetParserLineNumber := nil;
+  xmlTextReaderGetParserColumnNumber := nil;
+  xmlTextReaderPreserve := nil;
+{$IFDEF LIBXML_PATTERN_ENABLED}
+  xmlTextReaderPreservePattern := nil;
+{$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+  xmlTextReaderCurrentDoc := nil;
+  xmlTextReaderExpand := nil;
+  xmlTextReaderNext := nil;
+  xmlTextReaderNextSibling := nil;
+  xmlTextReaderIsValid := nil;
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+  xmlTextReaderRelaxNGValidate := nil;
+  xmlTextReaderRelaxNGSetSchema := nil;
+  xmlTextReaderSchemaValidate := nil;
+  xmlTextReaderSchemaValidateCtxt := nil;
+  xmlTextReaderSetSchema := nil;
+{$ENDIF}
+  xmlTextReaderConstXmlVersion := nil;
+  xmlTextReaderStandalone := nil;
+  xmlTextReaderByteConsumed := nil;
+  xmlReaderWalker := nil;
+  xmlReaderForDoc := nil;
+  xmlReaderForFile := nil;
+  xmlReaderForMemory := nil;
+  xmlReaderForFd := nil;
+  xmlReaderForIO := nil;
+  xmlReaderNewWalker := nil;
+  xmlReaderNewDoc := nil;
+  xmlReaderNewFile := nil;
+  xmlReaderNewMemory := nil;
+  xmlReaderNewFd := nil;
+  xmlReaderNewIO := nil;
+  xmlTextReaderLocatorLineNumber := nil;
+  xmlTextReaderLocatorBaseURI := nil;
+  xmlTextReaderSetErrorHandler := nil;
+  xmlTextReaderSetStructuredErrorHandler := nil;
+  xmlTextReaderGetErrorHandler := nil;
+{$ENDIF} (* LIBXML_READER_ENABLED *)
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+  { xmlregexp.inc }
+{$IFDEF LIBXML_REGEXP_ENABLED}
+  xmlRegexpCompile := nil;
+  xmlRegFreeRegexp := nil;
+  xmlRegexpExec := nil;
+  xmlRegexpPrint := nil;
+  xmlRegexpIsDeterminist := nil;
+  xmlRegNewExecCtxt := nil;
+  xmlRegFreeExecCtxt := nil;
+  xmlRegExecPushString := nil;
+  xmlRegExecPushString2 := nil;
+  xmlRegExecNextValues := nil;
+  xmlRegExecErrInfo := nil;
+{$IFDEF LIBXML_EXPR_ENABLED}
+  xmlExpFreeCtxt := nil;
+  xmlExpNewCtxt := nil;
+  xmlExpCtxtNbNodes := nil;
+  xmlExpCtxtNbCons := nil;
+  xmlExpFree := nil;
+  xmlExpRef := nil;
+  xmlExpParse := nil;
+  xmlExpNewAtom := nil;
+  xmlExpNewOr := nil;
+  xmlExpNewSeq := nil;
+  xmlExpNewRange := nil;
+  xmlExpIsNillable := nil;
+  xmlExpMaxToken := nil;
+  xmlExpGetLanguage := nil;
+  xmlExpGetStart := nil;
+  xmlExpStringDerive := nil;
+  xmlExpExpDerive := nil;
+  xmlExpSubsume := nil;
+  xmlExpDump := nil;
+{$ENDIF} (* LIBXML_EXPR_ENABLED *)
+{$ENDIF} (* LIBXML_REGEXP_ENABLED *)
+
+  { xmlsave.inc }
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlSaveToFd := nil;
+  xmlSaveToFilename := nil;
+  xmlSaveToBuffer := nil;
+  xmlSaveToIO := nil;
+  xmlSaveDoc := nil;
+  xmlSaveTree := nil;
+  xmlSaveFlush := nil;
+  xmlSaveClose := nil;
+  xmlSaveSetEscape := nil;
+  xmlSaveSetAttrEscape := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+  { xmlschemas.inc }
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+  xmlSchemaNewParserCtxt := nil;
+  xmlSchemaNewMemParserCtxt := nil;
+  xmlSchemaNewDocParserCtxt := nil;
+  xmlSchemaFreeParserCtxt := nil;
+  xmlSchemaSetParserErrors := nil;
+  xmlSchemaSetParserStructuredErrors := nil;
+  xmlSchemaGetParserErrors := nil;
+  xmlSchemaIsValid := nil;
+  xmlSchemaParse := nil;
+  xmlSchemaFree := nil;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlSchemaDump := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlSchemaSetValidErrors := nil;
+  xmlSchemaSetValidStructuredErrors := nil;
+  xmlSchemaGetValidErrors := nil;
+  xmlSchemaSetValidOptions := nil;
+  xmlSchemaValidCtxtGetOptions := nil;
+  xmlSchemaNewValidCtxt := nil;
+  xmlSchemaValidCtxtGetParserCtxt := nil;
+  xmlSchemaFreeValidCtxt := nil;
+  xmlSchemaValidateDoc := nil;
+  xmlSchemaValidateOneElement := nil;
+  xmlSchemaValidateStream := nil;
+  xmlSchemaValidateFile := nil;
+  xmlSchemaValidateSetFilename := nil;
+  xmlSchemaValidateSetLocator := nil;
+  xmlSchemaSAXPlug := nil;
+  xmlSchemaSAXUnplug := nil;
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+  { xmlschemastypes.inc }
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+  xmlSchemaInitTypes := nil;
+  xmlSchemaCleanupTypes := nil;
+  xmlSchemaGetPredefinedType := nil;
+  xmlSchemaValidatePredefinedType := nil;
+  xmlSchemaValPredefTypeNode := nil;
+  xmlSchemaValidateFacet := nil;
+  xmlSchemaValidateFacetWhtsp := nil;
+  xmlSchemaFreeValue := nil;
+  xmlSchemaNewFacet := nil;
+  xmlSchemaCheckFacet := nil;
+  xmlSchemaFreeFacet := nil;
+  xmlSchemaCompareValues := nil;
+  xmlSchemaGetBuiltInListSimpleTypeItemType := nil;
+  xmlSchemaValidateListSimpleTypeFacet := nil;
+  xmlSchemaGetBuiltInType := nil;
+  xmlSchemaIsBuiltInTypeFacet := nil;
+  xmlSchemaCollapseString := nil;
+  xmlSchemaWhiteSpaceReplace := nil;
+  xmlSchemaGetFacetValueAsULong := nil;
+  xmlSchemaValidateLengthFacet := nil;
+  xmlSchemaValidateLengthFacetWhtsp := nil;
+  xmlSchemaValPredefTypeNodeNoNorm := nil;
+  xmlSchemaGetCanonValue := nil;
+  xmlSchemaGetCanonValueWhtsp := nil;
+  xmlSchemaValueAppend := nil;
+  xmlSchemaValueGetNext := nil;
+  xmlSchemaValueGetAsString := nil;
+  xmlSchemaValueGetAsBoolean := nil;
+  xmlSchemaNewStringValue := nil;
+  xmlSchemaNewNOTATIONValue := nil;
+  xmlSchemaNewQNameValue := nil;
+  xmlSchemaCompareValuesWhtsp := nil;
+  xmlSchemaCopyValue := nil;
+  xmlSchemaGetValType := nil;
+{$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
+
+  { xmlstring.inc }
+  xmlStrdup := nil;
+  xmlStrndup := nil;
+  xmlCharStrndup := nil;
+  xmlCharStrdup := nil;
+  xmlStrsub := nil;
+  xmlStrchr := nil;
+  xmlStrstr := nil;
+  xmlStrcasestr := nil;
+  xmlStrcmp := nil;
+  xmlStrncmp := nil;
+  xmlStrcasecmp := nil;
+  xmlStrncasecmp := nil;
+  xmlStrEqual := nil;
+  xmlStrQEqual := nil;
+  xmlStrlen := nil;
+  xmlStrcat := nil;
+  xmlStrncat := nil;
+  xmlStrncatNew := nil;
+  xmlStrPrintf := nil;
+  xmlStrVPrintf := nil;
+  xmlGetUTF8Char := nil;
+  xmlCheckUTF8 := nil;
+  xmlUTF8Strsize := nil;
+  xmlUTF8Strndup := nil;
+  xmlUTF8Strpos := nil;
+  xmlUTF8Strloc := nil;
+  xmlUTF8Strsub := nil;
+  xmlUTF8Strlen := nil;
+  xmlUTF8Size := nil;
+  xmlUTF8Charcmp := nil;
+
+  { xmlunicode.inc }
+{$IFDEF LIBXML_UNICODE_ENABLED}
+  xmlUCSIsAegeanNumbers := nil;
+  xmlUCSIsAlphabeticPresentationForms := nil;
+  xmlUCSIsArabic := nil;
+  xmlUCSIsArabicPresentationFormsA := nil;
+  xmlUCSIsArabicPresentationFormsB := nil;
+  xmlUCSIsArmenian := nil;
+  xmlUCSIsArrows := nil;
+  xmlUCSIsBasicLatin := nil;
+  xmlUCSIsBengali := nil;
+  xmlUCSIsBlockElements := nil;
+  xmlUCSIsBopomofo := nil;
+  xmlUCSIsBopomofoExtended := nil;
+  xmlUCSIsBoxDrawing := nil;
+  xmlUCSIsBraillePatterns := nil;
+  xmlUCSIsBuhid := nil;
+  xmlUCSIsByzantineMusicalSymbols := nil;
+  xmlUCSIsCJKCompatibility := nil;
+  xmlUCSIsCJKCompatibilityForms := nil;
+  xmlUCSIsCJKCompatibilityIdeographs := nil;
+  xmlUCSIsCJKCompatibilityIdeographsSupplement := nil;
+  xmlUCSIsCJKRadicalsSupplement := nil;
+  xmlUCSIsCJKSymbolsandPunctuation := nil;
+  xmlUCSIsCJKUnifiedIdeographs := nil;
+  xmlUCSIsCJKUnifiedIdeographsExtensionA := nil;
+  xmlUCSIsCJKUnifiedIdeographsExtensionB := nil;
+  xmlUCSIsCherokee := nil;
+  xmlUCSIsCombiningDiacriticalMarks := nil;
+  xmlUCSIsCombiningDiacriticalMarksforSymbols := nil;
+  xmlUCSIsCombiningHalfMarks := nil;
+  xmlUCSIsCombiningMarksforSymbols := nil;
+  xmlUCSIsControlPictures := nil;
+  xmlUCSIsCurrencySymbols := nil;
+  xmlUCSIsCypriotSyllabary := nil;
+  xmlUCSIsCyrillic := nil;
+  xmlUCSIsCyrillicSupplement := nil;
+  xmlUCSIsDeseret := nil;
+  xmlUCSIsDevanagari := nil;
+  xmlUCSIsDingbats := nil;
+  xmlUCSIsEnclosedAlphanumerics := nil;
+  xmlUCSIsEnclosedCJKLettersandMonths := nil;
+  xmlUCSIsEthiopic := nil;
+  xmlUCSIsGeneralPunctuation := nil;
+  xmlUCSIsGeometricShapes := nil;
+  xmlUCSIsGeorgian := nil;
+  xmlUCSIsGothic := nil;
+  xmlUCSIsGreek := nil;
+  xmlUCSIsGreekExtended := nil;
+  xmlUCSIsGreekandCoptic := nil;
+  xmlUCSIsGujarati := nil;
+  xmlUCSIsGurmukhi := nil;
+  xmlUCSIsHalfwidthandFullwidthForms := nil;
+  xmlUCSIsHangulCompatibilityJamo := nil;
+  xmlUCSIsHangulJamo := nil;
+  xmlUCSIsHangulSyllables := nil;
+  xmlUCSIsHanunoo := nil;
+  xmlUCSIsHebrew := nil;
+  xmlUCSIsHighPrivateUseSurrogates := nil;
+  xmlUCSIsHighSurrogates := nil;
+  xmlUCSIsHiragana := nil;
+  xmlUCSIsIPAExtensions := nil;
+  xmlUCSIsIdeographicDescriptionCharacters := nil;
+  xmlUCSIsKanbun := nil;
+  xmlUCSIsKangxiRadicals := nil;
+  xmlUCSIsKannada := nil;
+  xmlUCSIsKatakana := nil;
+  xmlUCSIsKatakanaPhoneticExtensions := nil;
+  xmlUCSIsKhmer := nil;
+  xmlUCSIsKhmerSymbols := nil;
+  xmlUCSIsLao := nil;
+  xmlUCSIsLatin1Supplement := nil;
+  xmlUCSIsLatinExtendedA := nil;
+  xmlUCSIsLatinExtendedB := nil;
+  xmlUCSIsLatinExtendedAdditional := nil;
+  xmlUCSIsLetterlikeSymbols := nil;
+  xmlUCSIsLimbu := nil;
+  xmlUCSIsLinearBIdeograms := nil;
+  xmlUCSIsLinearBSyllabary := nil;
+  xmlUCSIsLowSurrogates := nil;
+  xmlUCSIsMalayalam := nil;
+  xmlUCSIsMathematicalAlphanumericSymbols := nil;
+  xmlUCSIsMathematicalOperators := nil;
+  xmlUCSIsMiscellaneousMathematicalSymbolsA := nil;
+  xmlUCSIsMiscellaneousMathematicalSymbolsB := nil;
+  xmlUCSIsMiscellaneousSymbols := nil;
+  xmlUCSIsMiscellaneousSymbolsandArrows := nil;
+  xmlUCSIsMiscellaneousTechnical := nil;
+  xmlUCSIsMongolian := nil;
+  xmlUCSIsMusicalSymbols := nil;
+  xmlUCSIsMyanmar := nil;
+  xmlUCSIsNumberForms := nil;
+  xmlUCSIsOgham := nil;
+  xmlUCSIsOldItalic := nil;
+  xmlUCSIsOpticalCharacterRecognition := nil;
+  xmlUCSIsOriya := nil;
+  xmlUCSIsOsmanya := nil;
+  xmlUCSIsPhoneticExtensions := nil;
+  xmlUCSIsPrivateUse := nil;
+  xmlUCSIsPrivateUseArea := nil;
+  xmlUCSIsRunic := nil;
+  xmlUCSIsShavian := nil;
+  xmlUCSIsSinhala := nil;
+  xmlUCSIsSmallFormVariants := nil;
+  xmlUCSIsSpacingModifierLetters := nil;
+  xmlUCSIsSpecials := nil;
+  xmlUCSIsSuperscriptsandSubscripts := nil;
+  xmlUCSIsSupplementalArrowsA := nil;
+  xmlUCSIsSupplementalArrowsB := nil;
+  xmlUCSIsSupplementalMathematicalOperators := nil;
+  xmlUCSIsSupplementaryPrivateUseAreaA := nil;
+  xmlUCSIsSupplementaryPrivateUseAreaB := nil;
+  xmlUCSIsSyriac := nil;
+  xmlUCSIsTagalog := nil;
+  xmlUCSIsTagbanwa := nil;
+  xmlUCSIsTags := nil;
+  xmlUCSIsTaiLe := nil;
+  xmlUCSIsTaiXuanJingSymbols := nil;
+  xmlUCSIsTamil := nil;
+  xmlUCSIsTelugu := nil;
+  xmlUCSIsThaana := nil;
+  xmlUCSIsThai := nil;
+  xmlUCSIsTibetan := nil;
+  xmlUCSIsUgaritic := nil;
+  xmlUCSIsUnifiedCanadianAboriginalSyllabics := nil;
+  xmlUCSIsVariationSelectors := nil;
+  xmlUCSIsVariationSelectorsSupplement := nil;
+  xmlUCSIsYiRadicals := nil;
+  xmlUCSIsYiSyllables := nil;
+  xmlUCSIsYijingHexagramSymbols := nil;
+  xmlUCSIsBlock := nil;
+  xmlUCSIsCatC := nil;
+  xmlUCSIsCatCc := nil;
+  xmlUCSIsCatCf := nil;
+  xmlUCSIsCatCo := nil;
+  xmlUCSIsCatCs := nil;
+  xmlUCSIsCatL := nil;
+  xmlUCSIsCatLl := nil;
+  xmlUCSIsCatLm := nil;
+  xmlUCSIsCatLo := nil;
+  xmlUCSIsCatLt := nil;
+  xmlUCSIsCatLu := nil;
+  xmlUCSIsCatM := nil;
+  xmlUCSIsCatMc := nil;
+  xmlUCSIsCatMe := nil;
+  xmlUCSIsCatMn := nil;
+  xmlUCSIsCatN := nil;
+  xmlUCSIsCatNd := nil;
+  xmlUCSIsCatNl := nil;
+  xmlUCSIsCatNo := nil;
+  xmlUCSIsCatP := nil;
+  xmlUCSIsCatPc := nil;
+  xmlUCSIsCatPd := nil;
+  xmlUCSIsCatPe := nil;
+  xmlUCSIsCatPf := nil;
+  xmlUCSIsCatPi := nil;
+  xmlUCSIsCatPo := nil;
+  xmlUCSIsCatPs := nil;
+  xmlUCSIsCatS := nil;
+  xmlUCSIsCatSc := nil;
+  xmlUCSIsCatSk := nil;
+  xmlUCSIsCatSm := nil;
+  xmlUCSIsCatSo := nil;
+  xmlUCSIsCatZ := nil;
+  xmlUCSIsCatZl := nil;
+  xmlUCSIsCatZp := nil;
+  xmlUCSIsCatZs := nil;
+  xmlUCSIsCat := nil;
+{$ENDIF} (* LIBXML_UNICODE_ENABLED *)
+
+  { xmlwriter.inc }
+{$IFDEF LIBXML_WRITER_ENABLED}
+  xmlNewTextWriter := nil;
+  xmlNewTextWriterFilename := nil;
+  xmlNewTextWriterMemory := nil;
+  xmlNewTextWriterPushParser := nil;
+  xmlNewTextWriterDoc := nil;
+  xmlNewTextWriterTree := nil;
+  xmlFreeTextWriter := nil;
+  xmlTextWriterStartDocument := nil;
+  xmlTextWriterEndDocument := nil;
+  xmlTextWriterStartComment := nil;
+  xmlTextWriterEndComment := nil;
+  xmlTextWriterWriteFormatComment := nil;
+  xmlTextWriterWriteVFormatComment := nil;
+  xmlTextWriterWriteComment := nil;
+  xmlTextWriterStartElement := nil;
+  xmlTextWriterStartElementNS := nil;
+  xmlTextWriterEndElement := nil;
+  xmlTextWriterFullEndElement := nil;
+  xmlTextWriterWriteFormatElement := nil;
+  xmlTextWriterWriteVFormatElement := nil;
+  xmlTextWriterWriteElement := nil;
+  xmlTextWriterWriteFormatElementNS := nil;
+  xmlTextWriterWriteVFormatElementNS := nil;
+  xmlTextWriterWriteElementNS := nil;
+  xmlTextWriterWriteFormatRaw := nil;
+  xmlTextWriterWriteVFormatRaw := nil;
+  xmlTextWriterWriteRawLen := nil;
+  xmlTextWriterWriteRaw := nil;
+  xmlTextWriterWriteFormatString := nil;
+  xmlTextWriterWriteVFormatString := nil;
+  xmlTextWriterWriteString := nil;
+  xmlTextWriterWriteBase64 := nil;
+  xmlTextWriterWriteBinHex := nil;
+  xmlTextWriterStartAttribute := nil;
+  xmlTextWriterStartAttributeNS := nil;
+  xmlTextWriterEndAttribute := nil;
+  xmlTextWriterWriteFormatAttribute := nil;
+  xmlTextWriterWriteVFormatAttribute := nil;
+  xmlTextWriterWriteAttribute := nil;
+  xmlTextWriterWriteFormatAttributeNS := nil;
+  xmlTextWriterWriteVFormatAttributeNS := nil;
+  xmlTextWriterWriteAttributeNS := nil;
+  xmlTextWriterStartPI := nil;
+  xmlTextWriterEndPI := nil;
+  xmlTextWriterWriteFormatPI := nil;
+  xmlTextWriterWriteVFormatPI := nil;
+  xmlTextWriterWritePI := nil;
+  xmlTextWriterStartCDATA := nil;
+  xmlTextWriterEndCDATA := nil;
+  xmlTextWriterWriteFormatCDATA := nil;
+  xmlTextWriterWriteVFormatCDATA := nil;
+  xmlTextWriterWriteCDATA := nil;
+  xmlTextWriterStartDTD := nil;
+  xmlTextWriterEndDTD := nil;
+  xmlTextWriterWriteFormatDTD := nil;
+  xmlTextWriterWriteVFormatDTD := nil;
+  xmlTextWriterWriteDTD := nil;
+  xmlTextWriterStartDTDElement := nil;
+  xmlTextWriterEndDTDElement := nil;
+  xmlTextWriterWriteFormatDTDElement := nil;
+  xmlTextWriterWriteVFormatDTDElement := nil;
+  xmlTextWriterWriteDTDElement := nil;
+  xmlTextWriterStartDTDAttlist := nil;
+  xmlTextWriterEndDTDAttlist := nil;
+  xmlTextWriterWriteFormatDTDAttlist := nil;
+  xmlTextWriterWriteVFormatDTDAttlist := nil;
+  xmlTextWriterWriteDTDAttlist := nil;
+  xmlTextWriterStartDTDEntity := nil;
+  xmlTextWriterEndDTDEntity := nil;
+  xmlTextWriterWriteFormatDTDInternalEntity := nil;
+  xmlTextWriterWriteVFormatDTDInternalEntity := nil;
+  xmlTextWriterWriteDTDInternalEntity := nil;
+  xmlTextWriterWriteDTDExternalEntity := nil;
+  xmlTextWriterWriteDTDExternalEntityContents := nil;
+  xmlTextWriterWriteDTDEntity := nil;
+  xmlTextWriterWriteDTDNotation := nil;
+  xmlTextWriterSetIndent := nil;
+  xmlTextWriterSetIndentString := nil;
+  xmlTextWriterSetQuoteChar := nil;
+  xmlTextWriterFlush := nil;
+{$ENDIF} (* LIBXML_WRITER_ENABLED *)
+
+  { c14n.inc }
+{$IFDEF LIBXML_C14N_ENABLED}
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlC14NDocSaveTo := nil;
+  xmlC14NDocDumpMemory := nil;
+  xmlC14NDocSave := nil;
+  xmlC14NExecute := nil;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+{$ENDIF} (* LIBXML_C14N_ENABLED *)
+
+  { xpath.inc }
+{$IFDEF LIBXML_XPATH_ENABLED}
+  xmlXPathFreeObject := nil;
+  xmlXPathNodeSetCreate := nil;
+  xmlXPathFreeNodeSetList := nil;
+  xmlXPathFreeNodeSet := nil;
+  xmlXPathObjectCopy := nil;
+  xmlXPathCmpNodes := nil;
+  xmlXPathCastNumberToBoolean := nil;
+  xmlXPathCastStringToBoolean := nil;
+  xmlXPathCastNodeSetToBoolean := nil;
+  xmlXPathCastToBoolean := nil;
+  xmlXPathCastBooleanToNumber := nil;
+  xmlXPathCastStringToNumber := nil;
+  xmlXPathCastNodeToNumber := nil;
+  xmlXPathCastNodeSetToNumber := nil;
+  xmlXPathCastToNumber := nil;
+  xmlXPathCastBooleanToString := nil;
+  xmlXPathCastNumberToString := nil;
+  xmlXPathCastNodeToString := nil;
+  xmlXPathCastNodeSetToString := nil;
+  xmlXPathCastToString := nil;
+  xmlXPathConvertBoolean := nil;
+  xmlXPathConvertNumber := nil;
+  xmlXPathConvertString := nil;
+  xmlXPathNewContext := nil;
+  xmlXPathFreeContext := nil;
+  xmlXPathContextSetCache := nil;
+  xmlXPathOrderDocElems := nil;
+  xmlXPathSetContextNode := nil;
+  xmlXPathNodeEval := nil;
+  xmlXPathEval := nil;
+  xmlXPathEvalExpression := nil;
+  xmlXPathEvalPredicate := nil;
+  xmlXPathCompile := nil;
+  xmlXPathCtxtCompile := nil;
+  xmlXPathCompiledEval := nil;
+  xmlXPathCompiledEvalToBoolean := nil;
+  xmlXPathFreeCompExpr := nil;
+{$ENDIF} (* LIBXML_XPATH_ENABLED *)
+{$if defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
+  xmlXPathInit := nil;
+  xmlXPathIsNaN := nil;
+  xmlXPathIsInf := nil;
+{$ENDIF} (* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*)
+
+
+  { xpathInternals.inc }
+{$IFDEF LIBXML_XPATH_ENABLED}
+  xmlXPathRegisterVariableLookup := nil;
+  xmlXPathRegisterFuncLookup := nil;
+//procedure __xmlXPatherror(ctxt
+  xmlXPathErr := nil;
+{$IFDEF LIBXML_DEBUG_ENABLED}
+  xmlXPathDebugDumpObject := nil;
+  xmlXPathDebugDumpCompExpr := nil;
+{$ENDIF}
+  xmlXPathNodeSetContains := nil;
+  xmlXPathDifference := nil;
+  xmlXPathIntersection := nil;
+  xmlXPathDistinctSorted := nil;
+  xmlXPathDistinct := nil;
+  xmlXPathHasSameNodes := nil;
+  xmlXPathNodeLeadingSorted := nil;
+  xmlXPathLeadingSorted := nil;
+  xmlXPathNodeLeading := nil;
+  xmlXPathLeading := nil;
+  xmlXPathNodeTrailingSorted := nil;
+  xmlXPathTrailingSorted := nil;
+  xmlXPathNodeTrailing := nil;
+  xmlXPathTrailing := nil;
+  xmlXPathRegisterNs := nil;
+  xmlXPathNsLookup := nil;
+  xmlXPathRegisteredNsCleanup := nil;
+  xmlXPathRegisterFunc := nil;
+  xmlXPathRegisterFuncNS := nil;
+  xmlXPathRegisterVariable := nil;
+  xmlXPathRegisterVariableNS := nil;
+  xmlXPathFunctionLookup := nil;
+  xmlXPathFunctionLookupNS := nil;
+  xmlXPathRegisteredFuncsCleanup := nil;
+  xmlXPathVariableLookup := nil;
+  xmlXPathVariableLookupNS := nil;
+  xmlXPathRegisteredVariablesCleanup := nil;
+  xmlXPathNewParserContext := nil;
+  xmlXPathFreeParserContext := nil;
+  valuePop := nil;
+  valuePush := nil;
+  xmlXPathNewString := nil;
+  xmlXPathNewCString := nil;
+  xmlXPathWrapString := nil;
+  xmlXPathWrapCString := nil;
+  xmlXPathNewFloat := nil;
+  xmlXPathNewBoolean := nil;
+  xmlXPathNewNodeSet := nil;
+  xmlXPathNewValueTree := nil;
+  xmlXPathNodeSetAddUnique := nil;
+  xmlXPathNodeSetAdd := nil;
+  xmlXPathNodeSetAddNs := nil;
+  xmlXPathNodeSetSort := nil;
+  xmlXPathRoot := nil;
+  xmlXPathEvalExpr := nil;
+  xmlXPathParseName := nil;
+  xmlXPathParseNCName := nil;
+  xmlXPathEqualValues := nil;
+  xmlXPathNotEqualValues := nil;
+  xmlXPathCompareValues := nil;
+  xmlXPathValueFlipSign := nil;
+  xmlXPathAddValues := nil;
+  xmlXPathSubValues := nil;
+  xmlXPathMultValues := nil;
+  xmlXPathDivValues := nil;
+  xmlXPathModValues := nil;
+  xmlXPathIsNodeType := nil;
+  xmlXPathNextSelf := nil;
+  xmlXPathNextChild := nil;
+  xmlXPathNextDescendant := nil;
+  xmlXPathNextDescendantOrSelf := nil;
+  xmlXPathNextParent := nil;
+  xmlXPathNextAncestorOrSelf := nil;
+  xmlXPathNextFollowingSibling := nil;
+  xmlXPathNextFollowing := nil;
+  xmlXPathNextNamespace := nil;
+  xmlXPathNextAttribute := nil;
+  xmlXPathNextPreceding := nil;
+  xmlXPathNextAncestor := nil;
+  xmlXPathNextPrecedingSibling := nil;
+  xmlXPathLastFunction := nil;
+  xmlXPathPositionFunction := nil;
+  xmlXPathCountFunction := nil;
+  xmlXPathIdFunction := nil;
+  xmlXPathLocalNameFunction := nil;
+  xmlXPathNamespaceURIFunction := nil;
+  xmlXPathStringFunction := nil;
+  xmlXPathStringLengthFunction := nil;
+  xmlXPathConcatFunction := nil;
+  xmlXPathContainsFunction := nil;
+  xmlXPathStartsWithFunction := nil;
+  xmlXPathSubstringFunction := nil;
+  xmlXPathSubstringBeforeFunction := nil;
+  xmlXPathSubstringAfterFunction := nil;
+  xmlXPathNormalizeFunction := nil;
+  xmlXPathTranslateFunction := nil;
+  xmlXPathNotFunction := nil;
+  xmlXPathTrueFunction := nil;
+  xmlXPathFalseFunction := nil;
+  xmlXPathLangFunction := nil;
+  xmlXPathNumberFunction := nil;
+  xmlXPathSumFunction := nil;
+  xmlXPathFloorFunction := nil;
+  xmlXPathCeilingFunction := nil;
+  xmlXPathRoundFunction := nil;
+  xmlXPathBooleanFunction := nil;
+  xmlXPathNodeSetFreeNs := nil;
+{$ENDIF} (* LIBXML_XPATH_ENABLED *)
+
+  { xlink.inc }
+{$IFDEF LIBXML_XPTR_ENABLED}
+  xlinkGetDefaultDetect := nil;
+  xlinkSetDefaultDetect := nil;
+  xlinkGetDefaultHandler := nil;
+  xlinkSetDefaultHandler := nil;
+  xlinkIsLink := nil;
+{$ENDIF} (* LIBXML_XPTR_ENABLED *)
+
+  { xinclude.inc }
+{$IFDEF LIBXML_XINCLUDE_ENABLED}
+  xmlXIncludeProcess := nil;
+  xmlXIncludeProcessFlags := nil;
+  xmlXIncludeProcessFlagsData := nil;
+  xmlXIncludeProcessTreeFlagsData := nil;
+  xmlXIncludeProcessTree := nil;
+  xmlXIncludeProcessTreeFlags := nil;
+  xmlXIncludeNewContext := nil;
+  xmlXIncludeSetFlags := nil;
+  xmlXIncludeFreeContext := nil;
+  xmlXIncludeProcessNode := nil;
+{$ENDIF} (* LIBXML_XINCLUDE_ENABLED *)
+
+  { xpointer.inc }
+{$IFDEF LIBXML_XPTR_ENABLED}
+  xmlXPtrLocationSetCreate := nil;
+  xmlXPtrFreeLocationSet := nil;
+  xmlXPtrLocationSetMerge := nil;
+  xmlXPtrNewRange := nil;
+  xmlXPtrNewRangePoints := nil;
+  xmlXPtrNewRangeNodePoint := nil;
+  xmlXPtrNewRangePointNode := nil;
+  xmlXPtrNewRangeNodes := nil;
+  xmlXPtrNewLocationSetNodes := nil;
+  xmlXPtrNewLocationSetNodeSet := nil;
+  xmlXPtrNewRangeNodeObject := nil;
+  xmlXPtrNewCollapsedRange := nil;
+  xmlXPtrLocationSetAdd := nil;
+  xmlXPtrWrapLocationSet := nil;
+  xmlXPtrLocationSetDel := nil;
+  xmlXPtrLocationSetRemove := nil;
+  xmlXPtrNewContext := nil;
+  xmlXPtrEval := nil;
+  xmlXPtrRangeToFunction := nil;
+  xmlXPtrBuildNodeList := nil;
+  xmlXPtrEvalRangePredicate := nil;
+{$ENDIF} (* LIBXML_XPTR_ENABLED *)
+{$ENDIF} (* NIL_FUNCVARS_ON_FREE *)
+end;
+
+finalization
+  FreeLibXML;
+
+end.
+

+ 34 - 0
packages/libxml/src/xml2h.inc

@@ -0,0 +1,34 @@
+{$mode objfpc}
+{$H+}
+{$macro on}
+
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses
+  System.DynLibs,
+  System.CTypes,
+  System.Math;
+{$ELSE FPC_DOTTEDUNITS}
+uses
+  dynlibs,
+  ctypes,
+  math;
+{$ENDIF FPC_DOTTEDUNITS}
+
+const
+{$IF Defined(WINDOWS)}
+  xml2lib = 'libxml2.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ELSEIF Defined(UNIX)}
+  xml2lib = 'libxml2.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+{$ELSE}
+  {$MESSAGE ERROR 'Platform not supported right now'}
+{$IFEND}
+
+

+ 98 - 0
packages/libxml/src/xmlIO.inc

@@ -173,6 +173,8 @@ function xmlOutputBufferCreateFile(fp: PFILE; encoder: xmlCharEncodingHandlerPtr
 function xmlOutputBufferCreateBuffer(buffer: xmlBufferPtr; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
 function xmlOutputBufferCreateFd(fd: cint; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
 function xmlOutputBufferCreateIO(iowrite: xmlOutputWriteCallback; ioclose: xmlOutputCloseCallback; ioctx: pointer; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL; external xml2lib;
+function xmlOutputBufferGetContent(_out: xmlOutputBufferPtr): xmlCharPtr; EXTDECL; external xml2lib;
+function xmlOutputBufferGetSize(_out: xmlOutputBufferPtr): csize_t; EXTDECL; external xml2lib;
 function xmlOutputBufferWrite(_out: xmlOutputBufferPtr; len: cint; buf: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlOutputBufferWriteString(_out: xmlOutputBufferPtr; str: PAnsiChar): cint; EXTDECL; external xml2lib;
 function xmlOutputBufferWriteEscape(_out: xmlOutputBufferPtr; str: xmlCharPtr; escaping: xmlCharEncodingOutputFunc): cint; EXTDECL; external xml2lib;
@@ -230,3 +232,99 @@ function xmlIOFTPRead(context: pointer; buffer: PAnsiChar; len: cint): cint; EXT
 function xmlIOFTPClose(context: pointer): cint; EXTDECL; external xml2lib;
 {$ENDIF} (* LIBXML_FTP_ENABLED *)
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Interfaces for input
+ *)
+  xmlCleanupInputCallbacks: procedure; EXTDECL;
+  xmlPopInputCallbacks: function: cint; EXTDECL;
+  xmlRegisterDefaultInputCallbacks: procedure; EXTDECL;
+  xmlAllocParserInputBuffer: function(enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferCreateFilename: function(URI: PAnsiChar; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferCreateFile: function(fp: PFILE; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferCreateFd: function(fd: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferCreateMem: function(mem: PAnsiChar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferCreateStatic: function(mem: PAnsiChar; size: cint; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+
+  xmlParserInputBufferCreateIO: function(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+  xmlParserInputBufferRead: function(_in: xmlParserInputBufferPtr; len: cint): cint; EXTDECL;
+  xmlParserInputBufferGrow: function(_in: xmlParserInputBufferPtr; len: cint): cint; EXTDECL;
+  xmlParserInputBufferPush: function(_in: xmlParserInputBufferPtr; len: cint; buf: PAnsiChar): cint; EXTDECL;
+  xmlFreeParserInputBuffer: procedure(_in: xmlParserInputBufferPtr); EXTDECL;
+  xmlParserGetDirectory: function(filename: PAnsiChar): PAnsiChar; EXTDECL;
+  xmlRegisterInputCallbacks: function(matchFunc: xmlInputMatchCallback; openFunc: xmlInputOpenCallback; readFunc: xmlInputReadCallback; closeFunc: xmlInputCloseCallback): cint; EXTDECL;
+  __xmlParserInputBufferCreateFilename: function(URI: PAnsiChar; enc: xmlCharEncoding): xmlParserInputBufferPtr; EXTDECL;
+
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+(*
+ * Interfaces for output
+ *)
+  xmlCleanupOutputCallbacks: procedure; EXTDECL;
+  xmlRegisterDefaultOutputCallbacks: procedure; EXTDECL;
+  xmlAllocOutputBuffer: function(encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL;
+
+  xmlOutputBufferCreateFilename: function(URI: PAnsiChar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; EXTDECL;
+  xmlOutputBufferCreateFile: function(fp: PFILE; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL;
+  xmlOutputBufferCreateBuffer: function(buffer: xmlBufferPtr; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL;
+  xmlOutputBufferCreateFd: function(fd: cint; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL;
+  xmlOutputBufferCreateIO: function(iowrite: xmlOutputWriteCallback; ioclose: xmlOutputCloseCallback; ioctx: pointer; encoder: xmlCharEncodingHandlerPtr): xmlOutputBufferPtr; EXTDECL;
+  xmlOutputBufferGetContent: function(_out: xmlOutputBufferPtr): xmlCharPtr; EXTDECL;
+  xmlOutputBufferGetSize: function(_out: xmlOutputBufferPtr): csize_t; EXTDECL;
+  xmlOutputBufferWrite: function(_out: xmlOutputBufferPtr; len: cint; buf: PAnsiChar): cint; EXTDECL;
+  xmlOutputBufferWriteString: function(_out: xmlOutputBufferPtr; str: PAnsiChar): cint; EXTDECL;
+  xmlOutputBufferWriteEscape: function(_out: xmlOutputBufferPtr; str: xmlCharPtr; escaping: xmlCharEncodingOutputFunc): cint; EXTDECL;
+  xmlOutputBufferFlush: function(_out: xmlOutputBufferPtr): cint; EXTDECL;
+  xmlOutputBufferClose: function(_out: xmlOutputBufferPtr): cint; EXTDECL;
+  xmlRegisterOutputCallbacks: function(matchFunc: xmlOutputMatchCallback; openFunc: xmlOutputOpenCallback; writeFunc: xmlOutputWriteCallback; closeFunc: xmlOutputCloseCallback): cint; EXTDECL;
+  __xmlOutputBufferCreateFilename: function(URI: PAnsiChar; encoder: xmlCharEncodingHandlerPtr; compression: cint): xmlOutputBufferPtr; EXTDECL;
+
+{$IFDEF LIBXML_HTTP_ENABLED}
+(*  This function only exists if HTTP support built into the library  *)
+  xmlRegisterHTTPPostCallbacks: procedure; EXTDECL;
+{$ENDIF} (* LIBXML_HTTP_ENABLED *)
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+  xmlCheckHTTPInput: function(ctxt: xmlParserCtxtPtr; ret: xmlParserInputPtr): xmlParserInputPtr; EXTDECL;
+
+(*
+ * A predefined entity loader disabling network accesses
+ *)
+  xmlNoNetExternalEntityLoader: function(URL: PAnsiChar; ID: PAnsiChar; ctxt: xmlParserCtxtPtr): xmlParserInputPtr; EXTDECL;
+
+(*
+ * Check xmlCanonicPath in uri.h for a better alternative.
+ *)
+  xmlCheckFilename: function(path: PAnsiChar): cint; EXTDECL;
+
+(**
+ * Default 'file://' protocol callbacks
+ *)
+  xmlFileMatch: function(filename: PAnsiChar): cint; EXTDECL;
+  xmlFileOpen: function(filename: PAnsiChar): pointer; EXTDECL;
+  xmlFileRead: function(context: pointer; buffer: PAnsiChar; len: cint): cint; EXTDECL;
+  xmlFileClose: function(context: pointer): cint; EXTDECL;
+
+(**
+ * Default 'http://' protocol callbacks
+ *)
+{$IFDEF LIBXML_HTTP_ENABLED}
+  xmlIOHTTPMatch: function(filename: PAnsiChar): cint; EXTDECL;
+  xmlIOHTTPOpen: function(filename: PAnsiChar): pointer; EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlIOHTTPOpenW: function(post_uri: PAnsiChar; compression: cint): pointer; EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+  xmlIOHTTPRead: function(context: pointer; buffer: PAnsiChar; len: cint): cint; EXTDECL;
+  xmlIOHTTPClose: function(context: pointer): cint; EXTDECL;
+{$ENDIF} (* LIBXML_HTTP_ENABLED *)
+
+(**
+ * Default 'ftp://' protocol callbacks
+ *)
+{$IFDEF LIBXML_FTP_ENABLED}
+  xmlIOFTPMatch: function(filename: PAnsiChar): cint; EXTDECL;
+  xmlIOFTPOpen: function(filename: PAnsiChar): pointer; EXTDECL;
+  xmlIOFTPRead: function(context: pointer; buffer: PAnsiChar; len: cint): cint; EXTDECL;
+  xmlIOFTPClose: function(context: pointer): cint; EXTDECL;
+{$ENDIF} (* LIBXML_FTP_ENABLED *)
+{$ENDIF}

+ 25 - 0
packages/libxml/src/xmlautomata.inc

@@ -57,6 +57,31 @@ function xmlAutomataCompile(am: xmlAutomataPtr): xmlRegexpPtr; EXTDECL; external
 function xmlAutomataIsDeterminist(am: xmlAutomataPtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Building API
+ *)
+  xmlNewAutomata: function: xmlAutomataPtr; EXTDECL;
+  xmlFreeAutomata: procedure(am: xmlAutomataPtr); EXTDECL;
+  xmlAutomataGetInitState: function(am: xmlAutomataPtr): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataSetFinalState: function(am: xmlAutomataPtr; state: xmlAutomataStatePtr): cint; EXTDECL;
+  xmlAutomataNewState: function(am: xmlAutomataPtr): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewTransition: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token: xmlCharPtr; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewTransition2: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token, token2: xmlCharPtr; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewNegTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token, token2: xmlCharPtr; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewCountTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token: xmlCharPtr; min, max: cint; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewCountTrans2: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token, token2: xmlCharPtr; min, max: cint; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewOnceTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token: xmlCharPtr; min, max: cint; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewOnceTrans2: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; token, token2: xmlCharPtr; min, max: cint; data: pointer): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewAllTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; lax: cint): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewEpsilon: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewCountedTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; counter: cint): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewCounterTrans: function(am: xmlAutomataPtr; from, _to: xmlAutomataStatePtr; counter: cint): xmlAutomataStatePtr; EXTDECL;
+  xmlAutomataNewCounter: function(am: xmlAutomataPtr; min, max: cint): cint; EXTDECL;
+  xmlAutomataCompile: function(am: xmlAutomataPtr): xmlRegexpPtr; EXTDECL;
+  xmlAutomataIsDeterminist: function(am: xmlAutomataPtr): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_AUTOMATA_ENABLED *)
 {$ENDIF} (* LIBXML_REGEXP_ENABLED *)
 

+ 70 - 6
packages/libxml/src/xmlerror.inc

@@ -59,7 +59,9 @@
     XML_FROM_WRITER,	(* The xmlwriter module *)
     XML_FROM_MODULE,	(* The dynamically loaded module module*)
     XML_FROM_I18N, 	(* The module handling character conversion *)
-    XML_FROM_SCHEMATRONV	(* The Schematron validator module *)
+    XML_FROM_SCHEMATRONV,	(* The Schematron validator module *)
+    XML_FROM_BUFFER,    (* The buffers module *)
+    XML_FROM_URI        (* The URI module *)
   );
 
 (**
@@ -197,11 +199,16 @@
     XML_ERR_NOTATION_PROCESSING, (* 105 *)
     XML_WAR_NS_COLUMN, (* 106 *)
     XML_WAR_ENTITY_REDEFINED, (* 107 *)
+    XML_ERR_UNKNOWN_VERSION, (* 108 *)
+    XML_ERR_VERSION_MISMATCH, (* 109 *)
+    XML_ERR_NAME_TOO_LONG, (* 110 *)
+    XML_ERR_USER_STOP, (* 111 *)
     XML_NS_ERR_XML_NAMESPACE = 200,
     XML_NS_ERR_UNDEFINED_NAMESPACE, (* 201 *)
     XML_NS_ERR_QNAME, (* 202 *)
     XML_NS_ERR_ATTRIBUTE_REDEFINED, (* 203 *)
     XML_NS_ERR_EMPTY, (* 204 *)
+    XML_NS_ERR_COLON, (* 205 *)
     XML_DTD_ATTRIBUTE_DEFAULT = 500,
     XML_DTD_ATTRIBUTE_REDEFINED, (* 501 *)
     XML_DTD_ATTRIBUTE_VALUE, (* 502 *)
@@ -243,6 +250,7 @@
     XML_DTD_STANDALONE_DEFAULTED, (* 538 *)
     XML_DTD_XMLID_VALUE, (* 539 *)
     XML_DTD_XMLID_TYPE, (* 540 *)
+    XML_DTD_DUP_TOKEN, (* 541 *)
     XML_HTML_STRUCURE_ERROR = 800,
     XML_HTML_UNKNOWN_TAG, (* 801 *)
     XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
@@ -815,10 +823,8 @@
     XML_I18N_NO_HANDLER, (* 6001 *)
     XML_I18N_EXCESS_HANDLER, (* 6002 *)
     XML_I18N_CONV_FAILED, (* 6003 *)
-    XML_I18N_NO_OUTPUT (* 6004 *)
-//    XML_CHECK_, (* 5033 *)
-//    XML_CHECK_X (* 503 *)
-  );
+    XML_I18N_NO_OUTPUT, (* 6004 *)
+    XML_BUF_OVERFLOW = 7000  );
 
 (**
  * xmlGenericErrorFunc:
@@ -871,7 +877,7 @@ procedure xmlResetLastError; EXTDECL; external xml2lib;
 function xmlCtxtGetLastError(ctx: pointer): xmlErrorPtr; EXTDECL; external xml2lib;
 procedure xmlCtxtResetLastError(ctx: pointer); EXTDECL; external xml2lib;
 procedure xmlResetError(err: xmlErrorPtr); EXTDECL; external xml2lib;
-function xmlResetError(from, _to: xmlErrorPtr): cint; EXTDECL; external xml2lib;
+function xmlCopyError(from, _to: xmlErrorPtr): cint; EXTDECL; external xml2lib;
 
 (*
  * Internal callback reporting routine
@@ -904,3 +910,61 @@ procedure __xmlSimpleError(
   extra: PAnsiChar
 ); EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlSetGenericErrorFunc: procedure(ctx: pointer; handler: xmlGenericErrorFunc); EXTDECL;
+  initGenericErrorDefaultFunc: procedure(var handler: xmlGenericErrorFunc); EXTDECL;
+  xmlSetStructuredErrorFunc: procedure(ctx: pointer; handler: xmlStructuredErrorFunc); EXTDECL;
+
+(*
+ * Default message routines used by SAX and Valid context for error
+ * and warning reporting.
+ *)
+  xmlParserError: procedure(ctx: pointer; msg: PAnsiChar; args: array of const); EXTDECL;
+  xmlParserWarning: procedure(ctx: pointer; msg: PAnsiChar; args: array of const); EXTDECL;
+  xmlParserValidityError: procedure(ctx: pointer; msg: PAnsiChar; args: array of const); EXTDECL;
+  xmlParserValidityWarning: procedure(ctx: pointer; msg: PAnsiChar; args: array of const); EXTDECL;
+  xmlParserPrintFileInfo: procedure(input: xmlParserInputPtr); EXTDECL;
+  xmlParserPrintFileContext: procedure(input: xmlParserInputPtr); EXTDECL;
+
+(*
+ * Extended error information routines
+ *)
+  xmlGetLastError: function: xmlErrorPtr; EXTDECL;
+  xmlResetLastError: procedure; EXTDECL;
+  xmlCtxtGetLastError: function(ctx: pointer): xmlErrorPtr; EXTDECL;
+  xmlCtxtResetLastError: procedure(ctx: pointer); EXTDECL;
+  xmlResetError: procedure(err: xmlErrorPtr); EXTDECL;
+  xmlCopyError: function(from, _to: xmlErrorPtr): cint; EXTDECL;
+
+(*
+ * Internal callback reporting routine
+ *)
+  __xmlRaiseError: procedure(
+    schannel: xmlStructuredErrorFunc;
+    channel: xmlGenericErrorFunc;
+    data: pointer;
+    ctx: pointer;
+    node: pointer;
+    domain: cint;
+    code: cint;
+    level: xmlErrorLevel;
+    _file: PAnsiChar;
+    line: cint;
+    str1: PAnsiChar;
+    str2: PAnsiChar;
+    str3: PAnsiChar;
+    int1: cint;
+    col: cint;
+    msg: PAnsiChar;
+    args: array of const
+  ); EXTDECL;
+
+  __xmlSimpleError: procedure(
+    domain: cint;
+    code: cint;
+    node: xmlNodePtr;
+    msg: PAnsiChar;
+    extra: PAnsiChar
+  ); EXTDECL;
+{$ENDIF}

+ 42 - 0
packages/libxml/src/xmlmemory.inc

@@ -126,6 +126,7 @@ procedure xmlCleanupMemory(); EXTDECL; external xml2lib;
 function xmlMemUsed(): cint; EXTDECL; external xml2lib;
 function xmlMemBlocks(): cint; EXTDECL; external xml2lib;
 procedure xmlMemDisplay(fp: PFILE); EXTDECL; external xml2lib;
+procedure xmlMemDisplayLast(fp: PFILE; nbBytes: clong); EXTDECL; external xml2lib;
 procedure xmlMemShow(fp: PFILE; nr: cint); EXTDECL; external xml2lib;
 procedure xmlMemoryDump(); EXTDECL; external xml2lib;
 function xmlMemMalloc(size: csize_t): pointer; EXTDECL; external xml2lib;
@@ -183,3 +184,44 @@ function xmlMemStrdupLoc(str: PAnsiChar; _file: PAnsiChar; line: cint): PAnsiCha
 
 {$ENDIF} (* DEBUG_MEMORY_LOCATION *)
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * The way to overload the existing functions.
+ * The xmlGc function have an extra entry for atomic block
+ * allocations useful for garbage collected memory allocators
+ *)
+  xmlMemSetup: function(freeFunc: xmlFreeFunc; mallocFunc: xmlMallocFunc; reallocFunc: xmlReallocFunc; strdupFunc: xmlStrdupFunc): cint; EXTDECL;
+  xmlMemGet: function(var freeFunc: xmlFreeFunc; var mallocFunc: xmlMallocFunc; var reallocFunc: xmlReallocFunc; var strdupFunc: xmlStrdupFunc): cint; EXTDECL;
+  xmlGcMemSetup: function(freeFunc: xmlFreeFunc; mallocFunc: xmlMallocFunc; mallocAtomicFunc: xmlMallocFunc; reallocFunc: xmlReallocFunc; strdupFunc: xmlStrdupFunc): cint; EXTDECL;
+  xmlGcMemGet: function(var freeFunc: xmlFreeFunc; var mallocFunc: xmlMallocFunc; var mallocAtomicFunc: xmlMallocFunc; var reallocFunc: xmlReallocFunc; var strdupFunc: xmlStrdupFunc): cint; EXTDECL;
+
+(*
+ * Initialization of the memory layer.
+ *)
+  xmlInitMemory: function(): cint; EXTDECL;
+
+(*
+ * Cleanup of the memory layer.
+ *)
+  xmlCleanupMemory: procedure(); EXTDECL;
+
+(*
+ * These are specific to the XML debug memory wrapper.
+ *)
+  xmlMemUsed: function(): cint; EXTDECL;
+  xmlMemBlocks: function(): cint; EXTDECL;
+  xmlMemDisplay: procedure(fp: PFILE); EXTDECL;
+  xmlMemDisplayLast: procedure(fp: PFILE; nbBytes: clong); EXTDECL;
+  xmlMemShow: procedure(fp: PFILE; nr: cint); EXTDECL;
+  xmlMemoryDump: procedure(); EXTDECL;
+  xmlMemMalloc: function(size: csize_t): pointer; EXTDECL;
+  xmlMemRealloc: function(ptr: pointer; size: csize_t): pointer; EXTDECL;
+  xmlMemFree: procedure(ptr: pointer); EXTDECL;
+  xmlMemoryStrdup: function(str: PAnsiChar): PAnsiChar; EXTDECL;
+
+  xmlMallocLoc: function(size: csize_t; _file: PAnsiChar; line: cint): pointer; EXTDECL;
+  xmlReallocLoc: function(ptr: pointer; size: csize_t; _file: PAnsiChar; line: cint): pointer; EXTDECL;
+  xmlMallocAtomicLoc: function(size: csize_t; _file: PAnsiChar; line: cint): pointer; EXTDECL;
+  xmlMemStrdupLoc: function(str: PAnsiChar; _file: PAnsiChar; line: cint): PAnsiChar; EXTDECL;
+{$ENDIF}

+ 7 - 0
packages/libxml/src/xmlmodule.inc

@@ -40,5 +40,12 @@ function xmlModuleClose(module: xmlModulePtr): cint; EXTDECL; external xml2lib;
 function xmlModuleFree(module: xmlModulePtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlModuleOpen: function(filename: AnsiChar; options: cint): xmlModulePtr; EXTDECL;
+  xmlModuleSymbol: function(module: xmlModulePtr; name: PAnsiChar; var result: pointer): cint; EXTDECL;
+  xmlModuleClose: function(module: xmlModulePtr): cint; EXTDECL;
+  xmlModuleFree: function(module: xmlModulePtr): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_MODULES_ENABLED *)
 

+ 133 - 0
packages/libxml/src/xmlreader.inc

@@ -227,6 +227,139 @@ procedure xmlTextReaderSetStructuredErrorHandler(reader: xmlTextReaderPtr; f: xm
 procedure xmlTextReaderGetErrorHandler(reader: xmlTextReaderPtr; var f: xmlTextReaderErrorFunc; var arg: pointer); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Constructors & Destructor
+ *)
+  xmlNewTextReader: function(input: xmlParserInputBufferPtr; URI: PAnsiChar): xmlTextReaderPtr; EXTDECL;
+  xmlNewTextReaderFilename: function(URI: PAnsiChar): xmlTextReaderPtr; EXTDECL;
+  xmlFreeTextReader: procedure(reader: xmlTextReaderPtr); EXTDECL;
+  xmlTextReaderSetup: function(reader: xmlTextReaderPtr; input: xmlParserInputBufferPtr; URL, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+
+(*
+ * Iterators
+ *)
+  xmlTextReaderRead: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+{$IFDEF LIBXML_WRITER_ENABLED}
+  xmlTextReaderReadInnerXml: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderReadOuterXml: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+{$ENDIF}
+  xmlTextReaderReadString: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderReadAttributeValue: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+
+(*
+ * Attributes of the node
+ *)
+  xmlTextReaderAttributeCount: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderDepth: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderHasAttributes: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderHasValue: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderIsDefault: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderIsEmptyElement: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderNodeType: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderQuoteChar: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderReadState: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderIsNamespaceDecl: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+
+  xmlTextReaderConstBaseUri: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstLocalName: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstName: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstNamespaceUri: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstPrefix: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstXmlLang: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstString: function(reader: xmlTextReaderPtr; str: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderConstValue: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * use the Const version of the routine for
+ * better performance and simpler code
+ *)
+  xmlTextReaderBaseUri: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderLocalName: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderName: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderNamespaceUri: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderPrefix: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderXmlLang: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderValue: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * Methods of the XmlTextReader
+ *)
+  xmlTextReaderClose: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderGetAttributeNo: function(reader: xmlTextReaderPtr; no: cint): xmlCharPtr; EXTDECL;
+  xmlTextReaderGetAttribute: function(reader: xmlTextReaderPtr; name: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderGetAttributeNs: function(reader: xmlTextReaderPtr; localName, namespaceURI: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderGetRemainder: function(reader: xmlTextReaderPtr): xmlParserInputBufferPtr; EXTDECL;
+  xmlTextReaderLookupNamespace: function(reader: xmlTextReaderPtr; prefix: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderMoveToAttributeNo: function(reader: xmlTextReaderPtr; no: cint): cint; EXTDECL;
+  xmlTextReaderMoveToAttribute: function(reader: xmlTextReaderPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextReaderMoveToAttributeNs: function(reader: xmlTextReaderPtr; localName, namespaceURI: xmlCharPtr): cint; EXTDECL;
+  xmlTextReaderMoveToFirstAttribute: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderMoveToNextAttribute: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderMoveToElement: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderNormalization: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderConstEncoding: function (reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * Extensions
+ *)
+  xmlTextReaderSetParserProp: function(reader: xmlTextReaderPtr; prop, value: cint): cint; EXTDECL;
+  xmlTextReaderGetParserProp: function(reader: xmlTextReaderPtr; prop: cint): cint; EXTDECL;
+  xmlTextReaderCurrentNode: function(reader: xmlTextReaderPtr): xmlNodePtr; EXTDECL;
+  xmlTextReaderGetParserLineNumber: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderGetParserColumnNumber: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderPreserve: function(reader: xmlTextReaderPtr): xmlNodePtr; EXTDECL;
+{$IFDEF LIBXML_PATTERN_ENABLED}
+  xmlTextReaderPreservePattern: function(reader: xmlTextReaderPtr; pattern: xmlCharPtr; namespaces: xmlCharPtrPtr): cint; EXTDECL;
+{$ENDIF} (* LIBXML_PATTERN_ENABLED *)
+  xmlTextReaderCurrentDoc: function(reader: xmlTextReaderPtr): xmlDocPtr; EXTDECL;
+  xmlTextReaderExpand: function(reader: xmlTextReaderPtr): xmlNodePtr; EXTDECL;
+  xmlTextReaderNext: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderNextSibling: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+  xmlTextReaderIsValid: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+{$IFDEF LIBXML_SCHEMAS_ENABLED}
+
+  xmlTextReaderRelaxNGValidate: function(reader: xmlTextReaderPtr; rng: PAnsiChar): cint; EXTDECL;
+  xmlTextReaderRelaxNGSetSchema: function(reader: xmlTextReaderPtr; schema: xmlRelaxNGPtr): cint; EXTDECL;
+  xmlTextReaderSchemaValidate: function(reader: xmlTextReaderPtr; xsd: PAnsiChar): cint; EXTDECL;
+  xmlTextReaderSchemaValidateCtxt: function(reader: xmlTextReaderPtr; ctxt: xmlSchemaValidCtxtPtr; options: cint): cint; EXTDECL;
+  xmlTextReaderSetSchema: function(reader: xmlTextReaderPtr; schema: xmlSchemaPtr): cint; EXTDECL;
+{$ENDIF}
+  xmlTextReaderConstXmlVersion: function(reader: xmlTextReaderPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderStandalone: function(reader: xmlTextReaderPtr): cint; EXTDECL;
+
+(*
+ * Index lookup
+ *)
+  xmlTextReaderByteConsumed: function(reader: xmlTextReaderPtr): clong; EXTDECL;
+
+(*
+ * New more complete APIs for simpler creation and reuse of readers
+ *)
+  xmlReaderWalker: function(doc: xmlDocPtr): xmlTextReaderPtr; EXTDECL;
+  xmlReaderForDoc: function(cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): xmlTextReaderPtr; EXTDECL;
+  xmlReaderForFile: function(filename, encoding: PAnsiChar; options: cint): xmlTextReaderPtr; EXTDECL;
+  xmlReaderForMemory: function(buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): xmlTextReaderPtr; EXTDECL;
+  xmlReaderForFd: function(fd: cint; URL, encoding: PAnsiChar; options: cint): xmlTextReaderPtr; EXTDECL;
+  xmlReaderForIO: function(ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): xmlTextReaderPtr; EXTDECL;
+
+  xmlReaderNewWalker: function(reader: xmlTextReaderPtr; doc: xmlDocPtr): cint; EXTDECL;
+  xmlReaderNewDoc: function(reader: xmlTextReaderPtr; cur: xmlCharPtr; URL, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+  xmlReaderNewFile: function(reader: xmlTextReaderPtr; filename, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+  xmlReaderNewMemory: function(reader: xmlTextReaderPtr; buffer: PAnsiChar; size: cint; URL, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+  xmlReaderNewFd: function(reader: xmlTextReaderPtr; fd: cint; URL, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+  xmlReaderNewIO: function(reader: xmlTextReaderPtr; ioread: xmlInputReadCallback; ioclose: xmlInputCloseCallback; ioctx: pointer; URL, encoding: PAnsiChar; options: cint): cint; EXTDECL;
+
+(*
+ * Error handling extensions
+ *)
+  xmlTextReaderLocatorLineNumber: function(locator: xmlTextReaderLocatorPtr): cint; EXTDECL;
+  xmlTextReaderLocatorBaseURI: function(locator: xmlTextReaderLocatorPtr): xmlCharPtr; EXTDECL;
+  xmlTextReaderSetErrorHandler: procedure(reader: xmlTextReaderPtr; f: xmlTextReaderErrorFunc; arg: pointer); EXTDECL;
+  xmlTextReaderSetStructuredErrorHandler: procedure(reader: xmlTextReaderPtr; f: xmlTextReaderErrorFunc; arg: pointer); EXTDECL;
+  xmlTextReaderGetErrorHandler: procedure(reader: xmlTextReaderPtr; var f: xmlTextReaderErrorFunc; var arg: pointer); EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_READER_ENABLED *)
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)
 

+ 69 - 11
packages/libxml/src/xmlregexp.inc

@@ -61,6 +61,27 @@ function xmlRegExecNextValues(exec: xmlRegExecCtxtPtr; nbval, nbneg: pcint; valu
 function xmlRegExecErrInfo(exec: xmlRegExecCtxtPtr; _string: xmlCharPtrPtr; nbval, nbneg: pcint; values: xmlCharPtrPtr; terminal: pcint): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * The POSIX like API
+ *)
+  xmlRegexpCompile: function(regexp: xmlCharPtr): xmlRegexpPtr; EXTDECL;
+  xmlRegFreeRegexp: procedure(regexp: xmlRegexpPtr); EXTDECL;
+  xmlRegexpExec: function(comp: xmlRegexpPtr; value: xmlCharPtr): cint; EXTDECL;
+  xmlRegexpPrint: procedure(output: PFILE; regexp: xmlRegexpPtr); EXTDECL;
+  xmlRegexpIsDeterminist: function(comp: xmlRegexpPtr): cint; EXTDECL;
+
+(*
+ * The progressive API
+ *)
+  xmlRegNewExecCtxt: function(comp: xmlRegexpPtr; callback: xmlRegExecCallbacks; data: pointer): xmlRegExecCtxtPtr; EXTDECL;
+  xmlRegFreeExecCtxt: procedure(exec: xmlRegExecCtxtPtr); EXTDECL;
+  xmlRegExecPushString: function(exec: xmlRegExecCtxtPtr; value: xmlCharPtr; data: pointer): cint; EXTDECL;
+  xmlRegExecPushString2: function(exec: xmlRegExecCtxtPtr; value, value2: xmlCharPtr; data: pointer): cint; EXTDECL;
+  xmlRegExecNextValues: function(exec: xmlRegExecCtxtPtr; nbval, nbneg: pcint; values: xmlCharPtrPtr; terminal: pcint): cint; EXTDECL;
+  xmlRegExecErrInfo: function(exec: xmlRegExecCtxtPtr; _string: xmlCharPtrPtr; nbval, nbneg: pcint; values: xmlCharPtrPtr; terminal: pcint): cint; EXTDECL;
+{$ENDIF}
+
 {$IFDEF LIBXML_EXPR_ENABLED}
 (*
  * Formal regular expression handling
@@ -85,21 +106,11 @@ function xmlRegExecErrInfo(exec: xmlRegExecCtxtPtr; _string: xmlCharPtrPtr; nbva
 {$ENDIF}
 
 {$IFDEF FUNCTION}
-procedure xmlRegFreeExecCtxt(ctxt: xmlExpCtxtPtr); EXTDECL; external xml2lib;
+procedure xmlExpFreeCtxt(ctxt: xmlExpCtxtPtr); EXTDECL; external xml2lib;
 function xmlExpNewCtxt(maxNodes: cint; dict: xmlDictPtr): xmlExpCtxtPtr; EXTDECL; external xml2lib;
 function xmlExpCtxtNbNodes(ctxt: xmlExpCtxtPtr): cint; EXTDECL; external xml2lib;
 function xmlExpCtxtNbCons(ctxt: xmlExpCtxtPtr): cint; EXTDECL; external xml2lib;
 
-(*
- * 2 core expressions shared by all for the empty language set
- * and for the set with just the empty token
- *)
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  forbiddenExp: xmlExpNodePtr; cvar; external;
-  emptyExp: xmlExpNodePtr; cvar; external;
-{$ENDIF}
-
 (*
  * Expressions are reference counted internally
  *)
@@ -127,5 +138,52 @@ function xmlExpExpDerive(ctxt: xmlExpCtxtPtr; expr, sub: xmlExpNodePtr): xmlExpN
 function xmlExpSubsume(ctxt: xmlExpCtxtPtr; expr, sub: xmlExpNodePtr): cint; EXTDECL; external xml2lib;
 procedure xmlExpDump(buf: xmlBufferPtr; expr: xmlExpNodePtr); EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xmlExpFreeCtxt: procedure(ctxt: xmlExpCtxtPtr); EXTDECL;
+  xmlExpNewCtxt: function(maxNodes: cint; dict: xmlDictPtr): xmlExpCtxtPtr; EXTDECL;
+  xmlExpCtxtNbNodes: function(ctxt: xmlExpCtxtPtr): cint; EXTDECL;
+  xmlExpCtxtNbCons: function(ctxt: xmlExpCtxtPtr): cint; EXTDECL;
+
+(*
+ * Expressions are reference counted internally
+ *)
+  xmlExpFree: procedure(ctxt: xmlExpCtxtPtr; expr: xmlExpNodePtr); EXTDECL;
+  xmlExpRef: procedure(expr: xmlExpNodePtr); EXTDECL;
+
+(*
+ * constructors can be either manual or from a string
+ *)
+  xmlExpParse: function(ctxt: xmlExpCtxtPtr; expr: PAnsiChar): xmlExpNodePtr; EXTDECL;
+  xmlExpNewAtom: function(ctxt: xmlExpCtxtPtr; name: xmlCharPtr; len: cint): xmlExpNodePtr; EXTDECL;
+  xmlExpNewOr: function(ctxt: xmlExpCtxtPtr; left, right: xmlExpNodePtr): xmlExpNodePtr; EXTDECL;
+  xmlExpNewSeq: function(ctxt: xmlExpCtxtPtr; left, right: xmlExpNodePtr): xmlExpNodePtr; EXTDECL;
+  xmlExpNewRange: function(ctxt: xmlExpCtxtPtr; subset: xmlExpNodePtr; min, max: cint): xmlExpNodePtr; EXTDECL;
+
+(*
+ * The really interesting APIs
+ *)
+  xmlExpIsNillable: function(expr: xmlExpNodePtr): cint; EXTDECL;
+  xmlExpMaxToken: function(expr: xmlExpNodePtr): cint; EXTDECL;
+  xmlExpGetLanguage: function(ctxt: xmlExpCtxtPtr; expr: xmlExpNodePtr; langList: xmlCharPtrPtr; len: cint): cint; EXTDECL;
+  xmlExpGetStart: function(ctxt: xmlExpCtxtPtr; expr: xmlExpNodePtr; tokList: xmlCharPtrPtr; len: cint): cint; EXTDECL;
+  xmlExpStringDerive: function(ctxt: xmlExpCtxtPtr; expr: xmlExpNodePtr; str: xmlCharPtr; len: cint): xmlExpNodePtr; EXTDECL;
+  xmlExpExpDerive: function(ctxt: xmlExpCtxtPtr; expr, sub: xmlExpNodePtr): xmlExpNodePtr; EXTDECL;
+  xmlExpSubsume: function(ctxt: xmlExpCtxtPtr; expr, sub: xmlExpNodePtr): cint; EXTDECL;
+  xmlExpDump: procedure(buf: xmlBufferPtr; expr: xmlExpNodePtr); EXTDECL;
+{$ENDIF}
+
+{$IFDEF EXTVAR}
+(*
+ * 2 core expressions shared by all for the empty language set
+ * and for the set with just the empty token
+ *)
+{$IFNDEF NO_EXTERNAL_VARS}
+var
+  forbiddenExp: xmlExpNodePtr; cvar; external;
+  emptyExp: xmlExpNodePtr; cvar; external;
+{$ENDIF}
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_EXPR_ENABLED *)
 {$ENDIF} (* LIBXML_REGEXP_ENABLED *)

+ 21 - 4
packages/libxml/src/xmlsave.inc

@@ -26,10 +26,14 @@
 {$ENDIF}
 
 {$IFDEF CONST}
-  XML_SAVE_FORMAT     = 1 shl 0;	(* format save output *)
-  XML_SAVE_NO_DECL    = 1 shl 1;	(* drop the xml declaration *)
-  XML_SAVE_NO_EMPTY	= 1 shl 2; (* no empty tags *)
-  XML_SAVE_NO_XHTML	= 1 shl 3;  (* disable XHTML1 specific rules *)
+  XML_SAVE_FORMAT     = (1 shl 0);   (* format save output *)
+  XML_SAVE_NO_DECL    = (1 shl 1);   (* drop the xml declaration *)
+  XML_SAVE_NO_EMPTY   = (1 shl 2);   (* no empty tags *)
+  XML_SAVE_NO_XHTML   = (1 shl 3);   (* disable XHTML1 specific rules *)
+  XML_SAVE_XHTML      = (1 shl 4);   (* force XHTML1 specific rules *)
+  XML_SAVE_AS_XML     = (1 shl 5);   (* force XML serialization on HTML doc *)
+  XML_SAVE_AS_HTML    = (1 shl 6);   (* force HTML serialization on XML doc *)
+  XML_SAVE_WSNONSIG   = (1 shl 7);   (* format with non-significant whitespace *)
 {$ENDIF}
 
 {$IFDEF FUNCTION}
@@ -45,6 +49,19 @@ function xmlSaveClose(ctxt: xmlSaveCtxtPtr): cint; EXTDECL; external xml2lib;
 function xmlSaveSetEscape(ctxt: xmlSaveCtxtPtr; escape: xmlCharEncodingOutputFunc): cint; EXTDECL; external xml2lib;
 function xmlSaveSetAttrEscape(ctxt: xmlSaveCtxtPtr; escape: xmlCharEncodingOutputFunc): cint; EXTDECL; external xml2lib;
 {$ENDIF}
+{$IFDEF FUNCTIONVAR}
+  xmlSaveToFd: function(fd: cint; encoding: PAnsiChar; options: cint): xmlSaveCtxtPtr; EXTDECL;
+  xmlSaveToFilename: function(filename: PAnsiChar; encoding: PAnsiChar; options: cint): xmlSaveCtxtPtr; EXTDECL;
+  xmlSaveToBuffer: function(buffer: xmlBufferPtr; encoding: PAnsiChar; options: cint): xmlSaveCtxtPtr; EXTDECL;
+  xmlSaveToIO: function(iowrite: xmlOutputWriteCallback; ioclose: xmlOutputCloseCallback; ioctx: pointer; encoding: PAnsiChar; options: cint): xmlSaveCtxtPtr; EXTDECL;
+
+  xmlSaveDoc: function(ctxt: xmlSaveCtxtPtr; doc: xmlDocPtr): clong; EXTDECL;
+  xmlSaveTree: function(ctxt: xmlSaveCtxtPtr; node: xmlNodePtr): clong; EXTDECL;
+  xmlSaveFlush: function(ctxt: xmlSaveCtxtPtr): cint; EXTDECL;
+  xmlSaveClose: function(ctxt: xmlSaveCtxtPtr): cint; EXTDECL;
+  xmlSaveSetEscape: function(ctxt: xmlSaveCtxtPtr; escape: xmlCharEncodingOutputFunc): cint; EXTDECL;
+  xmlSaveSetAttrEscape: function(ctxt: xmlSaveCtxtPtr; escape: xmlCharEncodingOutputFunc): cint; EXTDECL;
+{$ENDIF}
 {$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
 
 

+ 65 - 4
packages/libxml/src/xmlschemas.inc

@@ -94,6 +94,21 @@
   xmlSchemaValidCtxt = record end;
 
   xmlSchemaSAXPlugStruct = record end;
+
+(**
+ * xmlSchemaValidityLocatorFunc:
+ * @ctx: user provided context
+ * @file: returned file information
+ * @line: returned line information
+ *
+ * A schemas validation locator, a callback called by the validator.
+ * This is used when file or node informations are not available
+ * to find out what file and line number are affected
+ *
+ * Returns: 0 in case of success and -1 in case of error
+ *)
+
+  xmlSchemaValidityLocatorFunc = function(ctx: pointer; const _file: PPAnsiChar; line: pculong): cint; cdecl;
 {$ENDIF}
 
 {$IFDEF FUNCTION}
@@ -106,7 +121,7 @@ function xmlSchemaNewDocParserCtxt(doc: xmlDocPtr): xmlSchemaParserCtxtPtr; EXTD
 procedure xmlSchemaFreeParserCtxt(ctxt: xmlSchemaParserCtxtPtr); EXTDECL; external xml2lib;
 procedure xmlSchemaSetParserErrors(ctxt: xmlSchemaParserCtxtPtr; err: xmlSchemaValidityErrorFunc; warn: xmlSchemaValidityWarningFunc; ctx: pointer); EXTDECL; external xml2lib;
 procedure xmlSchemaSetParserStructuredErrors(ctxt: xmlSchemaParserCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
-function xmlSchemaSetParserErrors(ctxt: xmlSchemaParserCtxtPtr; var err: xmlSchemaValidityErrorFunc; var warn: xmlSchemaValidityWarningFunc; var ctx: pointer): cint; EXTDECL; external xml2lib;
+function xmlSchemaGetParserErrors(ctxt: xmlSchemaParserCtxtPtr; var err: xmlSchemaValidityErrorFunc; var warn: xmlSchemaValidityWarningFunc; var ctx: pointer): cint; EXTDECL; external xml2lib;
 function xmlSchemaIsValid(ctxt: xmlSchemaValidCtxtPtr): cint; EXTDECL; external xml2lib;
 function xmlSchemaParse(ctxt: xmlSchemaParserCtxtPtr): xmlSchemaPtr; EXTDECL; external xml2lib;
 procedure xmlSchemaFree(schema: xmlSchemaPtr); EXTDECL; external xml2lib;
@@ -117,17 +132,20 @@ procedure xmlSchemaDump(output: PFILE; schema: xmlSchemaPtr); EXTDECL; external
 (*
  * Interfaces for validating
  *)
-procedure xmlSchemaSetValidErrors(ctxt: xmlSchemaParserCtxtPtr; err: xmlSchemaValidityErrorFunc; warn: xmlSchemaValidityWarningFunc; ctx: pointer); EXTDECL; external xml2lib;
-procedure xmlSchemaSetValidStructuredErrors(ctxt: xmlSchemaParserCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
+procedure xmlSchemaSetValidErrors(ctxt: xmlSchemaValidCtxtPtr; err: xmlSchemaValidityErrorFunc; warn: xmlSchemaValidityWarningFunc; ctx: pointer); EXTDECL; external xml2lib;
+procedure xmlSchemaSetValidStructuredErrors(ctxt: xmlSchemaValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL; external xml2lib;
 function xmlSchemaGetValidErrors(ctxt: xmlSchemaParserCtxtPtr; var err: xmlSchemaValidityErrorFunc; var warn: xmlSchemaValidityWarningFunc; var ctx: pointer): cint; EXTDECL; external xml2lib;
 function xmlSchemaSetValidOptions(ctxt: xmlSchemaValidCtxtPtr; options: cint): cint; EXTDECL; external xml2lib;
 function xmlSchemaValidCtxtGetOptions(ctxt: xmlSchemaValidCtxtPtr): cint; EXTDECL; external xml2lib;
 function xmlSchemaNewValidCtxt(schema: xmlSchemaPtr): xmlSchemaValidCtxtPtr; EXTDECL; external xml2lib;
+function xmlSchemaValidCtxtGetParserCtxt(ctxt: xmlSchemaValidCtxtPtr): xmlParserCtxtPtr; EXTDECL; external xml2lib;
 procedure xmlSchemaFreeValidCtxt(ctxt: xmlSchemaValidCtxtPtr); EXTDECL; external xml2lib;
-function xmlSchemaNewValidCtxt(ctxt: xmlSchemaValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL; external xml2lib;
+function xmlSchemaValidateDoc(ctxt: xmlSchemaValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL; external xml2lib;
 function xmlSchemaValidateOneElement(ctxt: xmlSchemaValidCtxtPtr; elem: xmlNodePtr): cint; EXTDECL; external xml2lib;
 function xmlSchemaValidateStream(ctxt: xmlSchemaValidCtxtPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding; sax: xmlSAXHandlerPtr; user_data: pointer): cint; EXTDECL; external xml2lib;
 function xmlSchemaValidateFile(ctxt: xmlSchemaValidCtxtPtr; filename: PAnsiChar; options: cint): cint; EXTDECL; external xml2lib;
+procedure xmlSchemaValidateSetFilename(vctxt: xmlSchemaValidCtxtPtr; const filename: PAnsiChar); EXTDECL; external xml2lib;
+procedure xmlSchemaValidateSetLocator(vctxt: xmlSchemaValidCtxtPtr; f: xmlSchemaValidityLocatorFunc; ctxt: Pointer); EXTDECL; external xml2lib;
 
 (*
  * Interface to insert Schemas SAX velidation in a SAX stream
@@ -136,4 +154,47 @@ function xmlSchemaSAXPlug(ctxt: xmlSchemaValidCtxtPtr; var sax: xmlSchemaSAXPlug
 function xmlSchemaSAXUnplug(plug: xmlSchemaSAXPlugPtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Interfaces for parsing.
+ *)
+  xmlSchemaNewParserCtxt: function(URL: PAnsiChar): xmlSchemaParserCtxtPtr; EXTDECL;
+  xmlSchemaNewMemParserCtxt: function(buffer: PAnsiChar; size: cint): xmlSchemaParserCtxtPtr; EXTDECL;
+  xmlSchemaNewDocParserCtxt: function(doc: xmlDocPtr): xmlSchemaParserCtxtPtr; EXTDECL;
+  xmlSchemaFreeParserCtxt: procedure(ctxt: xmlSchemaParserCtxtPtr); EXTDECL;
+  xmlSchemaSetParserErrors: procedure(ctxt: xmlSchemaParserCtxtPtr; err: xmlSchemaValidityErrorFunc; warn: xmlSchemaValidityWarningFunc; ctx: pointer); EXTDECL;
+  xmlSchemaSetParserStructuredErrors: procedure(ctxt: xmlSchemaParserCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL;
+  xmlSchemaGetParserErrors: function(ctxt: xmlSchemaParserCtxtPtr; var err: xmlSchemaValidityErrorFunc; var warn: xmlSchemaValidityWarningFunc; var ctx: pointer): cint; EXTDECL;
+  xmlSchemaIsValid: function(ctxt: xmlSchemaValidCtxtPtr): cint; EXTDECL;
+  xmlSchemaParse: function(ctxt: xmlSchemaParserCtxtPtr): xmlSchemaPtr; EXTDECL;
+  xmlSchemaFree: procedure(schema: xmlSchemaPtr); EXTDECL;
+{$IFDEF LIBXML_OUTPUT_ENABLED}
+  xmlSchemaDump: procedure(output: PFILE; schema: xmlSchemaPtr); EXTDECL;
+{$ENDIF} (* LIBXML_OUTPUT_ENABLED *)
+
+(*
+ * Interfaces for validating
+ *)
+  xmlSchemaSetValidErrors: procedure(ctxt: xmlSchemaValidCtxtPtr; err: xmlSchemaValidityErrorFunc; warn: xmlSchemaValidityWarningFunc; ctx: pointer); EXTDECL;
+  xmlSchemaSetValidStructuredErrors: procedure(ctxt: xmlSchemaValidCtxtPtr; serror: xmlStructuredErrorFunc; ctx: pointer); EXTDECL;
+  xmlSchemaGetValidErrors: function(ctxt: xmlSchemaParserCtxtPtr; var err: xmlSchemaValidityErrorFunc; var warn: xmlSchemaValidityWarningFunc; var ctx: pointer): cint; EXTDECL;
+  xmlSchemaSetValidOptions: function(ctxt: xmlSchemaValidCtxtPtr; options: cint): cint; EXTDECL;
+  xmlSchemaValidCtxtGetOptions: function(ctxt: xmlSchemaValidCtxtPtr): cint; EXTDECL;
+  xmlSchemaNewValidCtxt: function(schema: xmlSchemaPtr): xmlSchemaValidCtxtPtr; EXTDECL;
+  xmlSchemaValidCtxtGetParserCtxt: function(ctxt: xmlSchemaValidCtxtPtr): xmlParserCtxtPtr; EXTDECL;
+  xmlSchemaFreeValidCtxt: procedure(ctxt: xmlSchemaValidCtxtPtr); EXTDECL;
+  xmlSchemaValidateDoc: function(ctxt: xmlSchemaValidCtxtPtr; instance: xmlDocPtr): cint; EXTDECL;
+  xmlSchemaValidateOneElement: function(ctxt: xmlSchemaValidCtxtPtr; elem: xmlNodePtr): cint; EXTDECL;
+  xmlSchemaValidateStream: function(ctxt: xmlSchemaValidCtxtPtr; input: xmlParserInputBufferPtr; enc: xmlCharEncoding; sax: xmlSAXHandlerPtr; user_data: pointer): cint; EXTDECL;
+  xmlSchemaValidateFile: function(ctxt: xmlSchemaValidCtxtPtr; filename: PAnsiChar; options: cint): cint; EXTDECL;
+  xmlSchemaValidateSetFilename: procedure(vctxt: xmlSchemaValidCtxtPtr; const filename: PAnsiChar); EXTDECL;
+  xmlSchemaValidateSetLocator: procedure(vctxt: xmlSchemaValidCtxtPtr; f: xmlSchemaValidityLocatorFunc; ctxt: Pointer); EXTDECL;
+
+(*
+ * Interface to insert Schemas SAX velidation in a SAX stream
+ *)
+  xmlSchemaSAXPlug: function(ctxt: xmlSchemaValidCtxtPtr; var sax: xmlSchemaSAXPlugPtr; var user_data: pointer): xmlSchemaSAXPlugPtr; EXTDECL;
+  xmlSchemaSAXUnplug: function(plug: xmlSchemaSAXPlugPtr): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)

+ 38 - 0
packages/libxml/src/xmlschemastypes.inc

@@ -57,4 +57,42 @@ function xmlSchemaCopyValue(val: xmlSchemaValPtr): xmlSchemaValPtr; EXTDECL; ext
 function xmlSchemaGetValType(val: xmlSchemaValPtr): xmlSchemaValType; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlSchemaInitTypes: procedure; EXTDECL;
+  xmlSchemaCleanupTypes: procedure; EXTDECL;
+  xmlSchemaGetPredefinedType: function(name, ns: xmlCharPtr): xmlSchemaTypePtr; EXTDECL;
+  xmlSchemaValidatePredefinedType: function(_type: xmlSchemaTypePtr; value: xmlCharPtr; var val: xmlSchemaValPtr): cint; EXTDECL;
+  xmlSchemaValPredefTypeNode: function(_type: xmlSchemaTypePtr; value: xmlCharPtr; var val: xmlSchemaValPtr; node: xmlNodePtr): cint; EXTDECL;
+  xmlSchemaValidateFacet: function(base: xmlSchemaTypePtr; facet: xmlSchemaFacetPtr; value: xmlCharPtr; val: xmlSchemaValPtr): cint; EXTDECL;
+  xmlSchemaValidateFacetWhtsp: function(facet: xmlSchemaFacetPtr; fws: xmlSchemaWhitespaceValueType; valType: xmlSchemaValType;
+    value: xmlCharPtr; val: xmlSchemaValPtr; ws: xmlSchemaWhitespaceValueType): cint; EXTDECL;
+  xmlSchemaFreeValue: procedure(val: xmlSchemaValPtr); EXTDECL;
+  xmlSchemaNewFacet: function: xmlSchemaFacetPtr; EXTDECL;
+  xmlSchemaCheckFacet: function(facet: xmlSchemaFacetPtr; typeDecl: xmlSchemaTypePtr; ctxt: xmlSchemaParserCtxtPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlSchemaFreeFacet: procedure(facet: xmlSchemaFacetPtr); EXTDECL;
+  xmlSchemaCompareValues: function(x, y: xmlSchemaValPtr): cint; EXTDECL;
+  xmlSchemaGetBuiltInListSimpleTypeItemType: function(_type: xmlSchemaTypePtr): xmlSchemaTypePtr; EXTDECL;
+  xmlSchemaValidateListSimpleTypeFacet: function(facet: xmlSchemaFacetPtr; value: xmlCharPtr; actualLen: culong; expectedLen: pculong): cint; EXTDECL;
+  xmlSchemaGetBuiltInType: function(_type: xmlSchemaValType): xmlSchemaTypePtr; EXTDECL;
+  xmlSchemaIsBuiltInTypeFacet: function(_type: xmlSchemaTypePtr; faceType: cint): xmlSchemaTypePtr; EXTDECL;
+  xmlSchemaCollapseString: function(value: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlSchemaWhiteSpaceReplace: function(value: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlSchemaGetFacetValueAsULong: function(facet: xmlSchemaFacetPtr): culong; EXTDECL;
+  xmlSchemaValidateLengthFacet: function(_type: xmlSchemaTypePtr; facet: xmlSchemaFacetPtr; value: xmlCharPtr; val: xmlSchemaValPtr; length: pculong): cint; EXTDECL;
+  xmlSchemaValidateLengthFacetWhtsp: function(facet: xmlSchemaFacetPtr; valType: xmlSchemaValType; value: xmlCharPtr; val: xmlSchemaValPtr; length: pculong; ws: xmlSchemaWhitespaceValueType): cint; EXTDECL;
+  xmlSchemaValPredefTypeNodeNoNorm: function(_type: xmlSchemaTypePtr; value: xmlCharPtr; val: xmlSchemaValPtrPtr; node: xmlNodePtr): cint; EXTDECL;
+  xmlSchemaGetCanonValue: function(val: xmlSchemaValPtr; var retValue: xmlCharPtr): cint; EXTDECL;
+  xmlSchemaGetCanonValueWhtsp: function(val: xmlSchemaValPtr; var retValue: xmlCharPtr; ws: xmlSchemaWhitespaceValueType): cint; EXTDECL;
+  xmlSchemaValueAppend: function(prev, cur: xmlSchemaValPtr): cint; EXTDECL;
+  xmlSchemaValueGetNext: function(cur: xmlSchemaValPtr): xmlSchemaValPtr; EXTDECL;
+  xmlSchemaValueGetAsString: function(val: xmlSchemaValPtr): xmlCharPtr; EXTDECL;
+  xmlSchemaValueGetAsBoolean: function(val: xmlSchemaValPtr): cint; EXTDECL;
+  xmlSchemaNewStringValue: function(_type: xmlSchemaValType; value: xmlCharPtr): xmlSchemaValPtr; EXTDECL;
+  xmlSchemaNewNOTATIONValue: function(name, ns: xmlCharPtr): xmlSchemaValPtr; EXTDECL;
+  xmlSchemaNewQNameValue: function(namespaceName, localName: xmlCharPtr): xmlSchemaValPtr; EXTDECL;
+  xmlSchemaCompareValuesWhtsp: function(x: xmlSchemaValPtr; xws: xmlSchemaWhitespaceValueType; y: xmlSchemaValPtr; yws: xmlSchemaWhitespaceValueType): cint; EXTDECL;
+  xmlSchemaCopyValue: function(val: xmlSchemaValPtr): xmlSchemaValPtr; EXTDECL;
+  xmlSchemaGetValType: function(val: xmlSchemaValPtr): xmlSchemaValType; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_SCHEMAS_ENABLED *)

+ 43 - 0
packages/libxml/src/xmlstring.inc

@@ -66,3 +66,46 @@ function xmlUTF8Strlen(utf: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlUTF8Size(utf: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlUTF8Charcmp(utf1: xmlCharPtr; utf2: xmlCharPtr): cint; EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(**
+ * BAD_CAST:
+ *
+ * Macro to cast a string to an xmlChar * when one know its safe.
+ *)
+//function BAD_CAST(str: string): xmlCharPtr; inline;
+
+(*
+ * xmlChar handling
+ *)
+  xmlStrdup: function(cur: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlStrndup: function(cur: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlCharStrndup: function(cur: PAnsiChar; len: cint): xmlCharPtr; EXTDECL;
+  xmlCharStrdup: function(cur: PAnsiChar): xmlCharPtr; EXTDECL;
+  xmlStrsub: function(str: xmlCharPtr; start: cint; len: cint): xmlCharPtr; EXTDECL;
+  xmlStrchr: function(str: xmlCharPtr; val: xmlChar): xmlCharPtr; EXTDECL;
+  xmlStrstr: function(str: xmlCharPtr; val: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlStrcasestr: function(str: xmlCharPtr; val: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlStrcmp: function(str1: xmlCharPtr; str2: xmlCharPtr): cint; EXTDECL;
+  xmlStrncmp: function(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlStrcasecmp: function(str1: xmlCharPtr; str2: xmlCharPtr): cint; EXTDECL;
+  xmlStrncasecmp: function(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlStrEqual: function(str1: xmlCharPtr; str2: xmlCharPtr): cint; EXTDECL;
+  xmlStrQEqual: function(pref: xmlCharPtr; name: xmlCharPtr; str: xmlCharPtr): cint; EXTDECL;
+  xmlStrlen: function(str: xmlCharPtr): cint; EXTDECL;
+  xmlStrcat: function(cur: xmlCharPtr; add: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlStrncat: function(cur: xmlCharPtr; add: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlStrncatNew: function(str1: xmlCharPtr; str2: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlStrPrintf: function(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; args: array of const): cint; cdecl;
+  xmlStrVPrintf: function(buf: xmlCharPtr; len: cint; msg: xmlCharPtr; ap: va_list): cint; EXTDECL;
+  xmlGetUTF8Char: function(utf: PAnsiChar; len: pcint): cint; EXTDECL;
+  xmlCheckUTF8: function(utf: PAnsiChar): cint; EXTDECL;
+  xmlUTF8Strsize: function(utf: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlUTF8Strndup: function(utf: xmlCharPtr; len: cint): xmlCharPtr; EXTDECL;
+  xmlUTF8Strpos: function(utf: xmlCharPtr; pos: cint): xmlCharPtr; EXTDECL;
+  xmlUTF8Strloc: function(utf: xmlCharPtr; utfchar: xmlCharPtr): cint; EXTDECL;
+  xmlUTF8Strsub: function(str: xmlCharPtr; start: cint; len: cint): xmlCharPtr; EXTDECL;
+  xmlUTF8Strlen: function(utf: xmlCharPtr): cint; EXTDECL;
+  xmlUTF8Size: function(utf: xmlCharPtr): cint; EXTDECL;
+  xmlUTF8Charcmp: function(utf1: xmlCharPtr; utf2: xmlCharPtr): cint; EXTDECL;
+{$ENDIF}

+ 172 - 0
packages/libxml/src/xmlunicode.inc

@@ -186,5 +186,177 @@ function xmlUCSIsCatZs	(code: cint): cint; EXTDECL; external xml2lib;
 function xmlUCSIsCat  (code: cint; cat: PAnsiChar): cint; EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+  xmlUCSIsAegeanNumbers: function(code: cint): cint; EXTDECL;
+  xmlUCSIsAlphabeticPresentationForms: function(code: cint): cint; EXTDECL;
+  xmlUCSIsArabic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsArabicPresentationFormsA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsArabicPresentationFormsB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsArmenian: function(code: cint): cint; EXTDECL;
+  xmlUCSIsArrows: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBasicLatin: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBengali: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBlockElements: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBopomofo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBopomofoExtended: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBoxDrawing: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBraillePatterns: function(code: cint): cint; EXTDECL;
+  xmlUCSIsBuhid: function(code: cint): cint; EXTDECL;
+  xmlUCSIsByzantineMusicalSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKCompatibility: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKCompatibilityForms: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKCompatibilityIdeographs: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKCompatibilityIdeographsSupplement: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKRadicalsSupplement: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKSymbolsandPunctuation: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKUnifiedIdeographs: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKUnifiedIdeographsExtensionA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCJKUnifiedIdeographsExtensionB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCherokee: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCombiningDiacriticalMarks: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCombiningDiacriticalMarksforSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCombiningHalfMarks: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCombiningMarksforSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsControlPictures: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCurrencySymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCypriotSyllabary: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCyrillic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCyrillicSupplement: function(code: cint): cint; EXTDECL;
+  xmlUCSIsDeseret: function(code: cint): cint; EXTDECL;
+  xmlUCSIsDevanagari: function(code: cint): cint; EXTDECL;
+  xmlUCSIsDingbats: function(code: cint): cint; EXTDECL;
+  xmlUCSIsEnclosedAlphanumerics: function(code: cint): cint; EXTDECL;
+  xmlUCSIsEnclosedCJKLettersandMonths: function(code: cint): cint; EXTDECL;
+  xmlUCSIsEthiopic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGeneralPunctuation: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGeometricShapes: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGeorgian: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGothic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGreek: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGreekExtended: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGreekandCoptic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGujarati: function(code: cint): cint; EXTDECL;
+  xmlUCSIsGurmukhi: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHalfwidthandFullwidthForms: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHangulCompatibilityJamo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHangulJamo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHangulSyllables: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHanunoo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHebrew: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHighPrivateUseSurrogates: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHighSurrogates: function(code: cint): cint; EXTDECL;
+  xmlUCSIsHiragana: function(code: cint): cint; EXTDECL;
+  xmlUCSIsIPAExtensions: function(code: cint): cint; EXTDECL;
+  xmlUCSIsIdeographicDescriptionCharacters: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKanbun: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKangxiRadicals: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKannada: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKatakana: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKatakanaPhoneticExtensions: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKhmer: function(code: cint): cint; EXTDECL;
+  xmlUCSIsKhmerSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLao: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLatin1Supplement: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLatinExtendedA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLatinExtendedB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLatinExtendedAdditional: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLetterlikeSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLimbu: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLinearBIdeograms: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLinearBSyllabary: function(code: cint): cint; EXTDECL;
+  xmlUCSIsLowSurrogates: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMalayalam: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMathematicalAlphanumericSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMathematicalOperators: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMiscellaneousMathematicalSymbolsA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMiscellaneousMathematicalSymbolsB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMiscellaneousSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMiscellaneousSymbolsandArrows: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMiscellaneousTechnical: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMongolian: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMusicalSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsMyanmar: function(code: cint): cint; EXTDECL;
+  xmlUCSIsNumberForms: function(code: cint): cint; EXTDECL;
+  xmlUCSIsOgham: function(code: cint): cint; EXTDECL;
+  xmlUCSIsOldItalic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsOpticalCharacterRecognition: function(code: cint): cint; EXTDECL;
+  xmlUCSIsOriya: function(code: cint): cint; EXTDECL;
+  xmlUCSIsOsmanya: function(code: cint): cint; EXTDECL;
+  xmlUCSIsPhoneticExtensions: function(code: cint): cint; EXTDECL;
+  xmlUCSIsPrivateUse: function(code: cint): cint; EXTDECL;
+  xmlUCSIsPrivateUseArea: function(code: cint): cint; EXTDECL;
+  xmlUCSIsRunic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsShavian: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSinhala: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSmallFormVariants: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSpacingModifierLetters: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSpecials: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSuperscriptsandSubscripts: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSupplementalArrowsA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSupplementalArrowsB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSupplementalMathematicalOperators: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSupplementaryPrivateUseAreaA: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSupplementaryPrivateUseAreaB: function(code: cint): cint; EXTDECL;
+  xmlUCSIsSyriac: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTagalog: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTagbanwa: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTags: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTaiLe: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTaiXuanJingSymbols: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTamil: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTelugu: function(code: cint): cint; EXTDECL;
+  xmlUCSIsThaana: function(code: cint): cint; EXTDECL;
+  xmlUCSIsThai: function(code: cint): cint; EXTDECL;
+  xmlUCSIsTibetan: function(code: cint): cint; EXTDECL;
+  xmlUCSIsUgaritic: function(code: cint): cint; EXTDECL;
+  xmlUCSIsUnifiedCanadianAboriginalSyllabics: function(code: cint): cint; EXTDECL;
+  xmlUCSIsVariationSelectors: function(code: cint): cint; EXTDECL;
+  xmlUCSIsVariationSelectorsSupplement: function(code: cint): cint; EXTDECL;
+  xmlUCSIsYiRadicals: function(code: cint): cint; EXTDECL;
+  xmlUCSIsYiSyllables: function(code: cint): cint; EXTDECL;
+  xmlUCSIsYijingHexagramSymbols: function(code: cint): cint; EXTDECL;
+
+  xmlUCSIsBlock: function(code: cint; block: PAnsiChar): cint; EXTDECL;
+
+  xmlUCSIsCatC: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatCc: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatCf: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatCo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatCs: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatL: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatLl: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatLm: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatLo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatLt: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatLu: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatM: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatMc: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatMe: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatMn: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatN: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatNd: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatNl: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatNo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatP: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPc: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPd: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPe: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPf: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPi: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatPs: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatS: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatSc: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatSk: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatSm: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatSo: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatZ: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatZl: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatZp: function(code: cint): cint; EXTDECL;
+  xmlUCSIsCatZs: function(code: cint): cint; EXTDECL;
+
+  xmlUCSIsCat: function(code: cint; cat: PAnsiChar): cint; EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_UNICODE_ENABLED *)
 

+ 63 - 13
packages/libxml/src/xmlversion.inc

@@ -8,48 +8,60 @@
  *)
 
 
+{$IFDEF FUNCTION}
 (*
  * use those to be sure nothing nasty will happen if
  * your library and includes mismatch
  *)
 procedure xmlCheckVersion(version: cint); EXTDECL; external xml2lib;
+{$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * use those to be sure nothing nasty will happen if
+ * your library and includes mismatch
+ *)
+  xmlCheckVersion: procedure (version: cint); EXTDECL;
+{$ENDIF}
+
+{$IFDEF CONST}
 (**
  * LIBXML_DOTTED_VERSION:
  *
  * the version string like "1.2.3"
  *)
-const
-  LIBXML_DOTTED_VERSION = '2.6.32';
+  LIBXML_DOTTED_VERSION = '2.9.1';
 
 (**
  * LIBXML_VERSION:
  *
  * the version number: 1.2.3 value is 10203
  *)
-  LIBXML_VERSION = 20632;
+  LIBXML_VERSION = 20901;
 
 (**
  * LIBXML_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "10203"
  *)
-  LIBXML_VERSION_STRING = '20632';
+  LIBXML_VERSION_STRING = '20901';
 
 (**
  * LIBXML_VERSION_EXTRA:
  *
  * extra version information, used to show a CVS compilation
  *)
-  LIBXML_VERSION_EXTRA = '-CVS2831';
+  LIBXML_VERSION_EXTRA = ''; //'-CVS2831';
+{$ENDIF}
 
+{$IFDEF MACRO}
 (**
  * LIBXML_TEST_VERSION:
  *
  * Macro to check that the libxml version in use is compatible with
  * the version the software has been compiled against
  *)
-procedure LIBXML_TEST_VERSION;
+procedure LIBXML_TEST_VERSION; inline;
 
 (**
  * LIBXML_THREAD_ENABLED:
@@ -62,6 +74,22 @@ procedure LIBXML_TEST_VERSION;
 #define LIBXML_THREAD_ENABLED
 #endif
 #endif}
+{$ENDIF}
+
+{$IFDEF DEFINES}
+(**
+ * LIBXML_THREAD_ENABLED:
+ *
+ * Whether the thread support is configured in
+ *)
+{$DEFINE LIBXML_THREAD_ENABLED}
+
+(**
+ * LIBXML_THREAD_ALLOC_ENABLED:
+ *
+ * Whether the allocation hooks are per-thread
+ *)
+{.$DEFINE LIBXML_THREAD_ALLOC_ENABLED}
 
 (**
  * LIBXML_TREE_ENABLED:
@@ -197,6 +225,13 @@ procedure LIBXML_TEST_VERSION;
  *)
 {$DEFINE LIBXML_ICONV_ENABLED}
 
+(**
+ * LIBXML_ICU_ENABLED:
+ *
+ * Whether icu support is available
+ *)
+{.$DEFINE LIBXML_ICU_ENABLED}
+
 (**
  * LIBXML_ISO8859X_ENABLED:
  *
@@ -273,13 +308,6 @@ procedure LIBXML_TEST_VERSION;
  * Whether the module interfaces are compiled in
  *)
 {$DEFINE LIBXML_MODULES_ENABLED}
-(**
- * LIBXML_MODULE_EXTENSION:
- *
- * the string suffix used by dynamic modules (usually shared libraries)
- *)
-const
-  LIBXML_MODULE_EXTENSION = '.so';
 
 (**
  * LIBXML_ZLIB_ENABLED:
@@ -287,3 +315,25 @@ const
  * Whether the Zlib support is compiled in
  *)
 {$DEFINE LIBXML_ZLIB_ENABLED}
+
+(**
+ * LIBXML_LZMA_ENABLED:
+ *
+ * Whether the Lzma support is compiled in
+ *)
+{.$DEFINE LIBXML_LZMA_ENABLED}
+{$ENDIF DEFINES}
+
+{$IFDEF CONST}
+(**
+ * LIBXML_MODULE_EXTENSION:
+ *
+ * the string suffix used by dynamic modules (usually shared libraries)
+ *)
+  {$IFDEF WINDOWS}
+  LIBXML_MODULE_EXTENSION = '.dll';
+  {$ELSE}
+  LIBXML_MODULE_EXTENSION = '.so';
+  {$ENDIF}
+{$ENDIF}
+

+ 195 - 0
packages/libxml/src/xmlwriter.inc

@@ -202,11 +202,206 @@ function xmlTextWriterWriteDTDNotation(writer: xmlTextWriterPtr; name, pubid, sy
  *)
 function xmlTextWriterSetIndent(writer: xmlTextWriterPtr; indent: cint): cint; EXTDECL; external xml2lib;
 function xmlTextWriterSetIndentString(writer: xmlTextWriterPtr; str: xmlCharPtr): cint; EXTDECL; external xml2lib;
+function xmlTextWriterSetQuoteChar(writer: xmlTextWriterPtr; quotechar: xmlChar): cint; EXTDECL; external xml2lib;
 
 (*
  * misc
  *)
 function xmlTextWriterFlush(writer: xmlTextWriterPtr): cint; EXTDECL; external xml2lib;
+function xmlTextWriterClose(writer: xmlTextWriterPtr): cint; EXTDECL; external xml2lib;
+
+{$ENDIF}
+{$IFDEF FUNCTIONVAR}
+(*
+ * Constructors & Destructor
+ *)
+  xmlNewTextWriter: function(_out: xmlOutputBufferPtr): xmlTextWriterPtr; EXTDECL;
+  xmlNewTextWriterFilename: function(uri: PAnsiChar; compression: cint): xmlTextWriterPtr; EXTDECL;
+  xmlNewTextWriterMemory: function(buf: xmlBufferPtr; compression: cint): xmlTextWriterPtr; EXTDECL;
+  xmlNewTextWriterPushParser: function(ctxt: xmlParserCtxtPtr; compression: cint): xmlTextWriterPtr; EXTDECL;
+  xmlNewTextWriterDoc: function(var doc: xmlDocPtr; compression: cint): xmlTextWriterPtr; EXTDECL;
+  xmlNewTextWriterTree: function(doc: xmlDocPtr; node: xmlNodePtr; compression: cint): xmlTextWriterPtr; EXTDECL;
+  xmlFreeTextWriter: procedure(writer: xmlTextWriterPtr); EXTDECL;
+
+(*
+ * Functions
+ *)
+
+(*
+ * Document
+ *)
+  xmlTextWriterStartDocument: function(writer: xmlTextWriterPtr; version, encoding, standalone: PAnsiChar): cint; EXTDECL;
+  xmlTextWriterEndDocument: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * Comments
+ *)
+  xmlTextWriterStartComment: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+  xmlTextWriterEndComment: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+  xmlTextWriterWriteFormatComment: function(writer: xmlTextWriterPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatComment: function(writer: xmlTextWriterPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteComment: function(writer: xmlTextWriterPtr; content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * Elements
+ *)
+  xmlTextWriterStartElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterStartElementNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndElement: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+  xmlTextWriterFullEndElement: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * Elements conveniency functions
+ *)
+  xmlTextWriterWriteFormatElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteElement: function(writer: xmlTextWriterPtr; name, content: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteFormatElementNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatElementNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteElementNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI, content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * Text
+ *)
+  xmlTextWriterWriteFormatRaw: function(writer: xmlTextWriterPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatRaw: function(writer: xmlTextWriterPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteRawLen: function(writer: xmlTextWriterPtr; content: xmlCharPtr; len: cint): cint; EXTDECL;
+  xmlTextWriterWriteRaw: function(writer: xmlTextWriterPtr; content: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteFormatString: function(writer: xmlTextWriterPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatString: function(writer: xmlTextWriterPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteString: function(writer: xmlTextWriterPtr; content: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteBase64: function(writer: xmlTextWriterPtr; data: PAnsiChar; start, len: cint): cint; EXTDECL;
+  xmlTextWriterWriteBinHex: function(writer: xmlTextWriterPtr; data: PAnsiChar; start, len: cint): cint; EXTDECL;
+
+(*
+ * Attributes
+ *)
+  xmlTextWriterStartAttribute: function(writer: xmlTextWriterPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterStartAttributeNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndAttribute: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * Attributes conveniency functions
+ *)
+  xmlTextWriterWriteFormatAttribute: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatAttribute: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteAttribute: function(writer: xmlTextWriterPtr; name, content: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteFormatAttributeNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatAttributeNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteAttributeNS: function(writer: xmlTextWriterPtr; prefix, name, namespaceURI, content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * PI's
+ *)
+  xmlTextWriterStartPI: function(writer: xmlTextWriterPtr; target: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndPI: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * PI conveniency functions
+ *)
+  xmlTextWriterWriteFormatPI: function(writer: xmlTextWriterPtr; target: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatPI: function(writer: xmlTextWriterPtr; target: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWritePI: function(writer: xmlTextWriterPtr; target, content: xmlCharPtr): cint; EXTDECL;
+
+(**
+ * xmlTextWriterWriteProcessingInstruction:
+ *
+ * This macro maps to xmlTextWriterWritePI
+ *)
+//function xmlTextWriterWriteProcessingInstruction(writer: xmlTextWriterPtr; target, content: xmlCharPtr): cint; EXTDECL; external xml2lib 'xmlTextWriterWritePI';
+
+(*
+ * CDATA
+ *)
+  xmlTextWriterStartCDATA: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+  xmlTextWriterEndCDATA: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * CDATA conveniency functions
+ *)
+  xmlTextWriterWriteFormatCDATA: function(writer: xmlTextWriterPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatCDATA: function(writer: xmlTextWriterPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteCDATA: function(writer: xmlTextWriterPtr; content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * DTD
+ *)
+  xmlTextWriterStartDTD: function(writer: xmlTextWriterPtr; name, pubid, sysid: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndDTD: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * DTD conveniency functions
+ *)
+  xmlTextWriterWriteFormatDTD: function(writer: xmlTextWriterPtr; name, pubid, sysid: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatDTD: function(writer: xmlTextWriterPtr; name, pubid, sysid: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteDTD: function(writer: xmlTextWriterPtr; name, pubid, sysid, subset: xmlCharPtr): cint; EXTDECL;
+
+(**
+ * xmlTextWriterWriteDocType:
+ *
+ * this macro maps to xmlTextWriterWriteDTD
+ *)
+//{$DEFINE xmlTextWriterWriteDocType := xmlTextWriterWriteDTD}
+
+(*
+ * DTD element definition
+ *)
+  xmlTextWriterStartDTDElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndDTDElement: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * DTD element definition conveniency functions
+ *)
+  xmlTextWriterWriteFormatDTDElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatDTDElement: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteDTDElement: function(writer: xmlTextWriterPtr; name, content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * DTD attribute list definition
+ *)
+  xmlTextWriterStartDTDAttlist: function(writer: xmlTextWriterPtr; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndDTDAttlist: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * DTD attribute list definition conveniency functions
+ *)
+  xmlTextWriterWriteFormatDTDAttlist: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatDTDAttlist: function(writer: xmlTextWriterPtr; name: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteDTDAttlist: function(writer: xmlTextWriterPtr; name, content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * DTD entity definition
+ *)
+  xmlTextWriterStartDTDEntity: function(writer: xmlTextWriterPtr; pe: cint; name: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterEndDTDEntity: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+
+(*
+ * DTD entity definition conveniency functions
+ *)
+  xmlTextWriterWriteFormatDTDInternalEntity: function(writer: xmlTextWriterPtr; pe: cint; name: xmlCharPtr; format: PAnsiChar; args: array of const): cint; EXTDECL;
+  xmlTextWriterWriteVFormatDTDInternalEntity: function(writer: xmlTextWriterPtr; pe: cint; name: xmlCharPtr; format: PAnsiChar; argptr: va_list): cint; EXTDECL;
+  xmlTextWriterWriteDTDInternalEntity: function(writer: xmlTextWriterPtr; pe: cint; name, content: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteDTDExternalEntity: function(writer: xmlTextWriterPtr; pe: cint; name, pubid, sysid, ndataid: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteDTDExternalEntityContents: function(writer: xmlTextWriterPtr; pubid, sysid, ndataid: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterWriteDTDEntity: function(writer: xmlTextWriterPtr; pe: cint; name, pubid, sysid, ndataid, content: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * DTD notation definition
+ *)
+  xmlTextWriterWriteDTDNotation: function(writer: xmlTextWriterPtr; name, pubid, sysid: xmlCharPtr): cint; EXTDECL;
+
+(*
+ * Indentation
+ *)
+  xmlTextWriterSetIndent: function(writer: xmlTextWriterPtr; indent: cint): cint; EXTDECL;
+  xmlTextWriterSetIndentString: function(writer: xmlTextWriterPtr; str: xmlCharPtr): cint; EXTDECL;
+  xmlTextWriterSetQuoteChar: function(writer: xmlTextWriterPtr; quotechar: xmlChar): cint; EXTDECL;
+
+(*
+ * misc
+ *)
+  xmlTextWriterFlush: function(writer: xmlTextWriterPtr): cint; EXTDECL;
+  xmlTextWriterClose: function(writer: xmlTextWriterPtr): cint; EXTDECL;
 
 {$ENDIF}
 {$ENDIF} (* LIBXML_WRITER_ENABLED *)

+ 135 - 50
packages/libxml/src/xpath.inc

@@ -59,7 +59,11 @@
     XPATH_UNDEF_PREFIX_ERROR,
     XPATH_ENCODING_ERROR,
     XPATH_INVALID_CHAR_ERROR,
-    XPATH_INVALID_CTXT
+    XPATH_INVALID_CTXT,
+    XPATH_STACK_ERROR,
+    XPATH_FORBID_VARIABLE_ERROR,
+    XPATH_OP_LIMIT_EXCEEDED,
+    XPATH_RECURSION_LIMIT_EXCEEDED
   );
 
 (*
@@ -323,6 +327,13 @@
 
     (* Cache for reusal of XPath objects *)
     cache               : pointer;
+
+    (* Resource limits *)
+    opLimit             : culong;
+    opCount             : culong;
+    depth               : cint;
+    maxDepth            : cint;
+    maxParserDepth      : cint;
   end;
 
 (*
@@ -351,6 +362,8 @@
     comp          : xmlXPathCompExprPtr;		(* the precompiled expression *)
     xptr          : cint;				(* it this an XPointer expression *)
     ancestor      : xmlNodePtr;	(* used for walking preceding axis *)
+
+    valueFrame    : cint;        (* used to limit Pop on the stack *)
   end;
 {$ENDIF}
 
@@ -361,51 +374,6 @@
  *									*
  ************************************************************************)
 
-(**
- * Objects and Nodesets handling
- *)
-
-{$IFNDEF NO_EXTERNAL_VARS}
-var
-  xmlXPathNAN: cdouble; cvar; external;
-  xmlXPathPINF: cdouble; cvar; external;
-  xmlXPathNINF: cdouble; cvar; external;
-{$ENDIF}
-
-(* These macros may later turn into functions *)
-(**
- * xmlXPathNodeSetGetLength:
- * @ns:  a node-set
- *
- * Implement a functionality similar to the DOM NodeList.length.
- *
- * Returns the number of nodes in the node-set.
- *)
-function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint;
-
-(**
- * xmlXPathNodeSetItem:
- * @ns:  a node-set
- * @index:  index of a node in the set
- *
- * Implements a functionality similar to the DOM NodeList.item().
- *
- * Returns the xmlNodePtr at the given @index in @ns or NULL if
- *         @index is out of range (0 to length-1)
- *)
-function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr;
-
-(**
- * xmlXPathNodeSetIsEmpty:
- * @ns: a node-set
- *
- * Checks whether @ns is empty or not.
- *
- * Returns %TRUE if @ns is an empty node-set.
- *)
-function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean;
-
-
 procedure xmlXPathFreeObject(obj: xmlXPathObjectPtr); EXTDECL; external xml2lib;
 function xmlXPathNodeSetCreate(val: xmlNodePtr): xmlNodeSetPtr; EXTDECL; external xml2lib;
 procedure xmlXPathFreeNodeSetList(obj: xmlXPathObjectPtr); EXTDECL; external xml2lib;
@@ -448,6 +416,8 @@ function xmlXPathContextSetCache(ctxt: xmlXPathContextPtr; active, value, option
  * Evaluation functions.
  *)
 function xmlXPathOrderDocElems(doc: xmlDocPtr): clong; EXTDECL; external xml2lib;
+function xmlXPathSetContextNode(node: xmlNodePtr; ctx: xmlXPathContextPtr): cint; EXTDECL; external xml2lib;
+function xmlXPathNodeEval(node: xmlNodePtr; const str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL; external xml2lib;
 function xmlXPathEval(str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL; external xml2lib;
 function xmlXPathEvalExpression(str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL; external xml2lib;
 function xmlXPathEvalPredicate(ctxt: xmlXPathContextPtr; res: xmlXPathObjectPtr): cint; EXTDECL; external xml2lib;
@@ -461,12 +431,127 @@ function xmlXPathCompiledEval(comp: xmlXPathCompExprPtr; ctxt: xmlXPathContextPt
 function xmlXPathCompiledEvalToBoolean(comp: xmlXPathCompExprPtr; ctxt: xmlXPathContextPtr): cint; EXTDECL; external xml2lib;
 procedure xmlXPathFreeCompExpr(comp: xmlXPathCompExprPtr); EXTDECL; external xml2lib;
 {$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(************************************************************************
+ *									*
+ *			Public API					*
+ *									*
+ ************************************************************************)
+
+  xmlXPathFreeObject: procedure(obj: xmlXPathObjectPtr); EXTDECL;
+  xmlXPathNodeSetCreate: function(val: xmlNodePtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathFreeNodeSetList: procedure(obj: xmlXPathObjectPtr); EXTDECL;
+  xmlXPathFreeNodeSet: procedure(obj: xmlNodeSetPtr); EXTDECL;
+  xmlXPathObjectCopy: function(val: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathCmpNodes: function(node1, node2: xmlNodePtr): cint; EXTDECL;
+
+(**
+ * Conversion functions to basic types.
+ *)
+  xmlXPathCastNumberToBoolean: function(val: cdouble): cint; EXTDECL;
+  xmlXPathCastStringToBoolean: function(val: xmlCharPtr): cint; EXTDECL;
+  xmlXPathCastNodeSetToBoolean: function(ns: xmlNodeSetPtr): cint; EXTDECL;
+  xmlXPathCastToBoolean: function(ns: xmlXPathObjectPtr): cint; EXTDECL;
+
+  xmlXPathCastBooleanToNumber: function(val: cint): cdouble; EXTDECL;
+  xmlXPathCastStringToNumber: function(val: xmlCharPtr): cdouble; EXTDECL;
+  xmlXPathCastNodeToNumber: function(val: xmlNodePtr): cdouble; EXTDECL;
+  xmlXPathCastNodeSetToNumber: function(val: xmlNodeSetPtr): cdouble; EXTDECL;
+  xmlXPathCastToNumber: function(val: xmlXPathObjectPtr): cdouble; EXTDECL;
+
+  xmlXPathCastBooleanToString: function(val: cint): xmlCharPtr; EXTDECL;
+  xmlXPathCastNumberToString: function(val: cdouble): xmlCharPtr; EXTDECL;
+  xmlXPathCastNodeToString: function(val: xmlNodePtr): xmlCharPtr; EXTDECL;
+  xmlXPathCastNodeSetToString: function(val: xmlNodeSetPtr): xmlCharPtr; EXTDECL;
+  xmlXPathCastToString: function(val: xmlXPathObjectPtr): xmlCharPtr; EXTDECL;
+
+  xmlXPathConvertBoolean: function(val: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathConvertNumber: function(val: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathConvertString: function(val: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+
+(**
+ * Context handling.
+ *)
+  xmlXPathNewContext: function(doc: xmlDocPtr): xmlXPathContextPtr; EXTDECL;
+  xmlXPathFreeContext: procedure(ctxt: xmlXPathContextPtr); EXTDECL;
+  xmlXPathContextSetCache: function(ctxt: xmlXPathContextPtr; active, value, options: cint): cint; EXTDECL;
+
+(**
+ * Evaluation functions.
+ *)
+  xmlXPathOrderDocElems: function(doc: xmlDocPtr): clong; EXTDECL;
+  xmlXPathSetContextNode: function(node: xmlNodePtr; ctx: xmlXPathContextPtr): cint; EXTDECL;
+  xmlXPathNodeEval: function(node: xmlNodePtr; const str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathEval: function(str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathEvalExpression: function(str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathEvalPredicate: function(ctxt: xmlXPathContextPtr; res: xmlXPathObjectPtr): cint; EXTDECL;
+
+(**
+ * Separate compilation/evaluation entry points.
+ *)
+  xmlXPathCompile: function(str: xmlCharPtr): xmlXPathCompExprPtr; EXTDECL;
+  xmlXPathCtxtCompile: function(ctxt: xmlXPathContextPtr; str: xmlCharPtr): xmlXPathCompExprPtr; EXTDECL;
+  xmlXPathCompiledEval: function(comp: xmlXPathCompExprPtr; ctxt: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathCompiledEvalToBoolean: function(comp: xmlXPathCompExprPtr; ctxt: xmlXPathContextPtr): cint; EXTDECL;
+  xmlXPathFreeCompExpr: procedure(comp: xmlXPathCompExprPtr); EXTDECL;
+{$ENDIF}
+
+{$IFDEF EXTVAR}
+(**
+ * Objects and Nodesets handling
+ *)
+
+{$IFNDEF NO_EXTERNAL_VARS}
+var
+  xmlXPathNAN: cdouble; cvar; external;
+  xmlXPathPINF: cdouble; cvar; external;
+  xmlXPathNINF: cdouble; cvar; external;
+{$ENDIF}
+
+{$ENDIF}
+
+{$IFDEF MACRO}
+(* These macros may later turn into functions *)
+(**
+ * xmlXPathNodeSetGetLength:
+ * @ns:  a node-set
+ *
+ * Implement a functionality similar to the DOM NodeList.length.
+ *
+ * Returns the number of nodes in the node-set.
+ *)
+function xmlXPathNodeSetGetLength(ns: xmlNodeSetPtr): cint;
+
+(**
+ * xmlXPathNodeSetItem:
+ * @ns:  a node-set
+ * @index:  index of a node in the set
+ *
+ * Implements a functionality similar to the DOM NodeList.item().
+ *
+ * Returns the xmlNodePtr at the given @index in @ns or NULL if
+ *         @index is out of range (0 to length-1)
+ *)
+function xmlXPathNodeSetItem(ns: xmlNodeSetPtr; index: cint): xmlNodePtr;
+
+(**
+ * xmlXPathNodeSetIsEmpty:
+ * @ns: a node-set
+ *
+ * Checks whether @ns is empty or not.
+ *
+ * Returns %TRUE if @ns is an empty node-set.
+ *)
+function xmlXPathNodeSetIsEmpty(ns: xmlNodeSetPtr): boolean;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_XPATH_ENABLED *)
 
 {$if defined(LIBXML_XPATH_ENABLED) or defined(LIBXML_SCHEMAS_ENABLED)}
-{$IFDEF FUNCTION}
-procedure xmlXPathInit; EXTDECL; external xml2lib;
-function xmlXPathIsNaN(val: cdouble): cint; EXTDECL; external xml2lib;
-function xmlXPathIsInf(val: cdouble): cint; EXTDECL; external xml2lib;
+{$IFDEF FUNCTIONVAR}
+  xmlXPathInit: procedure; EXTDECL;
+  xmlXPathIsNaN: function(val: cdouble): cint; EXTDECL;
+  xmlXPathIsInf: function(val: cdouble): cint; EXTDECL;
 {$ENDIF}
 {$ENDIF} (* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*)

+ 177 - 1
packages/libxml/src/xpathInternals.inc

@@ -363,7 +363,7 @@ function xmlXPathTrailing(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL
  *)
 function xmlXPathRegisterNs(ctxt: xmlXPathContextPtr; prefix, ns_uri: xmlCharPtr): cint; EXTDECL; external xml2lib;
 function xmlXPathNsLookup(ctxt: xmlXPathContextPtr; prefix: xmlCharPtr): xmlCharPtr; EXTDECL; external xml2lib;
-procedure xmlXPathDebugDumpCompExpr(ctxt: xmlXPathContextPtr); EXTDECL; external xml2lib;
+procedure xmlXPathRegisteredNsCleanup(ctxt: xmlXPathContextPtr); EXTDECL; external xml2lib;
 function xmlXPathRegisterFunc(ctxt: xmlXPathContextPtr; name: xmlCharPtr; f: xmlXPathFunction): cint; EXTDECL; external xml2lib;
 function xmlXPathRegisterFuncNS(ctxt: xmlXPathContextPtr; name, ns_uri: xmlCharPtr; f: xmlXPathFunction): cint; EXTDECL; external xml2lib;
 function xmlXPathRegisterVariable(ctxt: xmlXPathContextPtr; name: xmlCharPtr; value: xmlXPathObjectPtr): cint; EXTDECL; external xml2lib;
@@ -494,4 +494,180 @@ procedure xmlXPathBooleanFunction(ctxt: xmlXPathParserContextPtr; nargs: cint);
 procedure xmlXPathNodeSetFreeNs(ns: xmlNsPtr); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Variable Lookup forwarding.
+ *)
+  xmlXPathRegisterVariableLookup: procedure(ctxt: xmlXPathContextPtr; f: xmlXPathVariableLookupFunc; data: pointer); EXTDECL;
+
+(*
+ * Function Lookup forwarding.
+ *)
+  xmlXPathRegisterFuncLookup: procedure(ctxt: xmlXPathContextPtr; f: xmlXPathFuncLookupFunc; funcCtxt: pointer); EXTDECL;
+
+(*
+ * Error reporting.
+ *)
+//procedure __xmlXPatherror(ctxt: xmlXPathParserContextPtr; _file: PAnsiChar; line, no: cint); EXTDECL; external xml2lib name 'xmlXPatherror';
+  xmlXPathErr: procedure(ctxt: xmlXPathParserContextPtr; error: cint); EXTDECL;
+
+{$IFDEF LIBXML_DEBUG_ENABLED}
+  xmlXPathDebugDumpObject: procedure(output: PFILE; cur: xmlXPathObjectPtr; depth: cint); EXTDECL;
+  xmlXPathDebugDumpCompExpr: procedure(output: PFILE; comp: xmlXPathCompExprPtr; depth: cint); EXTDECL;
+{$ENDIF}
+
+(**
+ * NodeSet handling.
+ *)
+  xmlXPathNodeSetContains: function(cur: xmlNodeSetPtr; val: xmlNodePtr): cint; EXTDECL;
+  xmlXPathDifference: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathIntersection: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathDistinctSorted: function(nodes: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathDistinct: function(nodes: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathHasSameNodes: function(nodes1, nodes2: xmlNodeSetPtr): cint; EXTDECL;
+  xmlXPathNodeLeadingSorted: function(nodes: xmlNodeSetPtr; node: xmlNodePtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathLeadingSorted: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathNodeLeading: function(nodes: xmlNodeSetPtr; node: xmlNodePtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathLeading: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathNodeTrailingSorted: function(nodes: xmlNodeSetPtr; node: xmlNodePtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathTrailingSorted: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathNodeTrailing: function(nodes: xmlNodeSetPtr; node: xmlNodePtr): xmlNodeSetPtr; EXTDECL;
+  xmlXPathTrailing: function(nodes1, nodes2: xmlNodeSetPtr): xmlNodeSetPtr; EXTDECL;
+
+(**
+ * Extending a context.
+ *)
+  xmlXPathRegisterNs: function(ctxt: xmlXPathContextPtr; prefix, ns_uri: xmlCharPtr): cint; EXTDECL;
+  xmlXPathNsLookup: function(ctxt: xmlXPathContextPtr; prefix: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xmlXPathRegisteredNsCleanup: procedure(ctxt: xmlXPathContextPtr); EXTDECL;
+  xmlXPathRegisterFunc: function(ctxt: xmlXPathContextPtr; name: xmlCharPtr; f: xmlXPathFunction): cint; EXTDECL;
+  xmlXPathRegisterFuncNS: function(ctxt: xmlXPathContextPtr; name, ns_uri: xmlCharPtr; f: xmlXPathFunction): cint; EXTDECL;
+  xmlXPathRegisterVariable: function(ctxt: xmlXPathContextPtr; name: xmlCharPtr; value: xmlXPathObjectPtr): cint; EXTDECL;
+  xmlXPathRegisterVariableNS: function(ctxt: xmlXPathContextPtr; name, ns_uri: xmlCharPtr; value: xmlXPathObjectPtr): cint; EXTDECL;
+  xmlXPathFunctionLookup: function(ctxt: xmlXPathContextPtr; name: xmlCharPtr): xmlXPathFunction; EXTDECL;
+  xmlXPathFunctionLookupNS: function(ctxt: xmlXPathContextPtr; name, ns_uri: xmlCharPtr): xmlXPathFunction; EXTDECL;
+  xmlXPathRegisteredFuncsCleanup: procedure(ctxt: xmlXPathContextPtr); EXTDECL;
+  xmlXPathVariableLookup: function(ctxt: xmlXPathContextPtr; name: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathVariableLookupNS: function(ctxt: xmlXPathContextPtr; name, ns_uri: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathRegisteredVariablesCleanup: procedure(ctxt: xmlXPathContextPtr); EXTDECL;
+
+(**
+ * Utilities to extend XPath.
+ *)
+  xmlXPathNewParserContext: function(str: xmlCharPtr; ctxt: xmlXPathContextPtr): xmlXPathParserContextPtr; EXTDECL;
+  xmlXPathFreeParserContext: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+
+(* TODO: remap to xmlXPathValuePop and Push. *)
+  valuePop: function(ctxt: xmlXPathParserContextPtr): xmlXPathObjectPtr; EXTDECL;
+  valuePush: function(ctxt: xmlXPathParserContextPtr): cint; EXTDECL;
+
+  xmlXPathNewString: function(val: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNewCString: function(val: PAnsiChar): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathWrapString: function(val: xmlCharPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathWrapCString: function(val: PAnsiChar): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNewFloat: function(val: cdouble): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNewBoolean: function(val: cint): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNewNodeSet: function(val: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNewValueTree: function(val: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPathNodeSetAddUnique: procedure(cur: xmlNodeSetPtr; val: xmlNodePtr); EXTDECL;
+  xmlXPathNodeSetAdd: procedure(cur: xmlNodeSetPtr; val: xmlNodePtr); EXTDECL;
+  xmlXPathNodeSetAddNs: procedure(cur: xmlNodeSetPtr; node: xmlNodePtr; ns: xmlNsPtr); EXTDECL;
+  xmlXPathNodeSetSort: procedure(_set: xmlNodeSetPtr); EXTDECL;
+  xmlXPathRoot: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathEvalExpr: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathParseName: function(ctxt: xmlXPathParserContextPtr): xmlCharPtr; EXTDECL;
+  xmlXPathParseNCName: function(ctxt: xmlXPathParserContextPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * Existing functions.
+ *)
+{external xml2lib double EXTDECL
+		xmlXPathStringEvalNumber	(xmlChar *str);
+external xml2lib int EXTDECL
+		xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
+						 xmlXPathObjectPtr res);
+external xml2lib void EXTDECL
+		xmlXPathRegisterAllFunctions	(xmlXPathContextPtr ctxt);
+external xml2lib xmlNodeSetPtr EXTDECL
+		xmlXPathNodeSetMerge		(xmlNodeSetPtr val1,
+						 xmlNodeSetPtr val2);
+external xml2lib void EXTDECL
+		xmlXPathNodeSetDel		(xmlNodeSetPtr cur,
+						 xmlNodePtr val);
+external xml2lib void EXTDECL
+		xmlXPathNodeSetRemove		(xmlNodeSetPtr cur,
+						 int val);
+external xml2lib xmlXPathObjectPtr EXTDECL
+		xmlXPathNewNodeSetList		(xmlNodeSetPtr val);
+external xml2lib xmlXPathObjectPtr EXTDECL
+		xmlXPathWrapNodeSet		(xmlNodeSetPtr val);
+external xml2lib xmlXPathObjectPtr EXTDECL
+		xmlXPathWrapExternal		(void *val);}
+
+  xmlXPathEqualValues: function(ctxt: xmlXPathParserContextPtr): cint; EXTDECL;
+  xmlXPathNotEqualValues: function(ctxt: xmlXPathParserContextPtr): cint; EXTDECL;
+  xmlXPathCompareValues: function(ctxt: xmlXPathParserContextPtr; inf, strict: cint): cint; EXTDECL;
+  xmlXPathValueFlipSign: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathAddValues: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathSubValues: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathMultValues: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathDivValues: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+  xmlXPathModValues: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+
+  xmlXPathIsNodeType: function(name: xmlCharPtr): cint; EXTDECL;
+
+
+(*
+ * Some of the axis navigation routines.
+ *)
+  xmlXPathNextSelf: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextChild: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextDescendant: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextDescendantOrSelf: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextParent: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextAncestorOrSelf: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextFollowingSibling: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextFollowing: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextNamespace: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextAttribute: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextPreceding: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextAncestor: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+  xmlXPathNextPrecedingSibling: function(ctxt: xmlXPathParserContextPtr; cur: xmlNodePtr): xmlNodePtr; EXTDECL;
+
+(*
+ * The official core of XPath functions.
+ *)
+  xmlXPathLastFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathPositionFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathCountFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathIdFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathLocalNameFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathNamespaceURIFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathStringFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathStringLengthFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathConcatFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathContainsFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathStartsWithFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathSubstringFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathSubstringBeforeFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathSubstringAfterFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathNormalizeFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathTranslateFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathNotFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathTrueFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathFalseFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathLangFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathNumberFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathSumFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathFloorFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathCeilingFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathRoundFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPathBooleanFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+
+(**
+ * Really internal functions
+ *)
+  xmlXPathNodeSetFreeNs: procedure(ns: xmlNsPtr); EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_XPATH_ENABLED *)

+ 32 - 1
packages/libxml/src/xpointer.inc

@@ -36,7 +36,7 @@
  * Handling of location sets.
  *)
 function xmlXPtrLocationSetCreate(val: xmlXPathObjectPtr): xmlLocationSetPtr; EXTDECL; external xml2lib;
-procedure xmlXPtrLocationSetCreate(obj: xmlLocationSetPtr); EXTDECL; external xml2lib;
+procedure xmlXPtrFreeLocationSet(obj: xmlLocationSetPtr); EXTDECL; external xml2lib;
 function xmlXPtrLocationSetMerge(val1, val2: xmlLocationSetPtr): xmlLocationSetPtr; EXTDECL; external xml2lib;
 function xmlXPtrNewRange(start: xmlNodePtr; startindex: cint; _end: xmlNodePtr; endindex: cint): xmlXPathObjectPtr; EXTDECL; external xml2lib;
 function xmlXPtrNewRangePoints(start, _end: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL; external xml2lib;
@@ -62,4 +62,35 @@ function xmlXPtrBuildNodeList(obj: xmlXPathObjectPtr): xmlNodePtr; EXTDECL; exte
 procedure xmlXPtrEvalRangePredicate(ctxt: xmlXPathParserContextPtr); EXTDECL; external xml2lib;
 {$ENDIF}
 
+{$IFDEF FUNCTIONVAR}
+(*
+ * Handling of location sets.
+ *)
+  xmlXPtrLocationSetCreate: function(val: xmlXPathObjectPtr): xmlLocationSetPtr; EXTDECL;
+  xmlXPtrFreeLocationSet: procedure(obj: xmlLocationSetPtr); EXTDECL;
+  xmlXPtrLocationSetMerge: function(val1, val2: xmlLocationSetPtr): xmlLocationSetPtr; EXTDECL;
+  xmlXPtrNewRange: function(start: xmlNodePtr; startindex: cint; _end: xmlNodePtr; endindex: cint): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewRangePoints: function(start, _end: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewRangeNodePoint: function(start: xmlNodePtr; _end: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewRangePointNode: function(start: xmlXPathObjectPtr; _end: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewRangeNodes: function(start: xmlNodePtr; _end: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewLocationSetNodes: function(start: xmlNodePtr; _end: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewLocationSetNodeSet: function(_set: xmlNodeSetPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewRangeNodeObject: function(start: xmlNodePtr; _end: xmlXPathObjectPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrNewCollapsedRange: function(start: xmlNodePtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrLocationSetAdd: procedure(cur: xmlLocationSetPtr; val: xmlXPathObjectPtr); EXTDECL;
+  xmlXPtrWrapLocationSet: function(val: xmlLocationSetPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrLocationSetDel: procedure(cur: xmlLocationSetPtr; val: xmlXPathObjectPtr); EXTDECL;
+  xmlXPtrLocationSetRemove: procedure(cur: xmlLocationSetPtr; val: cint); EXTDECL;
+
+(*
+ * Functions.
+ *)
+  xmlXPtrNewContext: function(doc: xmlDocPtr; here, origin: xmlNodePtr): xmlXPathContextPtr; EXTDECL;
+  xmlXPtrEval: function(str: xmlCharPtr; ctx: xmlXPathContextPtr): xmlXPathObjectPtr; EXTDECL;
+  xmlXPtrRangeToFunction: procedure(ctxt: xmlXPathParserContextPtr; nargs: cint); EXTDECL;
+  xmlXPtrBuildNodeList: function(obj: xmlXPathObjectPtr): xmlNodePtr; EXTDECL;
+  xmlXPtrEvalRangePredicate: procedure(ctxt: xmlXPathParserContextPtr); EXTDECL;
+{$ENDIF}
+
 {$ENDIF} (* LIBXML_XPTR_ENABLED *)

+ 117 - 0
packages/libxml/src/xslt.inc

@@ -0,0 +1,117 @@
+(*
+ * Summary: Interfaces, constants and types related to the XSLT engine
+ * Description: Interfaces, constants and types related to the XSLT engine
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF CONST}
+  (**
+   * XSLT_DEFAULT_VERSION:
+   *
+   * The default version of XSLT supported.
+   *)
+  XSLT_DEFAULT_VERSION = '1.0';
+
+  (**
+   * XSLT_DEFAULT_VENDOR:
+   *
+   * The XSLT "vendor" string for this processor.
+   *)
+  XSLT_DEFAULT_VENDOR = 'libxslt';
+
+  (**
+   * XSLT_DEFAULT_URL:
+   *
+   * The XSLT "vendor" URL for this processor.
+   *)
+  XSLT_DEFAULT_URL = 'http://xmlsoft.org/XSLT/';
+
+  (**
+   * XSLT_NAMESPACE:
+   *
+   * The XSLT specification namespace.
+   *)
+  XSLT_NAMESPACE = 'http://www.w3.org/1999/XSL/Transform';
+
+  (**
+   * XSLT_PARSE_OPTIONS:
+   *
+   * The set of options to pass to an xmlReadxxx when loading files for
+   * XSLT consumption.
+   *)
+  XSLT_PARSE_OPTIONS = XML_PARSE_NOENT or XML_PARSE_DTDLOAD or XML_PARSE_DTDATTR or XML_PARSE_NOCDATA;
+
+{$ENDIF} {CONST}
+
+{$IFDEF EXTVAR}
+
+  (**
+   * xsltMaxDepth:
+   *
+   * This value is used to detect templates loops.
+   *)
+var
+  xsltMaxDepth: cint; external xsltlib;
+
+  (**
+   *  * xsltMaxVars:
+   *   *
+   *    * This value is used to detect templates loops.
+   *     *)
+  xsltMaxVars: cint; external xsltlib;
+
+  (**
+   * xsltEngineVersion:
+   *
+   * The version string for libxslt.
+   *)
+  xsltEngineVersion: PAnsiChar; external xsltlib;
+
+  (**
+   * xsltLibxsltVersion:
+   *
+   * The version of libxslt compiled.
+   *)
+  xsltLibxsltVersion: cint; external xsltlib;
+
+  (**
+   * xsltLibxmlVersion:
+   *
+   * The version of libxml libxslt was compiled against.
+   *)
+  xsltLibxmlVersion: cint; external xsltlib;
+
+{$ENDIF}
+
+{$IFDEF FUNCTION}
+
+(*
+ * Global initialization function.
+ *)
+
+procedure xsltInit; EXTDECL; external xsltlib;
+
+(*
+ * Global cleanup function.
+ *)
+procedure xsltCleanupGlobals; EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+
+(*
+ * Global initialization function.
+ *)
+
+  xsltInit: procedure; EXTDECL;
+
+(*
+ * Global cleanup function.
+ *)
+  xsltCleanupGlobals: procedure; EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}

+ 111 - 0
packages/libxml/src/xslt.pas

@@ -0,0 +1,111 @@
+{$IFNDEF FPC_DOTTEDUNITS}
+unit xslt;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$mode ObjFPC}
+{$H+}
+{$macro on}
+
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses
+  Api.XML.Xml2,
+  System.CTypes
+  {$IFDEF WINDOWS}
+  , WinApi.Windows
+  {$ENDIF}
+  ;
+{$ELSE FPC_DOTTEDUNITS}
+uses
+  xml2, ctypes
+  {$IFDEF WINDOWS}
+  , Windows
+  {$ENDIF}
+  ;
+{$ENDIF}
+
+{.$DEFINE XSLT_REFACTORED}
+{$DEFINE HAVE_STRXFRM_L}
+
+const
+{$IF Defined(WINDOWS)}
+  xsltlib = 'libxslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ELSEIF Defined(UNIX)}
+  xsltlib = 'libxslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+{$ELSE}
+  {$MESSAGE ERROR 'Platform not supported right now'}
+{$IFEND}
+
+type
+{$DEFINE POINTER}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$UNDEF POINTER}
+
+{$DEFINE TYPE}
+{$I xsltpattern.inc}
+{$I numbersInternals.inc}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I documents.inc}
+{$I extensions.inc}
+{$I security.inc}
+{$I xsltutils.inc}
+{$UNDEF TYPE}
+
+const
+{$DEFINE CONST}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I documents.inc}
+{$I extra.inc}
+{$I keys.inc}
+{$I namespaces.inc}
+{$I variables.inc}
+{$I xslt.inc}
+{$I xsltconfig.inc}
+{$I xsltutils.inc}
+{$UNDEF CONST}
+
+
+{$DEFINE FUNCTION}
+{$I xsltpattern.inc}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I attributes.inc}
+{$I documents.inc}
+{$I extensions.inc}
+{$I extra.inc}
+{$I functions.inc}
+{$I imports.inc}
+{$I keys.inc}
+{$I namespaces.inc}
+{$I preproc.inc}
+{$I security.inc}
+{$I templates.inc}
+{$I transform.inc}
+{$I variables.inc}
+{$I xslt.inc}
+{$I xsltutils.inc}
+{$UNDEF FUNCTION}
+
+{$IFNDEF NO_EXTERNAL_VARS}
+{$DEFINE EXTVAR}
+{$I documents.inc}
+{$I preproc.inc}
+{$I xslt.inc}
+{$I xsltutils.inc}
+{$UNDEF EXTVAR}
+{$ENDIF}
+
+implementation
+
+end.
+

+ 1811 - 0
packages/libxml/src/xsltInternals.inc

@@ -0,0 +1,1811 @@
+(*
+ * Summary: internal data structures, constants and functions
+ * Description: Internal data structures, constants and functions used
+ *              by the XSLT engine.
+ *              They are not part of the API or ABI, i.e. they can change
+ *              without prior notice, use carefully.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF POINTER}
+  xsltRuntimeExtraPtr = ^xsltRuntimeExtra;
+  xsltTemplatePtr = ^xsltTemplate;
+  xsltTemplatePtrPtr = ^xsltTemplatePtr;
+  xsltDecimalFormatPtr = ^xsltDecimalFormat;
+  xsltDocumentPtr = ^xsltDocument;
+  xsltKeyDefPtr = ^xsltKeyDef;
+  xsltKeyTablePtr = ^xsltKeyTable;
+  xsltElemPreCompPtr = ^xsltElemPreComp;
+  xsltStackElemPtrPtr = ^xsltStackElemPtr;
+  xsltStylesheetPtr = ^xsltStylesheet;
+  xsltTransformContextPtr = ^xsltTransformContext;
+  {$IFDEF XSLT_REFACTORED}
+  xsltPointerListPtr = ^xsltPointerList;
+  xsltPrincipalStylesheetDataPtr = ^xsltPrincipalStylesheetData;
+  xsltStylePreCompPtr = ^xsltStylePreComp;
+  xsltNsListContainerPtr = ^xsltNsListContainer;
+  {$ELSE}
+  xsltNsListContainerPtr = Pointer;
+  xsltStylePreCompPtr = Pointer;
+  {$ENDIF}
+{$ENDIF} {POINTER}
+
+{
+/* #define XSLT_DEBUG_PROFILE_CACHE */
+
+/**
+ * XSLT_IS_TEXT_NODE:
+ *
+ * check if the argument is a text node
+ */
+#define XSLT_IS_TEXT_NODE(n) ((n != NULL) && \
+    (((n)->type == XML_TEXT_NODE) || \
+     ((n)->type == XML_CDATA_SECTION_NODE)))
+
+
+/**
+ * XSLT_MARK_RES_TREE_FRAG:
+ *
+ * internal macro to set up tree fragments
+ */
+#define XSLT_MARK_RES_TREE_FRAG(n) \
+    (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt");
+
+/**
+ * XSLT_IS_RES_TREE_FRAG:
+ *
+ * internal macro to test tree fragments
+ */
+#define XSLT_IS_RES_TREE_FRAG(n) \
+    ((n != NULL) && ((n)->type == XML_DOCUMENT_NODE) && \
+     ((n)->name != NULL) && ((n)->name[0] == ' '))
+
+/**
+ * XSLT_REFACTORED_KEYCOMP:
+ *
+ * Internal define to enable on-demand xsl:key computation.
+ * That's the only mode now but the define is kept for compatibility
+ */
+#define XSLT_REFACTORED_KEYCOMP
+
+/**
+ * XSLT_FAST_IF:
+ *
+ * Internal define to enable usage of xmlXPathCompiledEvalToBoolean()
+ * for XSLT "tests"; e.g. in <xsl:if test="/foo/bar">
+ */
+#define XSLT_FAST_IF
+
+/**
+ * XSLT_REFACTORED:
+ *
+ * Internal define to enable the refactored parts of Libxslt.
+ */
+/* #define XSLT_REFACTORED */
+/* ==================================================================== */
+
+/**
+ * XSLT_REFACTORED_VARS:
+ *
+ * Internal define to enable the refactored variable part of libxslt
+ */
+#define XSLT_REFACTORED_VARS
+
+#ifdef XSLT_REFACTORED
+
+extern const xmlChar *xsltXSLTAttrMarker;
+
+
+/* TODO: REMOVE: #define XSLT_REFACTORED_EXCLRESNS */
+
+/* TODO: REMOVE: #define XSLT_REFACTORED_NSALIAS */
+
+/**
+ * XSLT_REFACTORED_XSLT_NSCOMP
+ *
+ * Internal define to enable the pointer-comparison of
+ * namespaces of XSLT elements.
+ */
+/* #define XSLT_REFACTORED_XSLT_NSCOMP */
+
+#ifdef XSLT_REFACTORED_XSLT_NSCOMP
+
+extern const xmlChar *xsltConstNamespaceNameXSLT;
+
+/**
+ * IS_XSLT_ELEM_FAST:
+ *
+ * quick test to detect XSLT elements
+ */
+#define IS_XSLT_ELEM_FAST(n) \
+    (((n) != NULL) && ((n)->ns != NULL) && \
+    ((n)->ns->href == xsltConstNamespaceNameXSLT))
+
+/**
+ * IS_XSLT_ATTR_FAST:
+ *
+ * quick test to detect XSLT attributes
+ */
+#define IS_XSLT_ATTR_FAST(a) \
+    (((a) != NULL) && ((a)->ns != NULL) && \
+    ((a)->ns->href == xsltConstNamespaceNameXSLT))
+
+/**
+ * XSLT_HAS_INTERNAL_NSMAP:
+ *
+ * check for namespace mapping
+ */
+#define XSLT_HAS_INTERNAL_NSMAP(s) \
+    (((s) != NULL) && ((s)->principal) && \
+     ((s)->principal->principalData) && \
+     ((s)->principal->principalData->nsMap))
+
+/**
+ * XSLT_GET_INTERNAL_NSMAP:
+ *
+ * get pointer to namespace map
+ */
+#define XSLT_GET_INTERNAL_NSMAP(s) ((s)->principal->principalData->nsMap)
+
+#else /* XSLT_REFACTORED_XSLT_NSCOMP */
+
+/**
+ * IS_XSLT_ELEM_FAST:
+ *
+ * quick check whether this is an xslt element
+ */
+#define IS_XSLT_ELEM_FAST(n) \
+    (((n) != NULL) && ((n)->ns != NULL) && \
+     (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
+
+/**
+ * IS_XSLT_ATTR_FAST:
+ *
+ * quick check for xslt namespace attribute
+ */
+#define IS_XSLT_ATTR_FAST(a) \
+    (((a) != NULL) && ((a)->ns != NULL) && \
+     (xmlStrEqual((a)->ns->href, XSLT_NAMESPACE)))
+
+
+#endif /* XSLT_REFACTORED_XSLT_NSCOMP */
+
+
+/**
+ * XSLT_REFACTORED_MANDATORY_VERSION:
+ *
+ * TODO: Currently disabled to surpress regression test failures, since
+ *  the old behaviour was that a missing version attribute
+ *  produced a only a warning and not an error, which was incerrect.
+ *  So the regression tests need to be fixed if this is enabled.
+ */
+/* #define XSLT_REFACTORED_MANDATORY_VERSION */
+}
+
+{$IFDEF TYPE}
+{$IFDEF XSLT_REFACTORED}
+  (**
+   * xsltPointerList:
+   *
+   * Pointer-list for various purposes.
+   *)
+
+  xsltPointerList = record
+    items: PPointer;
+    number: cint;
+    size: cint;
+  end;
+{$ENDIF} {XSLT_REFACTORED}
+{$ENDIF} {TYPE}
+
+(**
+ * XSLT_REFACTORED_PARSING:
+ *
+ * Internal define to enable the refactored parts of Libxslt
+ * related to parsing.
+ *)
+(* #define XSLT_REFACTORED_PARSING *)
+
+{$IFDEF CONST}
+  (**
+   * XSLT_MAX_SORT:
+   *
+   * Max number of specified xsl:sort on an element.
+   *)
+  XSLT_MAX_SORT = 15;
+
+  (**
+   * XSLT_PAT_NO_PRIORITY:
+   *
+   * Specific value for pattern without priority expressed.
+   *)
+  XSLT_PAT_NO_PRIORITY = -12345789;
+{$ENDIF} {CONST}
+
+{$IFDEF TYPE}
+  (**
+   * xsltRuntimeExtra:
+   *
+   * Extra information added to the transformation context.
+   *)
+  xsltRuntimeExtra = record
+    info: Pointer;              (* pointer to the extra data *)
+    deallocate: xmlFreeFunc;    (* pointer to the deallocation routine *)
+    val: record                 (* dual-purpose field *)
+      case Boolean of
+        True: (
+          ptr: Pointer;         (* data not needing deallocation *)
+        );
+        False: (
+          ival: cint;        (* integer value storage *)
+        )
+    end;
+  end;
+
+{
+/**
+ * XSLT_RUNTIME_EXTRA_LST:
+ * @ctxt: the transformation context
+ * @nr: the index
+ *
+ * Macro used to access extra information stored in the context
+ */
+#define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info
+/**
+ * XSLT_RUNTIME_EXTRA_FREE:
+ * @ctxt: the transformation context
+ * @nr: the index
+ *
+ * Macro used to free extra information stored in the context
+ */
+#define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate
+/**
+ * XSLT_RUNTIME_EXTRA:
+ * @ctxt: the transformation context
+ * @nr: the index
+ *
+ * Macro used to define extra information stored in the context
+ */
+#define	XSLT_RUNTIME_EXTRA(ctxt, nr, typ) (ctxt)->extras[(nr)].val.typ
+}
+
+  (**
+   * xsltTemplate:
+   *
+   * The in-memory structure corresponding to an XSLT Template.
+   *)
+  xsltTemplate = record
+    next: xsltTemplatePtr;    (* chained list sorted by priority *)
+    style: xsltStylesheetPtr; (* the containing stylesheet *)
+    match: xmlCharPtr;        (* the matching string *)
+    priority: Single;         (* as given from the stylesheet, not computed *)
+    name: xmlCharPtr;         (* the local part of the name QName *)
+    nameURI: xmlCharPtr;      (* the URI part of the name QName *)
+    mode: xmlCharPtr;         (* the local part of the mode QName *)
+    modeURI: xmlCharPtr;      (* the URI part of the mode QName *)
+    content: xmlNodePtr;      (* the template replacement value *)
+    elem: xmlNodePtr;         (* the source element *)
+
+    (*
+    * TODO: @inheritedNsNr and @inheritedNs won't be used in the
+    *  refactored code.
+    *)
+    inheritedNsNr: cint;   (* number of inherited namespaces *)
+    inheritedNs: xmlNsPtrPtr; (* inherited non-excluded namespaces *)
+
+    (* Profiling information *)
+    nbCalls: cint;         (* the number of time the template was called *)
+    time: LongWord;           (* the time spent in this template *)
+    params: Pointer;          (* xsl:param instructions *)
+
+    templNr: cint;         (* Nb of templates in the stack *)
+    templMax: cint;        (* Size of the templtes stack *)
+    templCalledTab: xsltTemplatePtrPtr; (* templates called *)
+    templCountTab: PLongint;  (* .. and how often *)
+
+    (* Conflict resolution *)
+    position: cint;
+  end;
+
+  (**
+   * xsltDecimalFormat:
+   *
+   * Data structure of decimal-format.
+   *)
+  xsltDecimalFormat = record
+    next: xsltDecimalFormatPtr; (* chained list *)
+    name: xmlCharPtr;
+    (* Used for interpretation of pattern *)
+    digit: xmlCharPtr;
+    patternSeparator: xmlCharPtr;
+    (* May appear in result *)
+    minusSign: xmlCharPtr;
+    infinity: xmlCharPtr;
+    noNumber: xmlCharPtr; (* Not-a-number *)
+    (* Used for interpretation of pattern and may appear in result *)
+    decimalPoint: xmlCharPtr;
+    grouping: xmlCharPtr;
+    percent: xmlCharPtr;
+    permille: xmlCharPtr;
+    zeroDigit: xmlCharPtr;
+    nsUri: xmlCharPtr;
+  end;
+
+  (**
+   * xsltDocument:
+   *
+   * Data structure associated to a parsed document.
+   *)
+  xsltDocument = record
+    next: xsltDocumentPtr;     (* documents are kept in a chained list *)
+    main: cint;              (* is this the main document *)
+    doc: xmlDocPtr;             (* the parsed document *)
+    keys: Pointer;              (* key tables storage *)
+    includes: xsltDocumentPtr;  (* subsidiary includes *)
+    preproc: cint;           (* pre-processing already done *)
+    nbKeysComputed: cint;
+  end;
+
+  (**
+   * xsltKeyDef:
+   *
+   * Representation of an xsl:key.
+   *)
+  xsltKeyDef = record
+    next: xsltKeyDefPtr;
+    inst: xmlNodePtr;
+    name: xmlCharPtr;
+    nameURI: xmlCharPtr;
+    match: xmlCharPtr;
+    use: xmlCharPtr;
+    comp: xmlXPathCompExprPtr;
+    usecomp: xmlXPathCompExprPtr;
+    nsList: xmlNsPtrPtr;          (* the namespaces in scope *)
+    nsNr: cint;                (* the number of namespaces in scope *)
+  end;
+
+  (**
+   * xsltKeyTable:
+   *
+   * Holds the computed keys for key definitions of the same QName.
+   * Is owned by an xsltDocument.
+   *)
+  xsltKeyTable = record
+    next: xsltKeyTablePtr;
+    name: xmlCharPtr;
+    nameURI: xmlCharPtr;
+    keys: xmlHashTablePtr;
+  end;
+
+  (**
+   * xsltTransformFunction:
+   * @ctxt: the XSLT transformation context
+   * @node: the input node
+   * @inst: the stylesheet node
+   * @comp: the compiled information from the stylesheet
+   *
+   * Signature of the function associated to elements part of the
+   * stylesheet language like xsl:if or xsl:apply-templates.
+   *)
+  xsltTransformFunction = procedure(ctxt: xsltTransformContextPtr;
+    node: xmlNodePtr; inst: xmlNodePtr; comp: xsltElemPreCompPtr); EXTDECL;
+
+  (**
+   * xsltSortFunc:
+   * @ctxt:    a transformation context
+   * @sorts:   the node-set to sort
+   * @nbsorts: the number of sorts
+   *
+   * Signature of the function to use during sorting
+   *)
+  xsltSortFunc = procedure(ctxt: xsltTransformContextPtr; sorts: xmlNodePtrPtr;
+    nbsorts: cint); EXTDECL;
+
+  xsltStyleType = (
+    XSLT_FUNC_COPY = 1,
+    XSLT_FUNC_SORT,
+    XSLT_FUNC_TEXT,
+    XSLT_FUNC_ELEMENT,
+    XSLT_FUNC_ATTRIBUTE,
+    XSLT_FUNC_COMMENT,
+    XSLT_FUNC_PI,
+    XSLT_FUNC_COPYOF,
+    XSLT_FUNC_VALUEOF,
+    XSLT_FUNC_NUMBER,
+    XSLT_FUNC_APPLYIMPORTS,
+    XSLT_FUNC_CALLTEMPLATE,
+    XSLT_FUNC_APPLYTEMPLATES,
+    XSLT_FUNC_CHOOSE,
+    XSLT_FUNC_IF,
+    XSLT_FUNC_FOREACH,
+    XSLT_FUNC_DOCUMENT,
+    XSLT_FUNC_WITHPARAM,
+    XSLT_FUNC_PARAM,
+    XSLT_FUNC_VARIABLE,
+    XSLT_FUNC_WHEN,
+    XSLT_FUNC_EXTENSION
+    {$IFDEF XSLT_REFACTORED}
+    ,
+    XSLT_FUNC_OTHERWISE,
+    XSLT_FUNC_FALLBACK,
+    XSLT_FUNC_MESSAGE,
+    XSLT_FUNC_INCLUDE,
+    XSLT_FUNC_ATTRSET,
+    XSLT_FUNC_LITERAL_RESULT_ELEMENT,
+    XSLT_FUNC_UNKOWN_FORWARDS_COMPA
+    {$ENDIF}
+   );
+
+  (**
+   * xsltElemPreCompDeallocator:
+   * @comp:  the #xsltElemPreComp to free up
+   *
+   * Deallocates an #xsltElemPreComp structure.
+   *)
+  xsltElemPreCompDeallocator = procedure(comp: xsltElemPreCompPtr); EXTDECL;
+
+  (**
+   * xsltElemPreComp:
+   *
+   * The basic structure for compiled items of the AST of the XSLT processor.
+   * This structure is also intended to be extended by extension implementors.
+   * TODO: This is somehow not nice, since it has a "free" field, which
+   *   derived stylesheet-structs do not have.
+   *)
+  xsltElemPreComp = record
+    next: xsltElemPreCompPtr;     (* next item in the global chained
+                                     list held by xsltStylesheet. *)
+    &type: xsltStyleType;         (* type of the element *)
+    func: xsltTransformFunction;  (* handling function *)
+    inst: xmlNodePtr;             (* the node in the stylesheet's tree
+  					 corresponding to this item *)
+
+    (* end of common part *)
+    free: xsltElemPreCompDeallocator; (* the deallocator *)
+  end;
+
+{$ENDIF} {TYPE}
+
+{$IFDEF XSLT_REFACTORED}
+
+{$IFDEF FUNCTION}
+(*
+* Some pointer-list utility functions.
+*)
+function xsltPointerListCreate(initialSize: cint): xsltPointerListPtr; EXTDECL; external xsltlib;
+procedure xsltPointerListFree(list: xsltPointerListPtr); EXTDECL; external xsltlib;
+procedure xsltPointerListClear(list: xsltPointerListPtr); EXTDECL; external xsltlib;
+function xsltPointerListAddSize(list: xsltPointerListPtr; item: Pointer; initialSize: cint): cint; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(*
+* Some pointer-list utility functions.
+*)
+  xsltPointerListCreate: function(initialSize: cint): xsltPointerListPtr; EXTDECL;
+  xsltPointerListFree: procedure(list: xsltPointerListPtr); EXTDECL;
+  xsltPointerListClear: procedure(list: xsltPointerListPtr); EXTDECL;
+  xsltPointerListAddSize: function(list: xsltPointerListPtr; item: Pointer; initialSize: cint): cint; EXTDECL;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF TYPE}
+(************************************************************************
+ *									*
+ * Refactored structures                                                *
+ *									*
+ ************************************************************************)
+
+  xsltNsListContainer = record
+    list: xmlNsPtrPtr;
+    totalNumber: cint;
+    xpathNumber: cint;
+  end;
+
+  (**
+   * _xsltStylePreComp:
+   *
+   * The abstract basic structure for items of the XSLT processor.
+   * This includes:
+   * 1) compiled forms of XSLT instructions (e.g. xsl:if, xsl:attribute, etc.)
+   * 2) compiled forms of literal result elements
+   * 3) various properties for XSLT instructions (e.g. xsl:when,
+   *    xsl:with-param)
+   *
+   * REVISIT TODO: Keep this structure equal to the fields
+   *   defined by XSLT_ITEM_COMMON_FIELDS
+   *)
+  xsltStylePreComp = record
+    next: xsltElemPreCompPtr;   (* next item in the global chained
+  				 list held by xsltStylesheet *)
+    &type: xsltStyleType;       (* type of the item *)
+    func: xsltTransformFunction; (* handling function *)
+    inst: xmlNodePtr;           (* the node in the stylesheet's tree
+  				 corresponding to this item. *)
+    (* Currently no navigational fields. *)
+    inScopeNs: xsltNsListContainerPtr;
+  end;
+
+  (**
+   * xsltStyleBasicEmptyItem:
+   *
+   * Abstract structure only used as a short-cut for
+   * XSLT items with no extra fields.
+   * NOTE that it is intended that this structure looks the same as
+   *  _xsltStylePreComp.
+   *)
+  xsltStyleBasicEmptyItemPtr = ^xsltStyleBasicEmptyItem;
+  xsltStyleBasicEmptyItem = record
+    {$I xslt_item_common_fields.inc}
+  end;
+
+  (**
+   * xsltStyleBasicExpressionItem:
+   *
+   * Abstract structure only used as a short-cut for
+   * XSLT items with just an expression.
+   *)
+
+  xsltStyleBasicExpressionItemPtr = ^xsltStyleBasicExpressionItem;
+  xsltStyleBasicExpressionItem = record
+    {$I xslt_item_common_fields.inc}
+    select: xmlCharPtr;        (* TODO: Change this to "expression". *)
+    comp: xmlXPathCompExprPtr; (* TODO: Change this to compExpr. *)
+  end;
+
+(************************************************************************
+ *									*
+ * XSLT-instructions/declarations                                       *
+ *									*
+ ************************************************************************)
+
+  (**
+   * xsltStyleItemElement:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:element
+   *  name = { qname }
+   *  namespace = { uri-reference }
+   *  use-attribute-sets = qnames>
+   *  <!-- Content: template -->
+   * </xsl:element>
+   *)
+  xsltStyleItemElementPtr = ^xsltStyleItemElement;
+  xsltStyleItemElement = record
+    {$I xslt_item_common_fields.inc}
+    use: xmlCharPtr;
+    has_use: cint;
+    name: xmlCharPtr;
+    has_name: cint;
+    ns: xmlCharPtr;
+    nsPrefix: xmlCharPtr;
+    has_ns: cint;
+  end;
+
+  (**
+   * xsltStyleItemAttribute:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:attribute
+   *  name = { qname }
+   *  namespace = { uri-reference }>
+   *  <!-- Content: template -->
+   * </xsl:attribute>
+   *)
+  xsltStyleItemAttributePtr = ^xsltStyleItemAttribute;
+  xsltStyleItemAttribute = record
+    {$I xslt_item_common_fields.inc}
+    name: xmlCharPtr;
+    has_name: cint;
+    ns: xmlCharPtr;
+    nsPrefix: xmlCharPtr;
+    has_ns: cint;
+  end;
+
+  (**
+   * xsltStyleItemText:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:text
+   *  disable-output-escaping = "yes" | "no">
+   *  <!-- Content: #PCDATA -->
+   * </xsl:text>
+   *)
+  xsltStyleItemTextPtr = ^xsltStyleItemText;
+  xsltStyleItemText = record
+    {$I xslt_item_common_fields.inc}
+    noescape: cint;                (* text *)
+  end;
+
+  (**
+   * xsltStyleItemComment:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:comment>
+   *  <!-- Content: template -->
+   * </xsl:comment>
+   *)
+  xsltStyleItemComment = xsltStyleBasicEmptyItem;
+  xsltStyleItemCommentPtr = ^xsltStyleItemComment;
+
+  (**
+   * xsltStyleItemPI:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:processing-instruction
+   *  name = { ncname }>
+   *  <!-- Content: template -->
+   * </xsl:processing-instruction>
+   *)
+  xsltStyleItemPIPtr = ^xsltStyleItemPI;
+  xsltStyleItemPI = record
+    {$I xslt_item_common_fields.inc}
+    name: xmlCharPtr;
+    has_name: cint;
+  end;
+
+  (**
+   * xsltStyleItemApplyImports:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:apply-imports />
+   *)
+  xsltStyleItemApplyImports = xsltStyleBasicEmptyItem;
+  xsltStyleItemApplyImportsPtr = ^xsltStyleItemApplyImports;
+
+  (**
+   * xsltStyleItemApplyTemplates:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:apply-templates
+   *  select = node-set-expression
+   *  mode = qname>
+   *  <!-- Content: (xsl:sort | xsl:with-param)* -->
+   * </xsl:apply-templates>
+   *)
+  xsltStyleItemApplyTemplatesPtr = ^xsltStyleItemApplyTemplates;
+  xsltStyleItemApplyTemplates = record
+    {$I xslt_item_common_fields.inc}
+    mode: xmlCharPtr;           (* apply-templates *)
+    modeURI: xmlCharPtr;        (* apply-templates *)
+    select: xmlCharPtr;         (* sort, copy-of, value-of, apply-templates *)
+    comp: xmlXPathCompExprPtr;  (* a precompiled XPath expression *)
+    (* TODO: with-params *)
+  end;
+
+  (**
+   * xsltStyleItemCallTemplate:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:call-template
+   *  name = qname>
+   *  <!-- Content: xsl:with-param* -->
+   * </xsl:call-template>
+   *)
+  xsltStyleItemCallTemplatePtr = ^xsltStyleItemCallTemplate;
+  xsltStyleItemCallTemplate = record
+    {$I xslt_item_common_fields.inc}
+    templ: xsltTemplatePtr;              (* call-template *)
+    name: xmlCharPtr;                    (* element, attribute, pi *)
+    has_name: cint;                   (* element, attribute, pi *)
+    ns: xmlCharPtr;                      (* element *)
+    has_ns: cint;                     (* element *)
+    (* TODO: with-params *)
+  end;
+
+  (**
+   * xsltStyleItemCopy:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:copy
+   *  use-attribute-sets = qnames>
+   *  <!-- Content: template -->
+   * </xsl:copy>
+   *)
+  xsltStyleItemCopyPtr = ^xsltStyleItemCopy;
+  xsltStyleItemCopy = record
+    {$I xslt_item_common_fields.inc}
+    use: xmlCharPtr;            (* copy, element *)
+    has_use: cint;           (* copy, element *)
+  end;
+
+  (**
+   * xsltStyleItemIf:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:if
+   *  test = boolean-expression>
+   *  <!-- Content: template -->
+   * </xsl:if>
+   *)
+  xsltStyleItemIfPtr = ^xsltStyleItemIf;
+  xsltStyleItemIf = record
+    {$I xslt_item_common_fields.inc}
+    test: xmlCharPtr;            (* if *)
+    comp: xmlXPathCompExprPtr;   (* a precompiled XPath expression *)
+  end;
+
+  (**
+   * xsltStyleItemCopyOf:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:copy-of
+   *  select = expression />
+   *)
+  xsltStyleItemCopyOf = xsltStyleBasicExpressionItem;
+  xsltStyleItemCopyOfPtr = ^xsltStyleItemCopyOf;
+
+  (**
+   * xsltStyleItemValueOf:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:value-of
+   *  select = string-expression
+   *  disable-output-escaping = "yes" | "no" />
+   *)
+  xsltStyleItemValueOfPtr = ^xsltStyleItemValueOf;
+  xsltStyleItemValueOf = record
+    {$I xslt_item_common_fields.inc}
+    select: xmlCharPtr;
+    comp: xmlXPathCompExprPtr;   (* a precompiled XPath expression *)
+    noescape: cint;
+  end;
+
+  (**
+   * xsltStyleItemNumber:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:number
+   *  level = "single" | "multiple" | "any"
+   *  count = pattern
+   *  from = pattern
+   *  value = number-expression
+   *  format = { string }
+   *  lang = { nmtoken }
+   *  letter-value = { "alphabetic" | "traditional" }
+   *  grouping-separator = { char }
+   *  grouping-size = { number } />
+   *)
+  xsltStyleItemNumberPtr = ^xsltStyleItemNumber;
+  xsltStyleItemNumber = record
+    {$I xslt_item_common_fields.inc}
+    numdata: xsltNumberData;    (* number *)
+  end;
+
+  (**
+   * xsltStyleItemChoose:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:choose>
+   *  <!-- Content: (xsl:when+, xsl:otherwise?) -->
+   * </xsl:choose>
+   *)
+  xsltStyleItemChoose = xsltStyleBasicEmptyItem;
+  xsltStyleItemChoosePtr = ^xsltStyleItemChoose;
+
+  (**
+   * xsltStyleItemFallback:
+   *
+   * <!-- Category: instruction -->
+   *  <xsl:fallback>
+   *  <!-- Content: template -->
+   * </xsl:fallback>
+   *)
+  xsltStyleItemFallback = xsltStyleBasicEmptyItem;
+  xsltStyleItemFallbackPtr = ^xsltStyleItemFallback;
+
+  (**
+   * xsltStyleItemForEach:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:for-each
+   *   select = node-set-expression>
+   *   <!-- Content: (xsl:sort*, template) -->
+   * </xsl:for-each>
+   *)
+  xsltStyleItemForEach = xsltStyleBasicExpressionItem;
+  xsltStyleItemForEachPtr = ^xsltStyleItemForEach;
+
+  (**
+   * xsltStyleItemMessage:
+   *
+   * <!-- Category: instruction -->
+   * <xsl:message
+   *   terminate = "yes" | "no">
+   *   <!-- Content: template -->
+   * </xsl:message>
+   *)
+  xsltStyleItemMessagePtr = ^xsltStyleItemMessage;
+  xsltStyleItemMessage = record
+    {$I xslt_item_common_fields.inc}
+    terminate: cint;
+  end;
+
+  (**
+   * xsltStyleItemDocument:
+   *
+   * NOTE: This is not an instruction of XSLT 1.0.
+   *)
+  xsltStyleItemDocumentPtr = ^xsltStyleItemDocument;
+  xsltStyleItemDocument = record
+    {$I xslt_item_common_fields.inc}
+    ver11: cint;              (* assigned: in xsltDocumentComp;
+                                    read: nowhere;
+                                    TODO: Check if we need. *)
+    filename: xmlCharPtr;        (* document URL *)
+    has_filename: cint;
+  end;
+
+(************************************************************************
+ *									*
+ * Non-instructions (actually properties of instructions/declarations)  *
+ *									*
+ ************************************************************************)
+
+  (**
+   * xsltStyleBasicItemVariable:
+   *
+   * Basic struct for xsl:variable, xsl:param and xsl:with-param.
+   * It's currently important to have equal fields, since
+   * xsltParseStylesheetCallerParam() is used with xsl:with-param from
+   * the xslt side and with xsl:param from the exslt side (in
+   * exsltFuncFunctionFunction()).
+   *
+   * FUTURE NOTE: In XSLT 2.0 xsl:param, xsl:variable and xsl:with-param
+   *   have additional different fields.
+   *)
+  xsltStyleBasicItemVariablePtr = ^xsltStyleBasicItemVariable;
+  xsltStyleBasicItemVariable = record
+    {$I xslt_item_common_fields.inc}
+    select: xmlCharPtr;
+    comp: xmlXPathCompExprPtr;
+
+    name: xmlCharPtr;
+    has_name: cint;
+    ns: xmlCharPtr;
+    has_ns: cint;
+  end;
+
+  (**
+   * xsltStyleItemVariable:
+   *
+   * <!-- Category: top-level-element -->
+   * <xsl:param
+   *   name = qname
+   *   select = expression>
+   *   <!-- Content: template -->
+   * </xsl:param>
+   *)
+  xsltStyleItemVariable = xsltStyleBasicItemVariable;
+  xsltStyleItemVariablePtr = ^xsltStyleItemVariable;
+
+  (**
+   * xsltStyleItemParam:
+   *
+   * <!-- Category: top-level-element -->
+   * <xsl:param
+   *   name = qname
+   *   select = expression>
+   *   <!-- Content: template -->
+   * </xsl:param>
+   *)
+  xsltStyleItemParamPtr = ^xsltStyleItemParam;
+  xsltStyleItemParam = record
+    {$I xslt_item_common_fields.inc}
+    select: xmlCharPtr;
+    comp: xmlXPathCompExprPtr;
+
+    name: xmlCharPtr;
+    has_name: cint;
+    ns: xmlCharPtr;
+    has_ns: cint;
+  end;
+
+  (**
+   * xsltStyleItemWithParam:
+   *
+   * <xsl:with-param
+   *  name = qname
+   *  select = expression>
+   *  <!-- Content: template -->
+   * </xsl:with-param>
+   *)
+  xsltStyleItemWithParam = xsltStyleBasicItemVariable;
+  xsltStyleItemWithParamPtr = ^xsltStyleItemWithParam;
+
+  (**
+   * xsltStyleItemSort:
+   *
+   * Reflects the XSLT xsl:sort item.
+   * Allowed parents: xsl:apply-templates, xsl:for-each
+   * <xsl:sort
+   *   select = string-expression
+   *   lang = { nmtoken }
+   *   data-type = { "text" | "number" | qname-but-not-ncname }
+   *   order = { "ascending" | "descending" }
+   *   case-order = { "upper-first" | "lower-first" } />
+   *)
+  xsltStyleItemSortPtr = ^xsltStyleItemSort;
+  xsltStyleItemSort = record
+    {$I xslt_item_common_fields.inc}
+    stype: xmlCharPtr;          (* sort *)
+    has_stype: cint;         (* sort *)
+    number: cint;            (* sort *)
+    order: xmlCharPtr;          (* sort *)
+    has_order: cint;         (* sort *)
+    descending: cint;        (* sort *)
+    lang: xmlCharPtr;           (* sort *)
+    has_lang: cint;          (* sort *)
+    locale: xsltLocale;         (* sort *)
+    case_order: xmlCharPtr;     (* sort *)
+    lower_first: cint;       (* sort *)
+
+    use: xmlCharPtr;
+    has_use: cint;
+
+    select: xmlCharPtr;         (* sort, copy-of, value-of, apply-templates *)
+
+    comp: xmlXPathCompExprPtr;  (* a precompiled XPath expression *)
+  end;
+
+
+  (**
+   * xsltStyleItemWhen:
+   *
+   * <xsl:when
+   *   test = boolean-expression>
+   *   <!-- Content: template -->
+   * </xsl:when>
+   * Allowed parent: xsl:choose
+   *)
+  xsltStyleItemWhenPtr = ^xsltStyleItemWhen;
+  xsltStyleItemWhen = record
+    {$I xslt_item_common_fields.inc}
+    test: xmlCharPtr;
+    comp: xmlXPathCompExprPtr;
+  end;
+
+  (**
+   * xsltStyleItemOtherwise:
+   *
+   * Allowed parent: xsl:choose
+   * <xsl:otherwise>
+   *   <!-- Content: template -->
+   * </xsl:otherwise>
+   *)
+  xsltStyleItemOtherwisePtr = ^xsltStyleItemOtherwise;
+  xsltStyleItemOtherwise = record
+    {$I xslt_item_common_fields.inc}
+  end;
+
+  xsltStyleItemIncludePtr = ^xsltStyleItemInclude;
+  xsltStyleItemInclude = record
+    {$I xslt_item_common_fields.inc}
+    include: xsltDocumentPtr;
+  end;
+
+(************************************************************************
+ *                                                                      *
+ *  XSLT elements in forwards-compatible mode                           *
+ *                                                                      *
+ ************************************************************************)
+
+  xsltStyleItemUknownPtr = ^xsltStyleItemUknown;
+  xsltStyleItemUknown = record
+    {$I xslt_item_common_fields.inc}
+  end;
+
+(************************************************************************
+ *									*
+ *  Extension elements                                                  *
+ *									*
+ ************************************************************************)
+
+  (*
+   * xsltStyleItemExtElement:
+   *
+   * Reflects extension elements.
+   *
+   * NOTE: Due to the fact that the structure xsltElemPreComp is most
+   * probably already heavily in use out there by users, so we cannot
+   * easily change it, we'll create an intermediate structure which will
+   * hold an xsltElemPreCompPtr.
+   * BIG NOTE: The only problem I see here is that the user processes the
+   *  content of the stylesheet tree, possibly he'll lookup the node->psvi
+   *  fields in order to find subsequent extension functions.
+   *  In this case, the user's code will break, since the node->psvi
+   *  field will hold now the xsltStyleItemExtElementPtr and not
+   *  the xsltElemPreCompPtr.
+   *  However the place where the structure is anchored in the node-tree,
+   *  namely node->psvi, has beed already once been moved from node->_private
+   *  to node->psvi, so we have a precedent here, which, I think, should allow
+   *  us to change such semantics without headaches.
+   *)
+  xsltStyleItemExtElementPtr = ^xsltStyleItemExtElement;
+  xsltStyleItemExtElement = record
+    {$I xslt_item_common_fields.inc}
+    item: xsltElemPreCompPtr;
+  end;
+
+(************************************************************************
+ *									*
+ *  Literal result elements                                             *
+ *									*
+ ************************************************************************)
+
+  xsltEffectiveNsPtr = ^xsltEffectiveNs;
+  xsltEffectiveNs = record
+    nextInStore: xsltEffectiveNsPtr; (* storage next *)
+    next: xsltEffectiveNsPtr;        (* next item in the list *)
+    prefix: xmlCharPtr;
+    nsName: xmlCharPtr;
+    (*
+    * Indicates if eclared on the literal result element; dunno if really
+    * needed.
+    *)
+    holdByElem: cint;
+  end;
+
+  (*
+   * Info for literal result elements.
+   * This will be set on the elem->psvi field and will be
+   * shared by literal result elements, which have the same
+   * excluded result namespaces; i.e., this *won't* be created uniquely
+   * for every literal result element.
+   *)
+  xsltStyleItemLRElementInfoPtr = ^xsltStyleItemLRElementInfo;
+  xsltStyleItemLRElementInfo = record
+    {$I xslt_item_common_fields.inc}
+    (*
+    * @effectiveNs is the set of effective ns-nodes
+    *  on the literal result element, which will be added to the result
+    *  element if not already existing in the result tree.
+    *  This means that excluded namespaces (via exclude-result-prefixes,
+    *  extension-element-prefixes and the XSLT namespace) not added
+    *  to the set.
+    *  Namespace-aliasing was applied on the @effectiveNs.
+    *)
+    effectiveNs: xsltEffectiveNsPtr;
+  end;
+
+  xsltNsAliasPtr = ^xsltNsAlias;
+  xsltNsAlias = record
+    next: xsltNsAliasPtr; (* next in the list *)
+    literalNs: xmlNsPtr;
+    targetNs: xmlNsPtr;
+    docOfTargetNs: xmlDocPtr;
+  end;
+
+  {$ifdef XSLT_REFACTORED_XSLT_NSCOMP}
+
+  xsltNsMapPtr = ^xsltNsMap;
+  xsltNsMap = record
+    next: xsltNsMapPtr; (* next in the list *)
+    doc: xmlDocPtr;
+    elem: xmlNodePtr; (* the element holding the ns-decl *)
+    ns: xmlNsPtr; (* the xmlNs structure holding the XML namespace name *)
+    origNsName: xmlCharPtr; (* the original XML namespace name *)
+    newNsName: xmlCharPtr; (* the mapped XML namespace name *)
+  end;
+
+  {$endif}
+
+(************************************************************************
+ *									*
+ *  Compile-time structures for *internal* use only                     *
+ *									*
+ ************************************************************************)
+
+  xsltNsListPtr = ^xsltNsList;
+  xsltNsList = record
+    next: xsltNsListPtr; (* next in the list *)
+    ns: xmlNsPtr;
+  end;
+
+  (*
+  * xsltVarInfo:
+  *
+  * Used at compilation time for parameters and variables.
+  *)
+  xsltVarInfoPtr = ^xsltVarInfo;
+  xsltVarInfo = record
+    next: xsltVarInfoPtr; (* next in the list *)
+    prev: xsltVarInfoPtr;
+    depth: cint; (* the depth in the tree *)
+    name: xmlCharPtr;
+    nsName: xmlCharPtr;
+  end;
+
+  (**
+   * xsltCompilerNodeInfo:
+   *
+   * Per-node information during compile-time.
+   *)
+  xsltCompilerNodeInfoPtr = ^xsltCompilerNodeInfo;
+  xsltCompilerNodeInfo = record
+    next: xsltCompilerNodeInfoPtr;
+    prev: xsltCompilerNodeInfoPtr;
+    node: xmlNodePtr;
+    depth: cint;
+    templ: xsltTemplatePtr;   (* The owning template *)
+    category: cint;        (* XSLT element, LR-element or
+                                extension element *)
+    &type: xsltStyleType;
+    item: xsltElemPreCompPtr; (* The compiled information *)
+    (* The current in-scope namespaces *)
+    inScopeNs: xsltNsListContainerPtr;
+    (* The current excluded result namespaces *)
+    exclResultNs: xsltPointerListPtr;
+    (* The current extension instruction namespaces *)
+    extElemNs: xsltPointerListPtr;
+
+    (* The current info for literal result elements. *)
+    litResElemInfo: xsltStyleItemLRElementInfoPtr ;
+    (*
+    * Set to 1 if in-scope namespaces changed,
+    *  or excluded result namespaces changed,
+    *  or extension element namespaces changed.
+    * This will trigger creation of new infos
+    *  for literal result elements.
+    *)
+    nsChanged: cint;
+    preserveWhitespace: cint;
+    stripWhitespace: cint;
+    isRoot: cint; (* whether this is the stylesheet's root node *)
+    forwardsCompat: cint; (* whether forwards-compatible mode is enabled *)
+    (* whether the content of an extension element was processed *)
+    extContentHandled: cint;
+    (* the type of the current child *)
+    curChildType: xsltStyleType;
+  end;
+
+  (**
+   * XSLT_CCTXT:
+   *
+   * get pointer to compiler context
+   */
+  #define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
+  *)
+
+  xsltErrorSeverityType = (
+    XSLT_ERROR_SEVERITY_ERROR = 0,
+    XSLT_ERROR_SEVERITY_WARNING
+  );
+
+  xsltCompilerCtxtPtr = ^xsltCompilerCtxt;
+  xsltCompilerCtxt = record
+    errorCtxt: Pointer;            (* user specific error context *)
+    (*
+     * used for error/warning reports; e.g. XSLT_ERROR_SEVERITY_WARNING *)
+    errSeverity: xsltErrorSeverityType;
+    warnings: cint;             (* TODO: number of warnings found at
+                                      compilation *)
+    errors: cint;               (* TODO: number of errors found at
+                                      compilation *)
+    dict: xmlDictPtr;
+    style: xsltStylesheetPtr;
+    simplified: cint; (* whether this is a simplified stylesheet *)
+    (* TODO: structured/unstructured error contexts. *)
+    depth: cint; (* Current depth of processing *)
+
+    inode: xsltCompilerNodeInfoPtr;
+    inodeList: xsltCompilerNodeInfoPtr;
+    inodeLast: xsltCompilerNodeInfoPtr;
+    tmpList: xsltPointerListPtr; (* Used for various purposes *)
+    (*
+    * The XSLT version as specified by the stylesheet's root element.
+    *)
+    isInclude: cint;
+    hasForwardsCompat: cint; (* whether forwards-compatible mode was used
+                                   in a parsing episode *)
+    maxNodeInfos: cint; (* TEMP TODO: just for the interest *)
+    maxLREs: cint;      (* TEMP TODO: just for the interest *)
+    (*
+    * In order to keep the old behaviour, applying strict rules of
+    * the spec can be turned off. This has effect only on special
+    * mechanisms like whitespace-stripping in the stylesheet.
+    *)
+    strict: cint;
+    psData: xsltPrincipalStylesheetDataPtr;
+    unknownItem: xsltStyleItemUknownPtr;
+    hasNsAliases: cint; (* Indicator if there was an xsl:namespace-alias. *)
+    nsAliases: xsltNsAliasPtr;
+    ivars: xsltVarInfoPtr; (* Storage of local in-scope variables/params. *)
+    ivar: xsltVarInfoPtr;  (* topmost local variable/param. *)
+  end;
+
+{$ENDIF} {TYPE}
+
+{$ELSE} (* XSLT_REFACTORED *)
+
+{$IFDEF TYEP}
+  (*
+  * The old structures before refactoring.
+  *)
+
+  (**
+   * _xsltStylePreComp:
+   *
+   * The in-memory structure corresponding to XSLT stylesheet constructs
+   * precomputed data.
+   *)
+  xsltStylePreComp = record
+    next: xsltElemPreCompPtr;   (* chained list *)
+    &type: xsltStyleType;       (* type of the element *)
+    func: xsltTransformFunction;(* handling function *)
+    inst: xmlNodePtr;		(* the instruction *)
+
+    (*
+     * Pre computed values.
+     *)
+
+    stype: xmlCharPtr;          (* sort *)
+    has_stype: cint;         (* sort *)
+    number: cint;            (* sort *)
+    order: xmlCharPtr;          (* sort *)
+    has_order: cint;         (* sort *)
+    descending: cint;        (* sort *)
+    lang: xmlCharPtr;           (* sort *)
+    has_lang: cint;          (* sort *)
+    locale: xsltLocale;         (* sort *)
+    case_order: xmlCharPtr;     (* sort *)
+    lower_first: cint;       (* sort *)
+
+    use: xmlCharPtr;            (* copy, element *)
+    has_use: cint;           (* copy, element *)
+
+    noescape: cint;          (* text *)
+
+    name: xmlCharPtr;           (* element, attribute, pi *)
+    has_name: cint;          (* element, attribute, pi *)
+    ns: xmlCharPtr;             (* element *)
+    has_ns: cint;            (* element *)
+
+    mode: xmlCharPtr;           (* apply-templates *)
+    modeURI: xmlCharPtr;        (* apply-templates *)
+
+    test: xmlCharPtr;           (* if *)
+
+    templ: xsltTemplatePtr;     (* call-template *)
+
+    select: xmlCharPtr;         (* sort, copy-of, value-of, apply-templates *)
+
+    ver11: cint;                (* document *)
+    filename: xmlCharPtr;       (* document URL *)
+    has_filename: cint;         (* document *)
+
+    numdata: xsltNumberData;    (* number *)
+
+    comp: xmlXPathCompExprPtr;  (* a precompiled XPath expression *)
+    nsList: xmlNsPtrPtr;        (* the namespaces in scope *)
+    nsNr: cint;                 (* the number of namespaces in scope *)
+  end;
+{$ENDIF} {TYPE}
+
+{$ENDIF} (* XSLT_REFACTORED *)
+
+{$IFDEF TYPE}
+  (*
+   * The in-memory structure corresponding to an XSLT Variable
+   * or Param.
+   *)
+  xsltStackElemPtr = ^xsltStackElem;
+  xsltStackElem = record
+    next: xsltStackElemPtr;     (* chained list *)
+    comp: xsltStylePreCompPtr;  (* the compiled form *)
+    computed: cint;             (* was the evaluation done *)
+    name: xmlCharPtr;           (* the local part of the name QName *)
+    nameURI: xmlCharPtr;        (* the URI part of the name QName *)
+    select: xmlCharPtr;         (* the eval string *)
+    tree: xmlNodePtr;           (* the sequence constructor if no eval
+                                   string or the location *)
+    value: xmlXPathObjectPtr;   (* The value if computed *)
+    fragment: xmlDocPtr;        (* The Result Tree Fragments (needed for XSLT 1.0)
+                                   which are bound to the variable's lifetime. *)
+    level: cint;                (* the depth in the tree;
+                                   -1 if persistent (e.g. a given xsl:with-param) *)
+    context: xsltTransformContextPtr; (* The transformation context; needed to cache
+                                         the variables *)
+    flags: cint;
+  end;
+
+{$IFDEF XSLT_REFACTORED}
+
+  xsltPrincipalStylesheetData = record
+    (*
+    * Namespace dictionary for ns-prefixes and ns-names:
+    * TODO: Shared between stylesheets, and XPath mechanisms.
+    *   Not used yet.
+    *)
+    namespaceDict: xmlDictPtr;
+    (*
+    * Global list of in-scope namespaces.
+    *)
+    inScopeNamespaces: xsltPointerListPtr;
+    (*
+    * Global list of information for [xsl:]excluded-result-prefixes.
+    *)
+    exclResultNamespaces: xsltPointerListPtr;
+    (*
+    * Global list of information for [xsl:]extension-element-prefixes.
+    *)
+    extElemNamespaces: xsltPointerListPtr;
+    effectiveNs: xsltEffectiveNsPtr;
+{$IFDEF XSLT_REFACTORED_XSLT_NSCOMP}
+    (*
+    * Namespace name map to get rid of string comparison of namespace names.
+    *)
+    nsMap: xsltNsMapPtr;
+{$ENDIF}
+  end;
+
+{$ENDIF} {XSLT_REFACTORED}
+
+  (*
+   * Note that we added a @compCtxt field to anchor an stylesheet compilation
+   * context, since, due to historical reasons, various compile-time function
+   * take only the stylesheet as argument and not a compilation context.
+   *)
+  xsltStylesheet = record
+    (*
+     * The stylesheet import relation is kept as a tree.
+     *)
+    parent: xsltStylesheetPtr;
+    next: xsltStylesheetPtr;
+    imports: xsltStylesheetPtr;
+
+    docList: xsltDocumentPtr;         (* the include document list *)
+
+    (*
+     * General data on the style sheet document.
+     *)
+    doc: xmlDocPtr;                   (* the parsed XML stylesheet *)
+    stripSpaces: xmlHashTablePtr;     (* the hash table of the strip-space and
+                                         preserve space elements *)
+    stripAll: cint;                   (* strip-space * (1) preserve-space * (-1) *)
+    cdataSection: xmlHashTablePtr;    (* the hash table of the cdata-section *)
+
+    (*
+     * Global variable or parameters.
+     *)
+    variables: xsltStackElemPtr;     (* linked list of param and variables *)
+
+    (*
+     * Template descriptions.
+     *)
+    templates: xsltTemplatePtr;           (* the ordered list of templates *)
+    templatesHash: xmlHashTablePtr;       (* hash table or wherever compiled
+                                             templates information is stored *)
+    rootMatch: xsltCompMatchPtr;    (* template based on / *)
+    keyMatch: xsltCompMatchPtr;     (* template based on key() *)
+    elemMatch: xsltCompMatchPtr;    (* template based on * *)
+    attrMatch: xsltCompMatchPtr;    (* template based on @* *)
+    parentMatch: xsltCompMatchPtr;  (* template based on .. *)
+    textMatch: xsltCompMatchPtr;    (* template based on text() *)
+    piMatch: xsltCompMatchPtr;      (* template based on
+                                       processing-instruction() *)
+    commentMatch: xsltCompMatchPtr; (* template based on comment() *)
+
+    (*
+     * Namespace aliases.
+     * NOTE: Not used in the refactored code.
+     *)
+    nsAliases: xmlHashTablePtr;     (* the namespace alias hash tables *)
+
+    (*
+     * Attribute sets.
+     *)
+    attributeSets: xmlHashTablePtr; (* the attribute sets hash tables *)
+
+    (*
+     * Namespaces.
+     * TODO: Eliminate this.
+     *)
+    nsHash: xmlHashTablePtr;        (* the set of namespaces in use:
+                                       ATTENTION: This is used for
+                                       execution of XPath expressions; unfortunately
+                                       it restricts the stylesheet to have distinct
+                                       prefixes.
+                                       TODO: We need to get rid of this.
+                                    *)
+    nsDefs: Pointer;                (* ATTENTION TODO: This is currently used to store
+                                       xsltExtDefPtr (in extensions.c) and
+                                       *not* xmlNsPtr.
+                                    *)
+
+    (*
+     * Key definitions.
+     *)
+    keys: Pointer;                  (* key definitions *)
+
+    (*
+     * Output related stuff.
+     *)
+    method: xmlCharPtr;             (* the output method *)
+    methodURI: xmlCharPtr;          (* associated namespace if any *)
+    version: xmlCharPtr;            (* version string *)
+    encoding: xmlCharPtr;           (* encoding string *)
+    omitXmlDeclaration: cint;       (* omit-xml-declaration = "yes" | "no" *)
+
+    (*
+     * Number formatting.
+     *)
+    decimalFormat: xsltDecimalFormatPtr;
+    standalone: cint;               (* standalone = "yes" | "no" *)
+    doctypePublic: xmlCharPtr;      (* doctype-public string *)
+    doctypeSystem: xmlCharPtr;      (* doctype-system string *)
+    indent: cint;                   (* should output being indented *)
+    mediaType: xmlCharPtr;          (* media-type string *)
+
+    (*
+     * Precomputed blocks.
+     *)
+    preComps: xsltElemPreCompPtr ;  (* list of precomputed blocks *)
+    warnings: cint;                 (* number of warnings found at compilation *)
+    errors: cint;                   (* number of errors found at compilation *)
+
+    exclPrefix: xmlCharPtr;         (* last excluded prefixes *)
+    exclPrefixTab: xmlCharPtrPtr;   (* array of excluded prefixes *)
+    exclPrefixNr: cint;             (* number of excluded prefixes in scope *)
+    exclPrefixMax: cint;            (* size of the array *)
+
+    _private: Pointer;              (* user defined data *)
+
+    (*
+     * Extensions.
+     *)
+    extInfos: xmlHashTablePtr;      (* the extension data *)
+    extrasNr: cint;                 (* the number of extras required *)
+
+    (*
+     * For keeping track of nested includes
+     *)
+    includes: xsltDocumentPtr;     (* points to last nested include *)
+
+    (*
+     * dictionary: shared between stylesheet, context and documents.
+     *)
+    dict: xmlDictPtr;
+    (*
+     * precompiled attribute value templates.
+     *)
+    attVTs: Pointer;
+    (*
+     * if namespace-alias has an alias for the default stylesheet prefix
+     * NOTE: Not used in the refactored code.
+     *)
+    defaultAlias: xmlCharPtr;
+    (*
+     * bypass pre-processing (already done) (used in imports)
+     *)
+    nopreproc: cint;
+    (*
+     * all document text strings were internalized
+     *)
+    internalized: cint;
+    (*
+     * Literal Result Element as Stylesheet c.f. section 2.3
+     *)
+    literal_result: cint;
+    (*
+    * The principal stylesheet
+    *)
+    principal: xsltStylesheetPtr;
+{$IFDEF XSLT_REFACTORED}
+    (*
+    * Compilation context used during compile-time.
+    *)
+    compCtxt: xsltCompilerCtxtPtr; (* TODO: Change this to (void * ). *)
+
+    principalData: xsltPrincipalStylesheetDataPtr;
+{$ENDIF}
+    {*
+     * Forwards-compatible processing
+     *}
+    forwards_compatible: cint;
+
+    namedTemplates: xmlHashTablePtr; (* hash table of named templates *)
+
+    xpathCtxt: xmlXPathContextPtr;
+  end;
+
+  xsltTransformCachePtr = ^xsltTransformCache;
+  xsltTransformCache = record
+    RVT: xmlDocPtr;
+    nbRVT: cint;
+    stackItems: xsltStackElemPtr;
+    nbStackItems: cint;
+{$IFDEF XSLT_DEBUG_PROFILE_CACHE}
+    dbgCachedRVTs: cint;
+    dbgReusedRVTs: cint;
+    dbgCachedVars: cint;
+    dbgReusedVars: cint;
+{$ENDIF}
+  end;
+
+  (*
+   * The in-memory structure corresponding to an XSLT Transformation.
+   *)
+  xsltOutputType = (
+    XSLT_OUTPUT_XML = 0,
+    XSLT_OUTPUT_HTML,
+    XSLT_OUTPUT_TEXT
+  );
+
+  xsltTransformState = (
+    XSLT_STATE_OK = 0,
+    XSLT_STATE_ERROR,
+    XSLT_STATE_STOPPED
+  );
+
+  xsltTransformContext = record
+    style: xsltStylesheetPtr;           (* the stylesheet used *)
+    &type: xsltOutputType;              (* the type of output *)
+
+    templ: xsltTemplatePtr;             (* the current template *)
+    templNr: cint;                      (* Nb of templates in the stack *)
+    templMax: cint;                     (* Size of the templtes stack *)
+    templTab: xsltTemplatePtrPtr;       (* the template stack *)
+
+    vars: xsltStackElemPtr;             (* the current variable list *)
+    varsNr: cint;                       (* Nb of variable list in the stack *)
+    varsMax: cint;                       (* Size of the variable list stack *)
+    varsTab: xsltStackElemPtrPtr;       (* the variable list stack *)
+    varsBase: cint;                     (* the var base for current templ *)
+
+    (*
+     * Extensions
+     *)
+    extFunctions: xmlHashTablePtr;      (* the extension functions *)
+    extElements: xmlHashTablePtr;       (* the extension elements *)
+    extInfos: xmlHashTablePtr;          (* the extension data *)
+
+    mode: xmlCharPtr;                   (* the current mode *)
+    modeURI: xmlCharPtr;                (* the current mode URI *)
+
+    docList: xsltDocumentPtr;           (* the document list *)
+
+    document: xsltDocumentPtr;          (* the current source document; can be NULL if an RTF *)
+    node: xmlNodePtr;                   (* the current node being processed *)
+    nodeList: xmlNodeSetPtr;            (* the current node list *)
+    (* xmlNodePtr current;			the node *)
+
+    output: xmlDocPtr;                  (* the resulting document *)
+    insert: xmlNodePtr;                 (* the insertion node *)
+
+    xpathCtxt: xmlXPathContextPtr;      (* the XPath context *)
+    state: xsltTransformState;          (* the current state *)
+
+    (*
+     * Global variables
+     *)
+    globalVars: xmlHashTablePtr;        (* the global variables and params *)
+
+    inst: xmlNodePtr;                   (* the instruction in the stylesheet *)
+
+    xinclude: cint;                     (* should XInclude be processed *)
+
+    outputFile: PAnsiChar;              (* the output URI if known *)
+
+    profile: cint;                      (* is this run profiled *)
+    prof: clong;                        (* the current profiled value *)
+    profNr: cint;                       (* Nb of templates in the stack *)
+    profMax: cint;                      (* Size of the templtaes stack *)
+    profTab: pclong;                    (* the profile template stack *)
+
+    _private: Pointer;                  (* user defined data *)
+
+    extrasNr: cint;                     (* the number of extras used *)
+    extrasMax: cint;                    (* the number of extras allocated *)
+    extras: xsltRuntimeExtraPtr;        (* extra per runtime information *)
+
+    styleList: xsltDocumentPtr;         (* the stylesheet docs list *)
+    sec: Pointer;                       (* the security preferences if any *)
+
+    error: xmlGenericErrorFunc;         (* a specific error handler *)
+    errctx: Pointer;                    (* context for the error handler *)
+
+    sortfunc: xsltSortFunc;             (* a ctxt specific sort routine *)
+
+    (*
+     * handling of temporary Result Value Tree
+     * (XSLT 1.0 term: "Result Tree Fragment")
+     *)
+    tmpRVT: xmlDocPtr;                  (* list of RVT without persistance *)
+    persistRVT: xmlDocPtr;              (* list of persistant RVTs *)
+    ctxtflags: cint;                    (* context processing flags *)
+
+    (*
+     * Speed optimization when coalescing text nodes
+     *)
+    lasttext: xmlCharPtr;               (* last text node content *)
+    lasttsize: cint;                    (* last text node size *)
+    lasttuse: cint;                     (* last text node use *)
+    (*
+     * Per Context Debugging
+     *)
+    debugStatus: cint;                  (* the context level debug status *)
+    traceCode: pculong;                  (* pointer to the variable holding the mask *)
+
+    parserOptions: cint;                (* parser options xmlParserOption *)
+
+    (*
+     * dictionary: shared between stylesheet, context and documents.
+     *)
+    dict: xmlDictPtr;
+    tmpDoc: xmlDocPtr;                  (* Obsolete; not used in the library. *)
+    (*
+     * all document text strings are internalized
+     *)
+    internalized: cint;
+    nbKeys: cint;
+    hasTemplKeyPatterns: cint;
+    currentTemplateRule: xsltTemplatePtr; (* the Current Template Rule *)
+    initialContextNode: xmlNodePtr;
+    initialContextDoc: xmlDocPtr;
+    cache: xsltTransformCachePtr;
+    contextVariable: Pointer; (* the current variable item *)
+    localRVT: xmlDocPtr; (* list of local tree fragments; will be freed when
+                            the instruction which created the fragment
+                            exits *)
+    localRVTBase: xmlDocPtr; (* Obsolete *)
+    keyInitLevel: cint;   (* Needed to catch recursive keys issues *)
+    depth: cint;          (* Needed to catch recursions *)
+    maxTemplateDepth: cint;
+    maxTemplateVars: cint;
+    opLimit: culong;
+    opCount: culong;
+  end;
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+(*
+ * Functions associated to the internal types
+xsltDecimalFormatPtr	xsltDecimalFormatGetByName(xsltStylesheetPtr sheet,
+  						 xmlChar *name);
+ *)
+function xsltNewStylesheet: xsltStylesheetPtr; EXTDECL; external xsltlib;
+function xsltParseStylesheetFile(const filename: xmlCharPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+procedure xsltFreeStylesheet(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+function xsltIsBlank(str: xmlCharPtr): cint; EXTDECL; external xsltlib;
+procedure xsltFreeStackElemList(elem: xsltStackElemPtr); EXTDECL; external xsltlib;
+function xsltDecimalFormatGetByName(style: xsltStylesheetPtr; name: xmlCharPtr): xsltDecimalFormatPtr; EXTDECL; external xsltlib;
+function xsltDecimalFormatGetByQName(style: xsltStylesheetPtr; const nsUri: xmlCharPtr; const name: xmlCharPtr): xsltDecimalFormatPtr; EXTDECL; external xsltlib;
+function xsltParseStylesheetProcess(ret: xsltStylesheetPtr; doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+procedure xsltParseStylesheetOutput(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltParseStylesheetDoc(doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+function xsltParseStylesheetImportedDoc(doc: xmlDocPtr; style: xsltStylesheetPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+function xsltParseStylesheetUser(style: xsltStylesheetPtr; doc: xmlDocPtr): cint; EXTDECL; external xsltlib;
+function xsltLoadStylesheetPI(doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL; external xsltlib;
+procedure xsltNumberFormat(ctxt: xsltTransformContextPtr; data: xsltNumberDataPtr; node: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltFormatNumberConversion(self: xsltDecimalFormatPtr; format: xmlCharPtr; number: double; result: xmlCharPtrPtr): xmlXPathError; EXTDECL; external xsltlib;
+procedure xsltParseTemplateContent(style: xsltStylesheetPtr; templ: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltAllocateExtra(style: xsltStylesheetPtr): cint; EXTDECL; external xsltlib;
+function xsltAllocateExtraCtxt(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+
+(*
+ * Extra functions for Result Value Trees
+ *)
+function xsltCreateRVT(ctxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL; external xsltlib;
+function xsltRegisterTmpRVT(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL; external xsltlib;
+function xsltRegisterLocalRVT(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL; external xsltlib;
+function xsltRegisterPersistRVT(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL; external xsltlib;
+function xsltExtensionInstructionResultRegister(ctxt: xsltTransformContextPtr; obj: xmlXPathObjectPtr): cint; EXTDECL; external xsltlib;
+function xsltExtensionInstructionResultFinalize(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+function xsltFlagRVTs(ctxt: xsltTransformContextPtr; obj: xmlXPathObjectPtr; val: Pointer): cint; EXTDECL; external xsltlib;
+procedure xsltFreeRVTs(ctxt: xsltTransformContextPtr); EXTDECL; external xsltlib;
+procedure xsltReleaseRVT(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr); EXTDECL; external xsltlib;
+
+(*
+ * Extra functions for Attribute Value Templates
+ *)
+procedure xsltCompileAttr(style: xsltStylesheetPtr; attr: xmlAttrPtr); EXTDECL; external xsltlib;
+function xsltEvalAVT(ctxt: xsltTransformContextPtr; avt: Pointer; node: xmlNodePtr): xmlCharPtr; EXTDECL; external xsltlib;
+procedure xsltFreeAVTList(avt: Pointer); EXTDECL; external xsltlib;
+
+(*
+ * Extra function for successful xsltCleanupGlobals / xsltInit sequence.
+ *)
+
+procedure xsltUninit; EXTDECL; external xsltlib;
+
+(************************************************************************
+ *									*
+ *  Compile-time functions for *internal* use only                      *
+ *									*
+ ************************************************************************)
+
+{$IFDEF XSLT_REFACTORED}
+procedure xsltParseSequenceConstructor(cctxt: xsltCompilerCtxtPtr; start: xmlNodePtr); EXTDECL; external xsltlib;
+function xsltParseAnyXSLTElem(cctxt: xsltCompilerCtxtPtr; elem: xmlNodePtr): cint; EXTDECL; external xsltlib;
+{$IFDEF XSLT_REFACTORED_XSLT_NSCOMP}
+function xsltRestoreDocumentNamespaces(ns: xsltNsMapPtr; doc: xmlDocPtr): cint; EXTDECL; external xsltlib;
+{$ENDIF}
+{$ENDIF} (* XSLT_REFACTORED *)
+
+(************************************************************************
+ *									*
+ *  Transformation-time functions for *internal* use only               *
+ *									*
+ ************************************************************************)
+function xsltInitCtxtKey(ctxt: xsltTransformContextPtr; doc: xsltDocumentPtr; keyd: xsltKeyDefPtr): cint; EXTDECL; external xsltlib;
+function xsltInitAllDocKeys(ctxt: xsltTransformContextPtr): cint; EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Functions associated to the internal types
+xsltDecimalFormatPtr	xsltDecimalFormatGetByName(xsltStylesheetPtr sheet,
+  						 xmlChar *name);
+ *)
+  xsltNewStylesheet: function: xsltStylesheetPtr; EXTDECL;
+  xsltParseStylesheetFile: function(const filename: xmlCharPtr): xsltStylesheetPtr; EXTDECL;
+  xsltFreeStylesheet: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltIsBlank: function(str: xmlCharPtr): cint; EXTDECL;
+  xsltFreeStackElemList: procedure(elem: xsltStackElemPtr); EXTDECL;
+  xsltDecimalFormatGetByName: function(style: xsltStylesheetPtr; name: xmlCharPtr): xsltDecimalFormatPtr; EXTDECL;
+  xsltDecimalFormatGetByQName: function(style: xsltStylesheetPtr; const nsUri: xmlCharPtr; const name: xmlCharPtr): xsltDecimalFormatPtr; EXTDECL;
+  xsltParseStylesheetProcess: function(ret: xsltStylesheetPtr; doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL;
+  xsltParseStylesheetOutput: procedure(style: xsltStylesheetPtr; cur: xmlNodePtr); EXTDECL;
+  xsltParseStylesheetDoc: function(doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL;
+  xsltParseStylesheetImportedDoc: function(doc: xmlDocPtr; style: xsltStylesheetPtr): xsltStylesheetPtr; EXTDECL;
+  xsltParseStylesheetUser: function(style: xsltStylesheetPtr; doc: xmlDocPtr): cint; EXTDECL;
+  xsltLoadStylesheetPI: function(doc: xmlDocPtr): xsltStylesheetPtr; EXTDECL;
+  xsltNumberFormat: procedure(ctxt: xsltTransformContextPtr; data: xsltNumberDataPtr; node: xmlNodePtr); EXTDECL;
+  xsltFormatNumberConversion: function(self: xsltDecimalFormatPtr; format: xmlCharPtr; number: double; result: xmlCharPtrPtr): xmlXPathError; EXTDECL;
+  xsltParseTemplateContent: procedure(style: xsltStylesheetPtr; templ: xmlNodePtr); EXTDECL;
+  xsltAllocateExtra: function(style: xsltStylesheetPtr): cint; EXTDECL;
+  xsltAllocateExtraCtxt: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+
+(*
+ * Extra functions for Result Value Trees
+ *)
+  xsltCreateRVT: function(ctxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL;
+  xsltRegisterTmpRVT: function(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL;
+  xsltRegisterLocalRVT: function(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL;
+  xsltRegisterPersistRVT: function(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr): cint; EXTDECL;
+  xsltExtensionInstructionResultRegister: function(ctxt: xsltTransformContextPtr; obj: xmlXPathObjectPtr): cint; EXTDECL;
+  xsltExtensionInstructionResultFinalize: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+  xsltFlagRVTs: function(ctxt: xsltTransformContextPtr; obj: xmlXPathObjectPtr; val: Pointer): cint; EXTDECL;
+  xsltFreeRVTs: procedure(ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltReleaseRVT: procedure(ctxt: xsltTransformContextPtr; RVT: xmlDocPtr); EXTDECL;
+
+(*
+ * Extra functions for Attribute Value Templates
+ *)
+  xsltCompileAttr: procedure(style: xsltStylesheetPtr; attr: xmlAttrPtr); EXTDECL;
+  xsltEvalAVT: function(ctxt: xsltTransformContextPtr; avt: Pointer; node: xmlNodePtr): xmlCharPtr; EXTDECL;
+  xsltFreeAVTList: procedure(avt: Pointer); EXTDECL;
+
+(*
+ * Extra function for successful xsltCleanupGlobals / xsltInit sequence.
+ *)
+
+  xsltUninit: procedure; EXTDECL;
+
+(************************************************************************
+ *									*
+ *  Compile-time functions for *internal* use only                      *
+ *									*
+ ************************************************************************)
+
+{$IFDEF XSLT_REFACTORED}
+  xsltParseSequenceConstructor: procedure(cctxt: xsltCompilerCtxtPtr; start: xmlNodePtr); EXTDECL;
+  xsltParseAnyXSLTElem: function(cctxt: xsltCompilerCtxtPtr; elem: xmlNodePtr): cint; EXTDECL;
+{$IFDEF XSLT_REFACTORED_XSLT_NSCOMP}
+  xsltRestoreDocumentNamespaces: function(ns: xsltNsMapPtr; doc: xmlDocPtr): cint; EXTDECL;
+{$ENDIF}
+{$ENDIF} (* XSLT_REFACTORED *)
+
+(************************************************************************
+ *									*
+ *  Transformation-time functions for *internal* use only               *
+ *									*
+ ************************************************************************)
+  xsltInitCtxtKey: function(ctxt: xsltTransformContextPtr; doc: xsltDocumentPtr; keyd: xsltKeyDefPtr): cint; EXTDECL;
+  xsltInitAllDocKeys: function(ctxt: xsltTransformContextPtr): cint; EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}

+ 45 - 0
packages/libxml/src/xslt_item_common_fields.inc

@@ -0,0 +1,45 @@
+(**
+ * XSLT_ITEM_COMPATIBILITY_FIELDS:
+ *
+ * Fields for API compatibility to the structure
+ * _xsltElemPreComp which is used for extension functions.
+ * Note that @next is used for storage; it does not reflect a next
+ * sibling in the tree.
+ * TODO: Evaluate if we really need such a compatibility.
+ *)
+
+    next: xsltElemPreCompPtr;
+    &type: xsltStyleType;
+    func: xsltTransformFunction;
+    inst: xmlNodePtr;
+
+(**
+ * XSLT_ITEM_NAVIGATION_FIELDS:
+ *
+ * Currently empty.
+ * TODO: It is intended to hold navigational fields in the future.
+ *)
+(*
+    parent: xsltStylePreCompPtr;
+    children: xsltStylePreCompPtr;
+    nextItem: xsltStylePreCompPtr;
+*)
+
+(**
+ * XSLT_ITEM_NSINSCOPE_FIELDS:
+ *
+ * The in-scope namespaces.
+ *)
+    inScopeNs: xsltNsListContainerPtr;
+
+(**
+ * XSLT_ITEM_COMMON_FIELDS:
+ *
+ * Common fields used for all items.
+ */
+#define XSLT_ITEM_COMMON_FIELDS \
+    XSLT_ITEM_COMPATIBILITY_FIELDS \
+    XSLT_ITEM_NAVIGATION_FIELDS \
+    XSLT_ITEM_NSINSCOPE_FIELDS
+*)
+

+ 40 - 0
packages/libxml/src/xsltconfig.inc

@@ -0,0 +1,40 @@
+(*
+ * Summary: compile-time version information for the XSLT engine
+ * Description: compile-time version information for the XSLT engine
+ *              this module is autogenerated.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF CONST}
+  (**
+   * LIBXSLT_DOTTED_VERSION:
+   *
+   * the version string like "1.2.3"
+   *)
+  LIBXSLT_DOTTED_VERSION = '1.1.37';
+
+  (**
+   * LIBXSLT_VERSION:
+   *
+   * the version number: 1.2.3 value is 10203
+   *)
+  LIBXSLT_VERSION = 10137;
+
+  (**
+   * LIBXSLT_VERSION_STRING:
+   *
+   * the version number string, 1.2.3 value is "10203"
+   *)
+  LIBXSLT_VERSION_STRING = '10137';
+
+  (**
+   * LIBXSLT_VERSION_EXTRA:
+   *
+   * extra version information, used to show a CVS compilation
+   *)
+  LIBXSLT_VERSION_EXTRA = '';
+
+{$ENDIF}

+ 733 - 0
packages/libxml/src/xsltdyn.pas

@@ -0,0 +1,733 @@
+{$IFNDEF FPC_DOTTEDUNITS}
+unit xsltdyn;
+{$ENDIF FPC_DOTTEDUNITS}
+
+{$mode ObjFPC}
+{$H+}
+{$macro on}
+
+{$ALIGN 8}
+{$MINENUMSIZE 4}
+
+{$DEFINE NIL_FUNCVARS_ON_FREE}
+
+interface
+
+{$IFDEF FPC_DOTTEDUNITS}
+uses
+  Api.XML.Xml2Dyn,
+  System.CTypes,
+  System.DynLibs
+  {$IFDEF WINDOWS}
+  , WinApi.Windows
+  {$ENDIF}
+  ;
+{$ELSE FPC_DOTTEDUNITS}
+uses
+  xml2dyn, ctypes, dynlibs
+  {$IFDEF WINDOWS}
+  , Windows
+  {$ENDIF}
+  ;
+{$ENDIF}
+
+{.$DEFINE XSLT_REFACTORED}
+{$DEFINE HAVE_STRXFRM_L}
+
+const
+{$IF Defined(WINDOWS)}
+  xsltlib = 'libxslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+  {$DEFINE NO_EXTERNAL_VARS}
+{$ELSEIF Defined(UNIX)}
+  xsltlib = 'libxslt.'+sharedsuffix;
+  {$DEFINE EXTDECL := cdecl}
+{$ELSE}
+  {$MESSAGE ERROR 'Platform not supported right now'}
+{$IFEND}
+
+{$IFNDEF NO_EXTERNAL_VARS}
+{$DEFINE NO_EXTERNAL_VARS}
+{$ENDIF}
+
+type
+{$DEFINE POINTER}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$UNDEF POINTER}
+
+{$DEFINE TYPE}
+{$I xsltpattern.inc}
+{$I numbersInternals.inc}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I documents.inc}
+{$I extensions.inc}
+{$I security.inc}
+{$I xsltutils.inc}
+{$UNDEF TYPE}
+
+const
+{$DEFINE CONST}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I documents.inc}
+{$I extra.inc}
+{$I keys.inc}
+{$I namespaces.inc}
+{$I variables.inc}
+{$I xslt.inc}
+{$I xsltconfig.inc}
+{$I xsltutils.inc}
+{$UNDEF CONST}
+
+
+{$DEFINE FUNCTIONVAR}
+var
+{$I xsltpattern.inc}
+{$I xsltlocale.inc}
+{$I xsltInternals.inc}
+{$I attributes.inc}
+{$I documents.inc}
+{$I extensions.inc}
+{$I extra.inc}
+{$I functions.inc}
+{$I imports.inc}
+{$I keys.inc}
+{$I namespaces.inc}
+{$I preproc.inc}
+{$I security.inc}
+{$I templates.inc}
+{$I transform.inc}
+{$I variables.inc}
+{$I xslt.inc}
+{$I xsltutils.inc}
+{$UNDEF FUNCTION}
+
+{$IFNDEF NO_EXTERNAL_VARS}
+{$DEFINE EXTVAR}
+{$I documents.inc}
+{$I preproc.inc}
+{$I xslt.inc}
+{$I xsltutils.inc}
+{$UNDEF EXTVAR}
+{$ENDIF}
+
+var
+  LibXsltHandle: TLibHandle = NilHandle;
+
+function LoadLibXslt(ALibName: String = ''): Boolean;
+procedure FreeLibXslt;
+
+implementation
+
+function LoadLibXslt(ALibName: String): Boolean;
+begin
+  if ALibName = '' then
+    ALibName := xsltlib;
+  LibXsltHandle := dynlibs.LoadLibrary(ALibName);
+  if LibXsltHandle <> NilHandle then
+  begin
+    { xsltpattern.inc }
+    Pointer(xsltCompilePattern) := GetProcAddress(LibXsltHandle, 'xsltCompilePattern');
+    Pointer(xsltFreeCompMatchList) := GetProcAddress(LibXsltHandle, 'xsltFreeCompMatchList');
+    Pointer(xsltTestCompMatchList) := GetProcAddress(LibXsltHandle, 'xsltTestCompMatchList');
+    Pointer(xsltCompMatchClearCache) := GetProcAddress(LibXsltHandle, 'xsltCompMatchClearCache');
+    Pointer(xsltNormalizeCompSteps) := GetProcAddress(LibXsltHandle, 'xsltNormalizeCompSteps');
+    Pointer(xsltAddTemplate) := GetProcAddress(LibXsltHandle, 'xsltAddTemplate');
+    Pointer(xsltGetTemplate) := GetProcAddress(LibXsltHandle, 'xsltGetTemplate');
+    Pointer(xsltFreeTemplateHashes) := GetProcAddress(LibXsltHandle, 'xsltFreeTemplateHashes');
+    Pointer(xsltCleanupTemplates) := GetProcAddress(LibXsltHandle, 'xsltCleanupTemplates');
+
+    { xsltlocale.inc }
+  {$IFDEF HAVE_STRXFRM_L}
+    Pointer(xsltNewLocale) := GetProcAddress(LibXsltHandle, 'xsltNewLocale');
+    Pointer(xsltFreeLocale) := GetProcAddress(LibXsltHandle, 'xsltFreeLocale');
+    Pointer(xsltStrxfrm) := GetProcAddress(LibXsltHandle, 'xsltStrxfrm');
+    Pointer(xsltLocaleStrcmp) := GetProcAddress(LibXsltHandle, 'xsltLocaleStrcmp');
+    Pointer(xsltFreeLocales) := GetProcAddress(LibXsltHandle, 'xsltFreeLocales');
+  {$ENDIF} {HAVE_STRXFRM_L}
+
+    { xsltInternals.inc }
+  {$IFDEF XSLT_REFACTORED}
+    Pointer(xsltPointerListCreate) := GetProcAddress(LibXsltHandle, 'xsltPointerListCreate');
+    Pointer(xsltPointerListFree) := GetProcAddress(LibXsltHandle, 'xsltPointerListFree');
+    Pointer(xsltPointerListClear) := GetProcAddress(LibXsltHandle, 'xsltPointerListClear');
+    Pointer(xsltPointerListAddSize) := GetProcAddress(LibXsltHandle, 'xsltPointerListAddSize');
+  {$ELSE} (* XSLT_REFACTORED *)
+    Pointer(xsltNewStylesheet) := GetProcAddress(LibXsltHandle, 'xsltNewStylesheet');
+    Pointer(xsltParseStylesheetFile) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetFile');
+    Pointer(xsltFreeStylesheet) := GetProcAddress(LibXsltHandle, 'xsltFreeStylesheet');
+    Pointer(xsltIsBlank) := GetProcAddress(LibXsltHandle, 'xsltIsBlank');
+    Pointer(xsltFreeStackElemList) := GetProcAddress(LibXsltHandle, 'xsltFreeStackElemList');
+    Pointer(xsltDecimalFormatGetByName) := GetProcAddress(LibXsltHandle, 'xsltDecimalFormatGetByName');
+    Pointer(xsltDecimalFormatGetByQName) := GetProcAddress(LibXsltHandle, 'xsltDecimalFormatGetByQName');
+    Pointer(xsltParseStylesheetProcess) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetProcess');
+    Pointer(xsltParseStylesheetOutput) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetOutput');
+    Pointer(xsltParseStylesheetDoc) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetDoc');
+    Pointer(xsltParseStylesheetImportedDoc) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetImportedDoc');
+    Pointer(xsltParseStylesheetUser) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetUser');
+    Pointer(xsltLoadStylesheetPI) := GetProcAddress(LibXsltHandle, 'xsltLoadStylesheetPI');
+    Pointer(xsltNumberFormat) := GetProcAddress(LibXsltHandle, 'xsltNumberFormat');
+    Pointer(xsltFormatNumberConversion) := GetProcAddress(LibXsltHandle, 'xsltFormatNumberConversion');
+    Pointer(xsltParseTemplateContent) := GetProcAddress(LibXsltHandle, 'xsltParseTemplateContent');
+    Pointer(xsltAllocateExtra) := GetProcAddress(LibXsltHandle, 'xsltAllocateExtra');
+    Pointer(xsltAllocateExtraCtxt) := GetProcAddress(LibXsltHandle, 'xsltAllocateExtraCtxt');
+    Pointer(xsltCreateRVT) := GetProcAddress(LibXsltHandle, 'xsltCreateRVT');
+    Pointer(xsltRegisterTmpRVT) := GetProcAddress(LibXsltHandle, 'xsltRegisterTmpRVT');
+    Pointer(xsltRegisterLocalRVT) := GetProcAddress(LibXsltHandle, 'xsltRegisterLocalRVT');
+    Pointer(xsltRegisterPersistRVT) := GetProcAddress(LibXsltHandle, 'xsltRegisterPersistRVT');
+    Pointer(xsltExtensionInstructionResultRegister) := GetProcAddress(LibXsltHandle, 'xsltExtensionInstructionResultRegister');
+    Pointer(xsltExtensionInstructionResultFinalize) := GetProcAddress(LibXsltHandle, 'xsltExtensionInstructionResultFinalize');
+    Pointer(xsltFlagRVTs) := GetProcAddress(LibXsltHandle, 'xsltFlagRVTs');
+    Pointer(xsltFreeRVTs) := GetProcAddress(LibXsltHandle, 'xsltFreeRVTs');
+    Pointer(xsltReleaseRVT) := GetProcAddress(LibXsltHandle, 'xsltReleaseRVT');
+    Pointer(xsltCompileAttr) := GetProcAddress(LibXsltHandle, 'xsltCompileAttr');
+    Pointer(xsltEvalAVT) := GetProcAddress(LibXsltHandle, 'xsltEvalAVT');
+    Pointer(xsltFreeAVTList) := GetProcAddress(LibXsltHandle, 'xsltFreeAVTList');
+    Pointer(xsltUninit) := GetProcAddress(LibXsltHandle, 'xsltUninit');
+  {$ENDIF}
+  {$IFDEF XSLT_REFACTORED}
+    Pointer(xsltParseSequenceConstructor) := GetProcAddress(LibXsltHandle, 'xsltParseSequenceConstructor');
+    Pointer(xsltParseAnyXSLTElem) := GetProcAddress(LibXsltHandle, 'xsltParseAnyXSLTElem');
+  {$IFDEF XSLT_REFACTORED_XSLT_NSCOMP}
+    Pointer(xsltRestoreDocumentNamespaces) := GetProcAddress(LibXsltHandle, 'xsltRestoreDocumentNamespaces');
+  {$ENDIF}
+  {$ENDIF} (* XSLT_REFACTORED *)
+    Pointer(xsltInitCtxtKey) := GetProcAddress(LibXsltHandle, 'xsltInitCtxtKey');
+    Pointer(xsltInitAllDocKeys) := GetProcAddress(LibXsltHandle, 'xsltInitAllDocKeys');
+
+    { attributes.inc }
+    Pointer(xsltParseStylesheetAttributeSet) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetAttributeSet');
+    Pointer(xsltFreeAttributeSetsHashes) := GetProcAddress(LibXsltHandle, 'xsltFreeAttributeSetsHashes');
+    Pointer(xsltApplyAttributeSet) := GetProcAddress(LibXsltHandle, 'xsltApplyAttributeSet');
+    Pointer(xsltResolveStylesheetAttributeSet) := GetProcAddress(LibXsltHandle, 'xsltResolveStylesheetAttributeSet');
+
+    { documents.inc }
+    Pointer(xsltNewDocument) := GetProcAddress(LibXsltHandle, 'xsltNewDocument');
+    Pointer(xsltLoadDocument) := GetProcAddress(LibXsltHandle, 'xsltLoadDocument');
+    Pointer(xsltFindDocument) := GetProcAddress(LibXsltHandle, 'xsltFindDocument');
+    Pointer(xsltFreeDocuments) := GetProcAddress(LibXsltHandle, 'xsltFreeDocuments');
+    Pointer(xsltLoadStyleDocument) := GetProcAddress(LibXsltHandle, 'xsltLoadStyleDocument');
+    Pointer(xsltNewStyleDocument) := GetProcAddress(LibXsltHandle, 'xsltNewStyleDocument');
+    Pointer(xsltFreeStyleDocuments) := GetProcAddress(LibXsltHandle, 'xsltFreeStyleDocuments');
+    Pointer(xsltSetLoaderFunc) := GetProcAddress(LibXsltHandle, 'xsltSetLoaderFunc');
+
+    { extensions.inc }
+    Pointer(xsltInitGlobals) := GetProcAddress(LibXsltHandle, 'xsltInitGlobals');
+    Pointer(xsltRegisterExtModule) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtModule');
+    Pointer(xsltRegisterExtModuleFull) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtModuleFull');
+    Pointer(xsltUnregisterExtModule) := GetProcAddress(LibXsltHandle, 'xsltUnregisterExtModule');
+    Pointer(xsltGetExtData) := GetProcAddress(LibXsltHandle, 'xsltGetExtData');
+    Pointer(xsltStyleGetExtData) := GetProcAddress(LibXsltHandle, 'xsltStyleGetExtData');
+  {$IFDEF XSLT_REFACTORED}
+    Pointer(xsltStyleStylesheetLevelGetExtData) := GetProcAddress(LibXsltHandle, 'xsltStyleStylesheetLevelGetExtData');
+  {$ENDIF}
+    Pointer(xsltShutdownCtxtExts) := GetProcAddress(LibXsltHandle, 'xsltShutdownCtxtExts');
+    Pointer(xsltShutdownExts) := GetProcAddress(LibXsltHandle, 'xsltShutdownExts');
+    Pointer(xsltXPathGetTransformContext) := GetProcAddress(LibXsltHandle, 'xsltXPathGetTransformContext');
+    Pointer(xsltRegisterExtModuleFunction) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtModuleFunction');
+    Pointer(xsltExtModuleFunctionLookup) := GetProcAddress(LibXsltHandle, 'xsltExtModuleFunctionLookup');
+    Pointer(xsltUnregisterExtModuleFunction) := GetProcAddress(LibXsltHandle, 'xsltUnregisterExtModuleFunction');
+    Pointer(xsltNewElemPreComp) := GetProcAddress(LibXsltHandle, 'xsltNewElemPreComp');
+    Pointer(xsltInitElemPreComp) := GetProcAddress(LibXsltHandle, 'xsltInitElemPreComp');
+    Pointer(xsltRegisterExtModuleElement) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtModuleElement');
+    Pointer(xsltExtElementLookup) := GetProcAddress(LibXsltHandle, 'xsltExtElementLookup');
+    Pointer(xsltExtModuleElementLookup) := GetProcAddress(LibXsltHandle, 'xsltExtModuleElementLookup');
+    Pointer(xsltExtModuleElementPreComputeLookup) := GetProcAddress(LibXsltHandle, 'xsltExtModuleElementPreComputeLookup');
+    Pointer(xsltUnregisterExtModuleElement) := GetProcAddress(LibXsltHandle, 'xsltUnregisterExtModuleElement');
+    Pointer(xsltRegisterExtModuleTopLevel) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtModuleTopLevel');
+    Pointer(xsltExtModuleTopLevelLookup) := GetProcAddress(LibXsltHandle, 'xsltExtModuleTopLevelLookup');
+    Pointer(xsltUnregisterExtModuleTopLevel) := GetProcAddress(LibXsltHandle, 'xsltUnregisterExtModuleTopLevel');
+    Pointer(xsltRegisterExtFunction) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtFunction');
+    Pointer(xsltRegisterExtElement) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtElement');
+    Pointer(xsltRegisterExtPrefix) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtPrefix');
+    Pointer(xsltCheckExtPrefix) := GetProcAddress(LibXsltHandle, 'xsltCheckExtPrefix');
+    Pointer(xsltCheckExtURI) := GetProcAddress(LibXsltHandle, 'xsltCheckExtURI');
+    Pointer(xsltInitCtxtExts) := GetProcAddress(LibXsltHandle, 'xsltInitCtxtExts');
+    Pointer(xsltFreeCtxtExts) := GetProcAddress(LibXsltHandle, 'xsltFreeCtxtExts');
+    Pointer(xsltFreeExts) := GetProcAddress(LibXsltHandle, 'xsltFreeExts');
+    Pointer(xsltPreComputeExtModuleElement) := GetProcAddress(LibXsltHandle, 'xsltPreComputeExtModuleElement');
+    Pointer(xsltGetExtInfo) := GetProcAddress(LibXsltHandle, 'xsltGetExtInfo');
+    Pointer(xsltRegisterTestModule) := GetProcAddress(LibXsltHandle, 'xsltRegisterTestModule');
+    Pointer(xsltDebugDumpExtensions) := GetProcAddress(LibXsltHandle, 'xsltDebugDumpExtensions');
+
+    { extra.inc }
+    Pointer(xsltFunctionNodeSet) := GetProcAddress(LibXsltHandle, 'xsltFunctionNodeSet');
+    Pointer(xsltDebug) := GetProcAddress(LibXsltHandle, 'xsltDebug');
+    Pointer(xsltRegisterExtras) := GetProcAddress(LibXsltHandle, 'xsltRegisterExtras');
+    Pointer(xsltRegisterAllExtras) := GetProcAddress(LibXsltHandle, 'xsltRegisterAllExtras');
+
+    { functions.inc }
+    Pointer(xsltXPathFunctionLookup) := GetProcAddress(LibXsltHandle, 'xsltXPathFunctionLookup');
+    Pointer(xsltDocumentFunction) := GetProcAddress(LibXsltHandle, 'xsltDocumentFunction');
+    Pointer(xsltKeyFunction) := GetProcAddress(LibXsltHandle, 'xsltKeyFunction');
+    Pointer(xsltUnparsedEntityURIFunction) := GetProcAddress(LibXsltHandle, 'xsltUnparsedEntityURIFunction');
+    Pointer(xsltFormatNumberFunction) := GetProcAddress(LibXsltHandle, 'xsltFormatNumberFunction');
+    Pointer(xsltGenerateIdFunction) := GetProcAddress(LibXsltHandle, 'xsltGenerateIdFunction');
+    Pointer(xsltSystemPropertyFunction) := GetProcAddress(LibXsltHandle, 'xsltSystemPropertyFunction');
+    Pointer(xsltElementAvailableFunction) := GetProcAddress(LibXsltHandle, 'xsltElementAvailableFunction');
+    Pointer(xsltFunctionAvailableFunction) := GetProcAddress(LibXsltHandle, 'xsltFunctionAvailableFunction');
+    Pointer(xsltRegisterAllFunctions) := GetProcAddress(LibXsltHandle, 'xsltRegisterAllFunctions');
+
+    { imports.inc }
+    Pointer(xsltParseStylesheetImport) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetImport');
+    Pointer(xsltParseStylesheetInclude) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetInclude');
+    Pointer(xsltNextImport) := GetProcAddress(LibXsltHandle, 'xsltNextImport');
+    Pointer(xsltNeedElemSpaceHandling) := GetProcAddress(LibXsltHandle, 'xsltNeedElemSpaceHandling');
+    Pointer(xsltFindElemSpaceHandling) := GetProcAddress(LibXsltHandle, 'xsltFindElemSpaceHandling');
+    Pointer(xsltFindTemplate) := GetProcAddress(LibXsltHandle, 'xsltFindTemplate');
+
+    { keys.inc }
+    Pointer(xsltAddKey) := GetProcAddress(LibXsltHandle, 'xsltAddKey');
+    Pointer(xsltGetKey) := GetProcAddress(LibXsltHandle, 'xsltGetKey');
+    Pointer(xsltInitCtxtKeys) := GetProcAddress(LibXsltHandle, 'xsltInitCtxtKeys');
+    Pointer(xsltFreeKeys) := GetProcAddress(LibXsltHandle, 'xsltFreeKeys');
+    Pointer(xsltFreeDocumentKeys) := GetProcAddress(LibXsltHandle, 'xsltFreeDocumentKeys');
+
+    { namespaces.inc }
+    Pointer(xsltNamespaceAlias) := GetProcAddress(LibXsltHandle, 'xsltNamespaceAlias');
+    Pointer(xsltGetNamespace) := GetProcAddress(LibXsltHandle, 'xsltGetNamespace');
+    Pointer(xsltGetPlainNamespace) := GetProcAddress(LibXsltHandle, 'xsltGetPlainNamespace');
+    Pointer(xsltGetSpecialNamespace) := GetProcAddress(LibXsltHandle, 'xsltGetSpecialNamespace');
+    Pointer(xsltCopyNamespace) := GetProcAddress(LibXsltHandle, 'xsltCopyNamespace');
+    Pointer(xsltCopyNamespaceList) := GetProcAddress(LibXsltHandle, 'xsltCopyNamespaceList');
+    Pointer(xsltFreeNamespaceAliasHashes) := GetProcAddress(LibXsltHandle, 'xsltFreeNamespaceAliasHashes');
+
+    { preproc.inc }
+    Pointer(xsltDocumentComp) := GetProcAddress(LibXsltHandle, 'xsltDocumentComp');
+    Pointer(xsltStylePreCompute) := GetProcAddress(LibXsltHandle, 'xsltStylePreCompute');
+    Pointer(xsltFreeStylePreComps) := GetProcAddress(LibXsltHandle, 'xsltFreeStylePreComps');
+
+    { security.inc }
+    Pointer(xsltNewSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltNewSecurityPrefs');
+    Pointer(xsltFreeSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltFreeSecurityPrefs');
+    Pointer(xsltSetSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltSetSecurityPrefs');
+    Pointer(xsltGetSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltGetSecurityPrefs');
+    Pointer(xsltSetDefaultSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltSetDefaultSecurityPrefs');
+    Pointer(xsltGetDefaultSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltGetDefaultSecurityPrefs');
+    Pointer(xsltSetCtxtSecurityPrefs) := GetProcAddress(LibXsltHandle, 'xsltSetCtxtSecurityPrefs');
+    Pointer(xsltSecurityAllow) := GetProcAddress(LibXsltHandle, 'xsltSecurityAllow');
+    Pointer(xsltSecurityForbid) := GetProcAddress(LibXsltHandle, 'xsltSecurityForbid');
+    Pointer(xsltCheckWrite) := GetProcAddress(LibXsltHandle, 'xsltCheckWrite');
+    Pointer(xsltCheckRead) := GetProcAddress(LibXsltHandle, 'xsltCheckRead');
+
+    { templates.inc }
+    Pointer(xsltEvalXPathPredicate) := GetProcAddress(LibXsltHandle, 'xsltEvalXPathPredicate');
+    Pointer(xsltEvalTemplateString) := GetProcAddress(LibXsltHandle, 'xsltEvalTemplateString');
+    Pointer(xsltEvalAttrValueTemplate) := GetProcAddress(LibXsltHandle, 'xsltEvalAttrValueTemplate');
+    Pointer(xsltEvalStaticAttrValueTemplate) := GetProcAddress(LibXsltHandle, 'xsltEvalStaticAttrValueTemplate');
+    Pointer(xsltEvalXPathString) := GetProcAddress(LibXsltHandle, 'xsltEvalXPathString');
+    Pointer(xsltEvalXPathStringNs) := GetProcAddress(LibXsltHandle, 'xsltEvalXPathStringNs');
+    Pointer(xsltTemplateProcess) := GetProcAddress(LibXsltHandle, 'xsltTemplateProcess');
+    Pointer(xsltAttrListTemplateProcess) := GetProcAddress(LibXsltHandle, 'xsltAttrListTemplateProcess');
+    Pointer(xsltAttrTemplateProcess) := GetProcAddress(LibXsltHandle, 'xsltAttrTemplateProcess');
+    Pointer(xsltAttrTemplateValueProcess) := GetProcAddress(LibXsltHandle, 'xsltAttrTemplateValueProcess');
+    Pointer(xsltAttrTemplateValueProcessNode) := GetProcAddress(LibXsltHandle, 'xsltAttrTemplateValueProcessNode');
+
+    { transform.inc }
+    Pointer(xsltSetXIncludeDefault) := GetProcAddress(LibXsltHandle, 'xsltSetXIncludeDefault');
+    Pointer(xsltGetXIncludeDefault) := GetProcAddress(LibXsltHandle, 'xsltGetXIncludeDefault');
+    Pointer(xsltNewTransformContext) := GetProcAddress(LibXsltHandle, 'xsltNewTransformContext');
+    Pointer(xsltFreeTransformContext) := GetProcAddress(LibXsltHandle, 'xsltFreeTransformContext');
+    Pointer(xsltApplyStylesheetUser) := GetProcAddress(LibXsltHandle, 'xsltApplyStylesheetUser');
+    Pointer(xsltProcessOneNode) := GetProcAddress(LibXsltHandle, 'xsltProcessOneNode');
+    Pointer(xsltApplyStripSpaces) := GetProcAddress(LibXsltHandle, 'xsltApplyStripSpaces');
+    Pointer(xsltApplyStylesheet) := GetProcAddress(LibXsltHandle, 'xsltApplyStylesheet');
+    Pointer(xsltProfileStylesheet) := GetProcAddress(LibXsltHandle, 'xsltProfileStylesheet');
+    Pointer(xsltRunStylesheet) := GetProcAddress(LibXsltHandle, 'xsltRunStylesheet');
+    Pointer(xsltRunStylesheetUser) := GetProcAddress(LibXsltHandle, 'xsltRunStylesheetUser');
+    Pointer(xsltApplyOneTemplate) := GetProcAddress(LibXsltHandle, 'xsltApplyOneTemplate');
+    Pointer(xsltDocumentElem) := GetProcAddress(LibXsltHandle, 'xsltDocumentElem');
+    Pointer(xsltSort) := GetProcAddress(LibXsltHandle, 'xsltSort');
+    Pointer(xsltCopy) := GetProcAddress(LibXsltHandle, 'xsltCopy');
+    Pointer(xsltText) := GetProcAddress(LibXsltHandle, 'xsltText');
+    Pointer(xsltElement) := GetProcAddress(LibXsltHandle, 'xsltElement');
+    Pointer(xsltComment) := GetProcAddress(LibXsltHandle, 'xsltComment');
+    Pointer(xsltAttribute) := GetProcAddress(LibXsltHandle, 'xsltAttribute');
+    Pointer(xsltProcessingInstruction) := GetProcAddress(LibXsltHandle, 'xsltProcessingInstruction');
+    Pointer(xsltCopyOf) := GetProcAddress(LibXsltHandle, 'xsltCopyOf');
+    Pointer(xsltValueOf) := GetProcAddress(LibXsltHandle, 'xsltValueOf');
+    Pointer(xsltNumber) := GetProcAddress(LibXsltHandle, 'xsltNumber');
+    Pointer(xsltApplyImports) := GetProcAddress(LibXsltHandle, 'xsltApplyImports');
+    Pointer(xsltCallTemplate) := GetProcAddress(LibXsltHandle, 'xsltCallTemplate');
+    Pointer(xsltApplyTemplates) := GetProcAddress(LibXsltHandle, 'xsltApplyTemplates');
+    Pointer(xsltChoose) := GetProcAddress(LibXsltHandle, 'xsltChoose');
+    Pointer(xsltIf) := GetProcAddress(LibXsltHandle, 'xsltIf');
+    Pointer(xsltForEach) := GetProcAddress(LibXsltHandle, 'xsltForEach');
+    Pointer(xsltRegisterAllElement) := GetProcAddress(LibXsltHandle, 'xsltRegisterAllElement');
+    Pointer(xsltCopyTextString) := GetProcAddress(LibXsltHandle, 'xsltCopyTextString');
+    Pointer(xsltLocalVariablePop) := GetProcAddress(LibXsltHandle, 'xsltLocalVariablePop');
+    Pointer(xsltLocalVariablePush) := GetProcAddress(LibXsltHandle, 'xsltLocalVariablePush');
+    Pointer(xslHandleDebugger) := GetProcAddress(LibXsltHandle, 'xslHandleDebugger');
+
+    { variables.inc }
+    Pointer(xsltEvalGlobalVariables) := GetProcAddress(LibXsltHandle, 'xsltEvalGlobalVariables');
+    Pointer(xsltEvalUserParams) := GetProcAddress(LibXsltHandle, 'xsltEvalUserParams');
+    Pointer(xsltQuoteUserParams) := GetProcAddress(LibXsltHandle, 'xsltQuoteUserParams');
+    Pointer(xsltEvalOneUserParam) := GetProcAddress(LibXsltHandle, 'xsltEvalOneUserParam');
+    Pointer(xsltQuoteOneUserParam) := GetProcAddress(LibXsltHandle, 'xsltQuoteOneUserParam');
+    Pointer(xsltParseGlobalVariable) := GetProcAddress(LibXsltHandle, 'xsltParseGlobalVariable');
+    Pointer(xsltParseGlobalParam) := GetProcAddress(LibXsltHandle, 'xsltParseGlobalParam');
+    Pointer(xsltParseStylesheetVariable) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetVariable');
+    Pointer(xsltParseStylesheetParam) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetParam');
+    Pointer(xsltParseStylesheetCallerParam) := GetProcAddress(LibXsltHandle, 'xsltParseStylesheetCallerParam');
+    Pointer(xsltAddStackElemList) := GetProcAddress(LibXsltHandle, 'xsltAddStackElemList');
+    Pointer(xsltFreeGlobalVariables) := GetProcAddress(LibXsltHandle, 'xsltFreeGlobalVariables');
+    Pointer(xsltVariableLookup) := GetProcAddress(LibXsltHandle, 'xsltVariableLookup');
+    Pointer(xsltXPathVariableLookup) := GetProcAddress(LibXsltHandle, 'xsltXPathVariableLookup');
+
+    { xslt.inc }
+    Pointer(xsltInit) := GetProcAddress(LibXsltHandle, 'xsltInit');
+    Pointer(xsltCleanupGlobals) := GetProcAddress(LibXsltHandle, 'xsltCleanupGlobals');
+
+    { xsltutils.inc }
+    Pointer(xsltGetNsProp) := GetProcAddress(LibXsltHandle, 'xsltGetNsProp');
+    Pointer(xsltGetCNsProp) := GetProcAddress(LibXsltHandle, 'xsltGetCNsProp');
+    Pointer(xsltGetUTF8Char) := GetProcAddress(LibXsltHandle, 'xsltGetUTF8Char');
+    Pointer(xsltDebugSetDefaultTrace) := GetProcAddress(LibXsltHandle, 'xsltDebugSetDefaultTrace');
+    Pointer(xsltDebugGetDefaultTrace) := GetProcAddress(LibXsltHandle, 'xsltDebugGetDefaultTrace');
+    Pointer(xsltPrintErrorContext) := GetProcAddress(LibXsltHandle, 'xsltPrintErrorContext');
+    Pointer(xsltMessage) := GetProcAddress(LibXsltHandle, 'xsltMessage');
+    Pointer(xsltSetGenericErrorFunc) := GetProcAddress(LibXsltHandle, 'xsltSetGenericErrorFunc');
+    Pointer(xsltSetGenericDebugFunc) := GetProcAddress(LibXsltHandle, 'xsltSetGenericDebugFunc');
+    Pointer(xsltSetTransformErrorFunc) := GetProcAddress(LibXsltHandle, 'xsltSetTransformErrorFunc');
+    Pointer(xsltTransformError) := GetProcAddress(LibXsltHandle, 'xsltTransformError');
+    Pointer(xsltSetCtxtParseOptions) := GetProcAddress(LibXsltHandle, 'xsltSetCtxtParseOptions');
+    Pointer(xsltDocumentSortFunction) := GetProcAddress(LibXsltHandle, 'xsltDocumentSortFunction');
+    Pointer(xsltSetSortFunc) := GetProcAddress(LibXsltHandle, 'xsltSetSortFunc');
+    Pointer(xsltSetCtxtSortFunc) := GetProcAddress(LibXsltHandle, 'xsltSetCtxtSortFunc');
+    Pointer(xsltDefaultSortFunction) := GetProcAddress(LibXsltHandle, 'xsltDefaultSortFunction');
+    Pointer(xsltDoSortFunction) := GetProcAddress(LibXsltHandle, 'xsltDoSortFunction');
+    Pointer(xsltComputeSortResult) := GetProcAddress(LibXsltHandle, 'xsltComputeSortResult');
+    Pointer(xsltSplitQName) := GetProcAddress(LibXsltHandle, 'xsltSplitQName');
+    Pointer(xsltGetQNameURI) := GetProcAddress(LibXsltHandle, 'xsltGetQNameURI');
+    Pointer(xsltGetQNameURI2) := GetProcAddress(LibXsltHandle, 'xsltGetQNameURI2');
+    Pointer(xsltSaveResultTo) := GetProcAddress(LibXsltHandle, 'xsltSaveResultTo');
+    Pointer(xsltSaveResultToFilename) := GetProcAddress(LibXsltHandle, 'xsltSaveResultToFilename');
+    Pointer(xsltSaveResultToFile) := GetProcAddress(LibXsltHandle, 'xsltSaveResultToFile');
+    Pointer(xsltSaveResultToFd) := GetProcAddress(LibXsltHandle, 'xsltSaveResultToFd');
+    Pointer(xsltSaveResultToString) := GetProcAddress(LibXsltHandle, 'xsltSaveResultToString');
+    Pointer(xsltXPathCompile) := GetProcAddress(LibXsltHandle, 'xsltXPathCompile');
+    Pointer(xsltXPathCompileFlags) := GetProcAddress(LibXsltHandle, 'xsltXPathCompileFlags');
+    Pointer(xsltSaveProfiling) := GetProcAddress(LibXsltHandle, 'xsltSaveProfiling');
+    Pointer(xsltGetProfileInformation) := GetProcAddress(LibXsltHandle, 'xsltGetProfileInformation');
+    Pointer(xsltTimestamp) := GetProcAddress(LibXsltHandle, 'xsltTimestamp');
+    Pointer(xsltCalibrateAdjust) := GetProcAddress(LibXsltHandle, 'xsltCalibrateAdjust');
+    Pointer(xsltSetDebuggerStatus) := GetProcAddress(LibXsltHandle, 'xsltSetDebuggerStatus');
+    Pointer(xsltGetDebuggerStatus) := GetProcAddress(LibXsltHandle, 'xsltGetDebuggerStatus');
+    Pointer(xsltSetDebuggerCallbacks) := GetProcAddress(LibXsltHandle, 'xsltSetDebuggerCallbacks');
+    Pointer(xslAddCall) := GetProcAddress(LibXsltHandle, 'xslAddCall');
+    Pointer(xslDropCall) := GetProcAddress(LibXsltHandle, 'xslDropCall');
+
+    Result := True;
+  end
+  else
+    Result := False;
+end;
+
+procedure FreeLibXslt;
+begin
+  if LibXsltHandle = NilHandle then
+    Exit;
+
+  dynlibs.FreeLibrary(LibXsltHandle);
+  LibXsltHandle := NilHandle;
+
+{$IFDEF NIL_FUNCVARS_ON_FREE}
+  { xsltpattern.inc }
+  xsltCompilePattern := nil;
+  xsltFreeCompMatchList := nil;
+  xsltTestCompMatchList := nil;
+  xsltCompMatchClearCache := nil;
+  xsltNormalizeCompSteps := nil;
+  xsltAddTemplate := nil;
+  xsltGetTemplate := nil;
+  xsltFreeTemplateHashes := nil;
+  xsltCleanupTemplates := nil;
+
+  { xsltlocale.inc }
+{$IFDEF HAVE_STRXFRM_L}
+  xsltNewLocale := nil;
+  xsltFreeLocale := nil;
+  xsltStrxfrm := nil;
+  xsltLocaleStrcmp := nil;
+  xsltFreeLocales := nil;
+{$ENDIF} {HAVE_STRXFRM_L}
+
+  { xsltInternals.inc }
+{$IFDEF XSLT_REFACTORED}
+  xsltPointerListCreate := nil;
+  xsltPointerListFree := nil;
+  xsltPointerListClear := nil;
+  xsltPointerListAddSize := nil;
+{$ELSE} (* XSLT_REFACTORED *)
+  xsltNewStylesheet := nil;
+  xsltParseStylesheetFile := nil;
+  xsltFreeStylesheet := nil;
+  xsltIsBlank := nil;
+  xsltFreeStackElemList := nil;
+  xsltDecimalFormatGetByName := nil;
+  xsltDecimalFormatGetByQName := nil;
+  xsltParseStylesheetProcess := nil;
+  xsltParseStylesheetOutput := nil;
+  xsltParseStylesheetDoc := nil;
+  xsltParseStylesheetImportedDoc := nil;
+  xsltParseStylesheetUser := nil;
+  xsltLoadStylesheetPI := nil;
+  xsltNumberFormat := nil;
+  xsltFormatNumberConversion := nil;
+  xsltParseTemplateContent := nil;
+  xsltAllocateExtra := nil;
+  xsltAllocateExtraCtxt := nil;
+  xsltCreateRVT := nil;
+  xsltRegisterTmpRVT := nil;
+  xsltRegisterLocalRVT := nil;
+  xsltRegisterPersistRVT := nil;
+  xsltExtensionInstructionResultRegister := nil;
+  xsltExtensionInstructionResultFinalize := nil;
+  xsltFlagRVTs := nil;
+  xsltFreeRVTs := nil;
+  xsltReleaseRVT := nil;
+  xsltCompileAttr := nil;
+  xsltEvalAVT := nil;
+  xsltFreeAVTList := nil;
+  xsltUninit := nil;
+{$ENDIF}
+{$IFDEF XSLT_REFACTORED}
+  xsltParseSequenceConstructor := nil;
+  xsltParseAnyXSLTElem := nil;
+{$IFDEF XSLT_REFACTORED_XSLT_NSCOMP}
+  xsltRestoreDocumentNamespaces := nil;
+{$ENDIF}
+{$ENDIF} (* XSLT_REFACTORED *)
+  xsltInitCtxtKey := nil;
+  xsltInitAllDocKeys := nil;
+
+  { attributes.inc }
+  xsltParseStylesheetAttributeSet := nil;
+  xsltFreeAttributeSetsHashes := nil;
+  xsltApplyAttributeSet := nil;
+  xsltResolveStylesheetAttributeSet := nil;
+
+  { documents.inc }
+  xsltNewDocument := nil;
+  xsltLoadDocument := nil;
+  xsltFindDocument := nil;
+  xsltFreeDocuments := nil;
+  xsltLoadStyleDocument := nil;
+  xsltNewStyleDocument := nil;
+  xsltFreeStyleDocuments := nil;
+  xsltSetLoaderFunc := nil;
+
+  { extensions.inc }
+  xsltInitGlobals := nil;
+  xsltRegisterExtModule := nil;
+  xsltRegisterExtModuleFull := nil;
+  xsltUnregisterExtModule := nil;
+  xsltGetExtData := nil;
+  xsltStyleGetExtData := nil;
+{$IFDEF XSLT_REFACTORED}
+  xsltStyleStylesheetLevelGetExtData := nil;
+{$ENDIF}
+  xsltShutdownCtxtExts := nil;
+  xsltShutdownExts := nil;
+  xsltXPathGetTransformContext := nil;
+  xsltRegisterExtModuleFunction := nil;
+  xsltExtModuleFunctionLookup := nil;
+  xsltUnregisterExtModuleFunction := nil;
+  xsltNewElemPreComp := nil;
+  xsltInitElemPreComp := nil;
+  xsltRegisterExtModuleElement := nil;
+  xsltExtElementLookup := nil;
+  xsltExtModuleElementLookup := nil;
+  xsltExtModuleElementPreComputeLookup := nil;
+  xsltUnregisterExtModuleElement := nil;
+  xsltRegisterExtModuleTopLevel := nil;
+  xsltExtModuleTopLevelLookup := nil;
+  xsltUnregisterExtModuleTopLevel := nil;
+  xsltRegisterExtFunction := nil;
+  xsltRegisterExtElement := nil;
+  xsltRegisterExtPrefix := nil;
+  xsltCheckExtPrefix := nil;
+  xsltCheckExtURI := nil;
+  xsltInitCtxtExts := nil;
+  xsltFreeCtxtExts := nil;
+  xsltFreeExts := nil;
+  xsltPreComputeExtModuleElement := nil;
+  xsltGetExtInfo := nil;
+  xsltRegisterTestModule := nil;
+  xsltDebugDumpExtensions := nil;
+
+  { extra.inc }
+  xsltFunctionNodeSet := nil;
+  xsltDebug := nil;
+  xsltRegisterExtras := nil;
+  xsltRegisterAllExtras := nil;
+
+  { functions.inc }
+  xsltXPathFunctionLookup := nil;
+  xsltDocumentFunction := nil;
+  xsltKeyFunction := nil;
+  xsltUnparsedEntityURIFunction := nil;
+  xsltFormatNumberFunction := nil;
+  xsltGenerateIdFunction := nil;
+  xsltSystemPropertyFunction := nil;
+  xsltElementAvailableFunction := nil;
+  xsltFunctionAvailableFunction := nil;
+  xsltRegisterAllFunctions := nil;
+
+  { imports.inc }
+  xsltParseStylesheetImport := nil;
+  xsltParseStylesheetInclude := nil;
+  xsltNextImport := nil;
+  xsltNeedElemSpaceHandling := nil;
+  xsltFindElemSpaceHandling := nil;
+  xsltFindTemplate := nil;
+
+  { keys.inc }
+  xsltAddKey := nil;
+  xsltGetKey := nil;
+  xsltInitCtxtKeys := nil;
+  xsltFreeKeys := nil;
+  xsltFreeDocumentKeys := nil;
+
+  { namespaces.inc }
+  xsltNamespaceAlias := nil;
+  xsltGetNamespace := nil;
+  xsltGetPlainNamespace := nil;
+  xsltGetSpecialNamespace := nil;
+  xsltCopyNamespace := nil;
+  xsltCopyNamespaceList := nil;
+  xsltFreeNamespaceAliasHashes := nil;
+
+  { preproc.inc }
+  xsltDocumentComp := nil;
+  xsltStylePreCompute := nil;
+  xsltFreeStylePreComps := nil;
+
+  { security.inc }
+  xsltNewSecurityPrefs := nil;
+  xsltFreeSecurityPrefs := nil;
+  xsltSetSecurityPrefs := nil;
+  xsltGetSecurityPrefs := nil;
+  xsltSetDefaultSecurityPrefs := nil;
+  xsltGetDefaultSecurityPrefs := nil;
+  xsltSetCtxtSecurityPrefs := nil;
+  xsltSecurityAllow := nil;
+  xsltSecurityForbid := nil;
+  xsltCheckWrite := nil;
+  xsltCheckRead := nil;
+
+  { templates.inc }
+  xsltEvalXPathPredicate := nil;
+  xsltEvalTemplateString := nil;
+  xsltEvalAttrValueTemplate := nil;
+  xsltEvalStaticAttrValueTemplate := nil;
+  xsltEvalXPathString := nil;
+  xsltEvalXPathStringNs := nil;
+  xsltTemplateProcess := nil;
+  xsltAttrListTemplateProcess := nil;
+  xsltAttrTemplateProcess := nil;
+  xsltAttrTemplateValueProcess := nil;
+  xsltAttrTemplateValueProcessNode := nil;
+
+  { transform.inc }
+  xsltSetXIncludeDefault := nil;
+  xsltGetXIncludeDefault := nil;
+  xsltNewTransformContext := nil;
+  xsltFreeTransformContext := nil;
+  xsltApplyStylesheetUser := nil;
+  xsltProcessOneNode := nil;
+  xsltApplyStripSpaces := nil;
+  xsltApplyStylesheet := nil;
+  xsltProfileStylesheet := nil;
+  xsltRunStylesheet := nil;
+  xsltRunStylesheetUser := nil;
+  xsltApplyOneTemplate := nil;
+  xsltDocumentElem := nil;
+  xsltSort := nil;
+  xsltCopy := nil;
+  xsltText := nil;
+  xsltElement := nil;
+  xsltComment := nil;
+  xsltAttribute := nil;
+  xsltProcessingInstruction := nil;
+  xsltCopyOf := nil;
+  xsltValueOf := nil;
+  xsltNumber := nil;
+  xsltApplyImports := nil;
+  xsltCallTemplate := nil;
+  xsltApplyTemplates := nil;
+  xsltChoose := nil;
+  xsltIf := nil;
+  xsltForEach := nil;
+  xsltRegisterAllElement := nil;
+  xsltCopyTextString := nil;
+  xsltLocalVariablePop := nil;
+  xsltLocalVariablePush := nil;
+  xslHandleDebugger := nil;
+
+  { variables.inc }
+  xsltEvalGlobalVariables := nil;
+  xsltEvalUserParams := nil;
+  xsltQuoteUserParams := nil;
+  xsltEvalOneUserParam := nil;
+  xsltQuoteOneUserParam := nil;
+  xsltParseGlobalVariable := nil;
+  xsltParseGlobalParam := nil;
+  xsltParseStylesheetVariable := nil;
+  xsltParseStylesheetParam := nil;
+  xsltParseStylesheetCallerParam := nil;
+  xsltAddStackElemList := nil;
+  xsltFreeGlobalVariables := nil;
+  xsltVariableLookup := nil;
+  xsltXPathVariableLookup := nil;
+
+  { xslt.inc }
+  xsltInit := nil;
+  xsltCleanupGlobals := nil;
+
+  { xsltutils.inc }
+  xsltGetNsProp := nil;
+  xsltGetCNsProp := nil;
+  xsltGetUTF8Char := nil;
+  xsltDebugSetDefaultTrace := nil;
+  xsltDebugGetDefaultTrace := nil;
+  xsltPrintErrorContext := nil;
+  xsltMessage := nil;
+  xsltSetGenericErrorFunc := nil;
+  xsltSetGenericDebugFunc := nil;
+  xsltSetTransformErrorFunc := nil;
+  xsltTransformError := nil;
+  xsltSetCtxtParseOptions := nil;
+  xsltDocumentSortFunction := nil;
+  xsltSetSortFunc := nil;
+  xsltSetCtxtSortFunc := nil;
+  xsltDefaultSortFunction := nil;
+  xsltDoSortFunction := nil;
+  xsltComputeSortResult := nil;
+  xsltSplitQName := nil;
+  xsltGetQNameURI := nil;
+  xsltGetQNameURI2 := nil;
+  xsltSaveResultTo := nil;
+  xsltSaveResultToFilename := nil;
+  xsltSaveResultToFile := nil;
+  xsltSaveResultToFd := nil;
+  xsltSaveResultToString := nil;
+  xsltXPathCompile := nil;
+  xsltXPathCompileFlags := nil;
+  xsltSaveProfiling := nil;
+  xsltGetProfileInformation := nil;
+  xsltTimestamp := nil;
+  xsltCalibrateAdjust := nil;
+  xsltSetDebuggerStatus := nil;
+  xsltGetDebuggerStatus := nil;
+  xsltSetDebuggerCallbacks := nil;
+  xslAddCall := nil;
+  xslDropCall := nil;
+{$ENDIF} {NIL_FUNCVARS_ON_FREE}
+end;
+
+end.
+

+ 58 - 0
packages/libxml/src/xsltlocale.inc

@@ -0,0 +1,58 @@
+(*
+ * Summary: Locale handling
+ * Description: Interfaces for locale handling. Needed for language dependent
+ *              sorting.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Nick Wellnhofer
+ *)
+
+{$IFDEF HAVE_STRXFRM_L}
+
+{$IFDEF TYPE}
+  {$IF DEFINED(POSIX)}
+  (*
+   * XSLT_LOCALE_POSIX:
+   * Macro indicating to use POSIX locale extensions
+   *)
+  {$DEFINE XSLT_LOCALE_POSIX}
+  xsltLocale = locale_t;
+  xsltLocaleChar = xmlChar;
+  {$ELSEIF DEFINED(WINDOWS)}
+  (*
+   * XSLT_LOCALE_WINAPI:
+   * Macro indicating to use WinAPI for extended locale support
+   *)
+  {$DEFINE XSLT_LOCALE_WINAPI}
+  xsltLocale = LCID;
+  xsltLocaleChar = WideChar;
+  {$ELSE}
+  (*
+   * XSLT_LOCALE_NONE:
+   * Macro indicating that there's no extended locale support
+   *)
+  {$DEFINE XSLT_LOCALE_NONE}
+  xsltLocale = Pointer;
+  xsltLocaleChar = xmlChar;
+  {$ENDIF}
+  xsltLocaleCharPtr = ^xsltLocaleChar;
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+function xsltNewLocale(const langName: xmlCharPtr): xsltLocale; EXTDECL; external xsltlib;
+procedure xsltFreeLocale(locale: xsltLocale); EXTDECL; external xsltlib;
+function xsltStrxfrm(locale: xsltLocale; const astring: xmlCharPtr): xsltLocaleCharPtr; EXTDECL; external xsltlib;
+function xsltLocaleStrcmp(locale: xsltLocale; const str1, str2: xsltLocaleCharPtr): LongInt; EXTDECL; external xsltlib;
+procedure xsltFreeLocales; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltNewLocale: function(const langName: xmlCharPtr): xsltLocale; EXTDECL;
+  xsltFreeLocale: procedure(locale: xsltLocale); EXTDECL;
+  xsltStrxfrm: function(locale: xsltLocale; const astring: xmlCharPtr): xsltLocaleCharPtr; EXTDECL;
+  xsltLocaleStrcmp: function(locale: xsltLocale; const str1, str2: xsltLocaleCharPtr): LongInt; EXTDECL;
+  xsltFreeLocales: procedure; EXTDECL;
+{$ENDIF} {FUNCTION}
+
+{$ENDIF} {HAVE_STRXFRM_L}

+ 73 - 0
packages/libxml/src/xsltpattern.inc

@@ -0,0 +1,73 @@
+(*
+ * Summary: interface for the pattern matching used in template matches.
+ * Description: the implementation of the lookup of the right template
+ *              for a given node must be really fast in order to keep
+ *              decent performances.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{$IFDEF TYPE}
+(**
+ * xsltCompMatch:
+ *
+ * Data structure used for the implementation of patterns.
+ * It is kept private (in pattern.c).
+ *)
+  xsltCompMatch = record end;
+  xsltCompMatchPtr = ^xsltCompMatch;
+
+{$ENDIF}
+
+
+{$IFDEF FUNCTION}
+(*
+ * Pattern related interfaces.
+ *)
+
+function xsltCompilePattern(const pattern: xmlCharPtr; doc: xmlDocPtr; node: xmlNodePtr; style: xsltStylesheetPtr; runtime: xsltTransformContextPtr): xsltCompMatchPtr; EXTDECL; external xsltlib;
+procedure xsltFreeCompMatchList(comp: xsltCompMatchPtr); EXTDECL; external xsltlib;
+function xsltTestCompMatchList(ctxt: xsltTransformContextPtr; node: xmlNodePtr; comp: xsltCompMatchPtr): cint; EXTDECL; external xsltlib;
+procedure xsltCompMatchClearCache(ctxt: xsltTransformContextPtr; comp: xsltCompMatchPtr); EXTDECL; external xsltlib;
+procedure xsltNormalizeCompSteps(payload: Pointer; data: Pointer; const name: xmlCharPtr); EXTDECL; external xsltlib;
+
+(*
+ * Template related interfaces.
+ *)
+function xsltAddTemplate(style: xsltStylesheetPtr; cur: xsltTemplatePtr; const mode: xmlCharPtr; const modeURI: xmlCharPtr): cint; EXTDECL; external xsltlib;
+function xsltGetTemplate(ctxt: xsltTransformContextPtr; node: xmlNodePtr; style: xsltStylesheetPtr): xsltTemplatePtr; EXTDECL; external xsltlib;
+procedure xsltFreeTemplateHashes(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+procedure xsltCleanupTemplates(style: xsltStylesheetPtr); EXTDECL; external xsltlib;
+
+{.$if 0
+function xsltMatchPattern(ctxt: xsltTransformContextPtr; node: xmlNodePtr; const pattern: xmlCharPtr; ctxtdoc: xmlDocPtr; ctxtnode: xmlNodePtr): cint; EXTDECL; external xsltlib;
+endif}
+
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+(*
+ * Pattern related interfaces.
+ *)
+
+  xsltCompilePattern: function(const pattern: xmlCharPtr; doc: xmlDocPtr; node: xmlNodePtr; style: xsltStylesheetPtr; runtime: xsltTransformContextPtr): xsltCompMatchPtr; EXTDECL;
+  xsltFreeCompMatchList: procedure(comp: xsltCompMatchPtr); EXTDECL;
+  xsltTestCompMatchList: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr; comp: xsltCompMatchPtr): cint; EXTDECL;
+  xsltCompMatchClearCache: procedure(ctxt: xsltTransformContextPtr; comp: xsltCompMatchPtr); EXTDECL;
+  xsltNormalizeCompSteps: procedure(payload: Pointer; data: Pointer; const name: xmlCharPtr); EXTDECL;
+
+(*
+ * Template related interfaces.
+ *)
+  xsltAddTemplate: function(style: xsltStylesheetPtr; cur: xsltTemplatePtr; const mode: xmlCharPtr; const modeURI: xmlCharPtr): cint; EXTDECL;
+  xsltGetTemplate: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr; style: xsltStylesheetPtr): xsltTemplatePtr; EXTDECL;
+  xsltFreeTemplateHashes: procedure(style: xsltStylesheetPtr); EXTDECL;
+  xsltCleanupTemplates: procedure(style: xsltStylesheetPtr); EXTDECL;
+
+{.$if 0
+  xsltMatchPattern: function(ctxt: xsltTransformContextPtr; node: xmlNodePtr; const pattern: xmlCharPtr; ctxtdoc: xmlDocPtr; ctxtnode: xmlNodePtr): cint; EXTDECL;
+endif}
+
+{$ENDIF}

+ 307 - 0
packages/libxml/src/xsltutils.inc

@@ -0,0 +1,307 @@
+(*
+ * Summary: set of utilities for the XSLT engine
+ * Description: interfaces for the utilities module of the XSLT engine.
+ *              things like message handling, profiling, and other
+ *              generally useful routines.
+ *
+ * Copy: See Copyright for the status of this software.
+ *
+ * Author: Daniel Veillard
+ *)
+
+{
+/**
+ * XSLT_TODO:
+ *
+ * Macro to flag unimplemented blocks.
+ */
+#define XSLT_TODO							\
+    xsltGenericError(xsltGenericErrorContext,				\
+	    "Unimplemented block at %s:%d\n",				\
+            __FILE__, __LINE__);
+
+/**
+ * XSLT_STRANGE:
+ *
+ * Macro to flag that a problem was detected internally.
+ */
+#define XSLT_STRANGE							\
+    xsltGenericError(xsltGenericErrorContext,				\
+	    "Internal error at %s:%d\n",				\
+            __FILE__, __LINE__);
+
+/**
+ * IS_XSLT_ELEM:
+ *
+ * Checks that the element pertains to XSLT namespace.
+ */
+#define IS_XSLT_ELEM(n)							\
+    (((n) != NULL) && ((n)->type == XML_ELEMENT_NODE) &&                \
+     ((n)->ns != NULL) && (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
+
+/**
+ * IS_XSLT_NAME:
+ *
+ * Checks the value of an element in XSLT namespace.
+ */
+#define IS_XSLT_NAME(n, val)						\
+    (xmlStrEqual((n)->name, (const xmlChar *) (val)))
+
+/**
+ * IS_XSLT_REAL_NODE:
+ *
+ * Check that a node is a 'real' one: document, element, text or attribute.
+ */
+#define IS_XSLT_REAL_NODE(n)						\
+    (((n) != NULL) &&							\
+     (((n)->type == XML_ELEMENT_NODE) ||				\
+      ((n)->type == XML_TEXT_NODE) ||					\
+      ((n)->type == XML_CDATA_SECTION_NODE) ||				\
+      ((n)->type == XML_ATTRIBUTE_NODE) ||				\
+      ((n)->type == XML_DOCUMENT_NODE) ||				\
+      ((n)->type == XML_HTML_DOCUMENT_NODE) ||				\
+      ((n)->type == XML_COMMENT_NODE) ||				\
+      ((n)->type == XML_PI_NODE)))
+}
+
+{$IFDEF FUNCTION}
+
+(*
+ * Our own version of namespaced attributes lookup.
+ *)
+function xsltGetNsProp(node: xmlNodePtr; const name: xmlCharPtr; const nameSpace: xmlCharPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltGetCNsProp(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtr; const nameSpace: xmlCharPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltGetUTF8Char(const utf: PAnsiChar; len: pcint): cint; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+
+(*
+ * Our own version of namespaced attributes lookup.
+ *)
+  xsltGetNsProp: function(node: xmlNodePtr; const name: xmlCharPtr; const nameSpace: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xsltGetCNsProp: function(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtr; const nameSpace: xmlCharPtr): xmlCharPtr; EXTDECL;
+  xsltGetUTF8Char: function(const utf: PAnsiChar; len: pcint): cint; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF TYPE}
+  (*
+   * XSLT Debug Tracing Tracing Types
+   *)
+  xsltDebugTraceCodes = (
+    XSLT_TRACE_ALL =            -1,
+    XSLT_TRACE_NONE =           0,
+    XSLT_TRACE_COPY_TEXT =      1 shl 0,
+    XSLT_TRACE_PROCESS_NODE =   1 shl 1,
+    XSLT_TRACE_APPLY_TEMPLATE = 1 shl 2,
+    XSLT_TRACE_COPY =           1 shl 3,
+    XSLT_TRACE_COMMENT =        1 shl 4,
+    XSLT_TRACE_PI =             1 shl 5,
+    XSLT_TRACE_COPY_OF =        1 shl 6,
+    XSLT_TRACE_VALUE_OF =       1 shl 7,
+    XSLT_TRACE_CALL_TEMPLATE =  1 shl 8,
+    XSLT_TRACE_APPLY_TEMPLATES =1 shl 9,
+    XSLT_TRACE_CHOOSE =         1 shl 10,
+    XSLT_TRACE_IF =             1 shl 11,
+    XSLT_TRACE_FOR_EACH =       1 shl 12,
+    XSLT_TRACE_STRIP_SPACES =   1 shl 13,
+    XSLT_TRACE_TEMPLATES =      1 shl 14,
+    XSLT_TRACE_KEYS =           1 shl 15,
+    XSLT_TRACE_VARIABLES =      1 shl 16
+  );
+{$ENDIF} {TYPE}
+
+(**
+ * XSLT_TRACE:
+ *
+ * Control the type of xsl debugtrace messages emitted.
+ *)
+{
+#define XSLT_TRACE(ctxt,code,call)	\
+	if (ctxt->traceCode && (*(ctxt->traceCode) & code)) \
+	    call
+}
+
+{$IFDEF FUNCTION}
+procedure xsltDebugSetDefaultTrace(val: xsltDebugTraceCodes); EXTDECL; external xsltlib;
+function xsltDebugGetDefaultTrace: xsltDebugTraceCodes; EXTDECL; external xsltlib;
+{$ENDIF}
+
+{$IFDEF FUNCTIONVAR}
+  xsltDebugSetDefaultTrace: procedure(val: xsltDebugTraceCodes); EXTDECL;
+  xsltDebugGetDefaultTrace: function: xsltDebugTraceCodes; EXTDECL;
+{$ENDIF}
+
+{$IFDEF EXTVAR}
+(*
+ * XSLT specific error and debug reporting functions.
+ *)
+var
+  xsltGenericError: xmlGenericErrorFunc; external xsltlib;
+  xsltGenericErrorContext: Pointer; external xsltlib;
+  xsltGenericDebug: xmlGenericErrorFunc; external xsltlib;
+  xsltGenericDebugContext: Pointer; external xsltlib;
+{$ENDIF}
+
+{$IFDEF FUNCTION}
+procedure xsltPrintErrorContext(ctxt: xsltTransformContextPtr; style: xsltStylesheetPtr; node: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltMessage(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr); EXTDECL; external xsltlib;
+procedure xsltSetGenericErrorFunc(ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL; external xsltlib;
+procedure xsltSetGenericDebugFunc(ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL; external xsltlib;
+procedure xsltSetTransformErrorFunc(ctxt: xsltTransformContextPtr;  ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL; external xsltlib;
+procedure xsltTransformError(ctxt: xsltTransformContextPtr; style: xsltStylesheetPtr; node: xmlNodePtr; const msg: PAnsiChar; params: array of const); EXTDECL; external xsltlib;
+function xsltSetCtxtParseOptions(ctxt: xsltTransformContextPtr; options: cint): cint; EXTDECL; external xsltlib;
+
+(*
+ * Sorting.
+ *)
+
+procedure xsltDocumentSortFunction(list: xmlNodeSetPtr); EXTDECL; external xsltlib;
+procedure xsltSetSortFunc(handler: xsltSortFunc); EXTDECL; external xsltlib;
+procedure xsltSetCtxtSortFunc(ctxt: xsltTransformContextPtr; handler: xsltSortFunc); EXTDECL; external xsltlib;
+procedure xsltDefaultSortFunction(ctxt: xsltTransformContextPtr; sorts: xmlNodePtrPtr; nbsorts: cint); EXTDECL; external xsltlib;
+procedure xsltDoSortFunction(ctxt: xsltTransformContextPtr; sorts: xmlNodePtrPtr; nbsorts: cint); EXTDECL; external xsltlib;
+function xsltComputeSortResult(ctxt: xsltTransformContextPtr; sort: xmlNodePtr): xmlXPathObjectPtrPtr; EXTDECL; external xsltlib;
+
+(*
+ * QNames handling.
+ *)
+
+function xsltSplitQName(dict: xmlDictPtr; const name: xmlCharPtr; const prefix: xmlCharPtrPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltGetQNameURI(node: xmlNodePtr; name: xmlCharPtrPtr): xmlCharPtr; EXTDECL; external xsltlib;
+function xsltGetQNameURI2(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtrPtr): xmlCharPtr; EXTDECL; external xsltlib;
+
+(*
+ * Output, reuse libxml I/O buffers.
+ *)
+function xsltSaveResultTo(buf: xmlOutputBufferPtr; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL; external xsltlib;
+function xsltSaveResultToFilename(const URI: PAnsiChar; result: xmlDocPtr; style: xsltStylesheetPtr; compression: cint): cint; EXTDECL; external xsltlib;
+function xsltSaveResultToFile(&file: Pointer; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL; external xsltlib;
+function xsltSaveResultToFd(fd: cint; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL; external xsltlib;
+function xsltSaveResultToString(doc_txt_ptr: xmlCharPtrPtr; doc_txt_len: pcint; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL; external xsltlib;
+
+(*
+ * XPath interface
+ *)
+function xsltXPathCompile(style: xsltStylesheetPtr; const str: xmlCharPtr): xmlXPathCompExprPtr; EXTDECL; external xsltlib;
+function xsltXPathCompileFlags(style: xsltStylesheetPtr; const str: xmlCharPtr; flags: cint): xmlXPathCompExprPtr; EXTDECL; external xsltlib;
+
+(*
+ * Profiling.
+ *)
+procedure xsltSaveProfiling(ctxt: xsltTransformContextPtr; output: Pointer); EXTDECL; external xsltlib;
+function xsltGetProfileInformation(ctxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL; external xsltlib;
+function xsltTimestamp: clong; EXTDECL; external xsltlib;
+procedure xsltCalibrateAdjust(delta: clong); EXTDECL; external xsltlib;
+
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltPrintErrorContext: procedure(ctxt: xsltTransformContextPtr; style: xsltStylesheetPtr; node: xmlNodePtr); EXTDECL;
+  xsltMessage: procedure(ctxt: xsltTransformContextPtr; node: xmlNodePtr; inst: xmlNodePtr); EXTDECL;
+  xsltSetGenericErrorFunc: procedure(ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL;
+  xsltSetGenericDebugFunc: procedure(ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL;
+  xsltSetTransformErrorFunc: procedure(ctxt: xsltTransformContextPtr;  ctx: Pointer; handler: xmlGenericErrorFunc); EXTDECL;
+  xsltTransformError: procedure(ctxt: xsltTransformContextPtr; style: xsltStylesheetPtr; node: xmlNodePtr; const msg: PAnsiChar; params: array of const); EXTDECL;
+  xsltSetCtxtParseOptions: function(ctxt: xsltTransformContextPtr; options: cint): cint; EXTDECL;
+
+(*
+ * Sorting.
+ *)
+
+  xsltDocumentSortFunction: procedure(list: xmlNodeSetPtr); EXTDECL;
+  xsltSetSortFunc: procedure(handler: xsltSortFunc); EXTDECL;
+  xsltSetCtxtSortFunc: procedure(ctxt: xsltTransformContextPtr; handler: xsltSortFunc); EXTDECL;
+  xsltDefaultSortFunction: procedure(ctxt: xsltTransformContextPtr; sorts: xmlNodePtrPtr; nbsorts: cint); EXTDECL;
+  xsltDoSortFunction: procedure(ctxt: xsltTransformContextPtr; sorts: xmlNodePtrPtr; nbsorts: cint); EXTDECL;
+  xsltComputeSortResult: function(ctxt: xsltTransformContextPtr; sort: xmlNodePtr): xmlXPathObjectPtrPtr; EXTDECL;
+
+(*
+ * QNames handling.
+ *)
+
+  xsltSplitQName: function(dict: xmlDictPtr; const name: xmlCharPtr; const prefix: xmlCharPtrPtr): xmlCharPtr; EXTDECL;
+  xsltGetQNameURI: function(node: xmlNodePtr; name: xmlCharPtrPtr): xmlCharPtr; EXTDECL;
+  xsltGetQNameURI2: function(style: xsltStylesheetPtr; node: xmlNodePtr; const name: xmlCharPtrPtr): xmlCharPtr; EXTDECL;
+
+(*
+ * Output, reuse libxml I/O buffers.
+ *)
+  xsltSaveResultTo: function(buf: xmlOutputBufferPtr; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL;
+  xsltSaveResultToFilename: function(const URI: PAnsiChar; result: xmlDocPtr; style: xsltStylesheetPtr; compression: cint): cint; EXTDECL;
+  xsltSaveResultToFile: function(&file: Pointer; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL;
+  xsltSaveResultToFd: function(fd: cint; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL;
+  xsltSaveResultToString: function(doc_txt_ptr: xmlCharPtrPtr; doc_txt_len: pcint; result: xmlDocPtr; style: xsltStylesheetPtr): cint; EXTDECL;
+
+(*
+ * XPath interface
+ *)
+  xsltXPathCompile: function(style: xsltStylesheetPtr; const str: xmlCharPtr): xmlXPathCompExprPtr; EXTDECL;
+  xsltXPathCompileFlags: function(style: xsltStylesheetPtr; const str: xmlCharPtr; flags: cint): xmlXPathCompExprPtr; EXTDECL;
+
+(*
+ * Profiling.
+ *)
+  xsltSaveProfiling: procedure(ctxt: xsltTransformContextPtr; output: Pointer); EXTDECL;
+  xsltGetProfileInformation: function(ctxt: xsltTransformContextPtr): xmlDocPtr; EXTDECL;
+  xsltTimestamp: function: clong; EXTDECL;
+  xsltCalibrateAdjust: procedure(delta: clong); EXTDECL;
+
+{$ENDIF} {FUNCTIONVAR}
+
+{$IFDEF CONST}
+  (**
+   * XSLT_TIMESTAMP_TICS_PER_SEC:
+   *
+   * Sampling precision for profiling
+   *)
+  XSLT_TIMESTAMP_TICS_PER_SEC = clong(100000);
+{$ENDIF} {CONST}
+
+{$IFDEF TYPE}
+(*
+ * Hooks for the debugger.
+ *)
+
+  xsltDebugStatusCodes = (
+    XSLT_DEBUG_NONE = 0, (* no debugging allowed *)
+    XSLT_DEBUG_INIT,
+    XSLT_DEBUG_STEP,
+    XSLT_DEBUG_STEPOUT,
+    XSLT_DEBUG_NEXT,
+    XSLT_DEBUG_STOP,
+    XSLT_DEBUG_CONT,
+    XSLT_DEBUG_RUN,
+    XSLT_DEBUG_RUN_RESTART,
+    XSLT_DEBUG_QUIT
+  );
+{$ENDIF} {TYPE}
+
+{$IFDEF EXTVAR}
+var
+  xslDebugStatus: cint; external xsltlib;
+{$ENDIF} {EXTVAR}
+
+{$IFDEF TYPE}
+  xsltHandleDebuggerCallback = procedure(cur: xmlNodePtr; node: xmlNodePtr;
+    templ: xsltTemplatePtr; ctxt: xsltTransformContextPtr); EXTDECL;
+  xsltAddCallCallback = function(templ: xsltTemplatePtr; source: xmlNodePtr): cint; EXTDECL;
+  xsltDropCallCallback = procedure; EXTDECL;
+{$ENDIF} {TYPE}
+
+{$IFDEF FUNCTION}
+procedure xsltSetDebuggerStatus(value: cint); EXTDECL; external xsltlib;
+function xsltGetDebuggerStatus: cint; EXTDECL; external xsltlib;
+function xsltSetDebuggerCallbacks(no: cint; block: Pointer): cint; EXTDECL; external xsltlib;
+function xslAddCall(templ: xsltTemplatePtr; source: xmlNodePtr): cint; EXTDECL; external xsltlib;
+procedure xslDropCall; EXTDECL; external xsltlib;
+{$ENDIF} {FUNCTION}
+
+{$IFDEF FUNCTIONVAR}
+  xsltSetDebuggerStatus: procedure(value: cint); EXTDECL;
+  xsltGetDebuggerStatus: function: cint; EXTDECL;
+  xsltSetDebuggerCallbacks: function(no: cint; block: Pointer): cint; EXTDECL;
+  xslAddCall: function(templ: xsltTemplatePtr; source: xmlNodePtr): cint; EXTDECL;
+  xslDropCall: procedure; EXTDECL;
+{$ENDIF} {FUNCTIONVAR}
+