changeset 11244:66b5bcf8564d

Merge
author kcr
date Tue, 02 Apr 2019 09:58:07 -0700
parents f9d0dcb8f3bd e3404769d365
children d13a6227b543
files modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/Makefile.am modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/common.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/crypto.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/date.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/dynamic.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exslt.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exslt.h modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exsltconfig.h.in modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exsltexports.h modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/functions.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/libexslt.3 modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/libexslt.h modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/math.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/saxon.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/sets.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/strings.c modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/win32/win32config.h
diffstat 54 files changed, 479 insertions(+), 9792 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Fri Mar 22 08:11:38 2019 -0700
+++ b/build.gradle	Tue Apr 02 09:58:07 2019 -0700
@@ -336,7 +336,7 @@
 defineProperty("JAVAC", cygpathExe("$JDK_HOME/bin/javac"))
 defineProperty("JAVADOC", cygpathExe("$JDK_HOME/bin/javadoc"))
 defineProperty("JMOD", cygpathExe("$JDK_HOME/bin/jmod"))
-defineProperty("JDK_DOCS", "https://docs.oracle.com/javase/10/docs/api/")
+defineProperty("JDK_DOCS", "https://docs.oracle.com/en/java/javase/12/docs/api/")
 defineProperty("JDK_JMODS", cygpath(System.getenv("JDK_JMODS")) ?: cygpath(System.getenv("JDK_HOME") + "/jmods"))
 
 defineProperty("javaRuntimeVersion", System.getProperty("java.runtime.version"))
@@ -1216,14 +1216,17 @@
     NUM_COMPILE_THREADS = 1
 }
 
-// Check for Gradle 4.8, error if < 4.8.
-if (gradle.gradleVersion != "4.8") {
+// Check gradle version
+if (gradle.gradleVersion != jfxGradleVersion) {
     def ver = gradle.gradleVersion.split("[\\.]");
+    def verMin = jfxGradleVersionMin.split("[\\.]");
     def gradleMajor = Integer.parseInt(ver[0]);
     def gradleMinor = Integer.parseInt(ver[1].split("[^0-9]")[0]);
+    def gradleMajorMin = Integer.parseInt(verMin[0]);
+    def gradleMinorMin = Integer.parseInt(verMin[1].split("[^0-9]")[0]);
     def err = "";
-    if (gradleMajor < 4 || (gradleMajor == 4 && gradleMinor < 8)) {
-        err = "Gradle version too old: ${gradle.gradleVersion}; must be at least 4.8"
+    if (gradleMajor < gradleMajorMin || (gradleMajor == gradleMajorMin && gradleMinor < gradleMinorMin)) {
+        err = "Gradle version too old: ${gradle.gradleVersion}; must be at least ${jfxGradleVersionMin}"
     }
 
     if (IS_GRADLE_VERSION_CHECK && err != "") {
@@ -1232,7 +1235,7 @@
 
     logger.warn("*****************************************************************");
     logger.warn("Unsupported gradle version $gradle.gradleVersion in use.");
-    logger.warn("Only version 4.8 is supported. Use this version at your own risk");
+    logger.warn("Only version $jfxGradleVersion is supported. Use this version at your own risk");
     if ( err != "") logger.warn(err);
     logger.warn("*****************************************************************");
 }
@@ -1563,9 +1566,11 @@
                 maven(MavenPublication) {
                     artifactId = "javafx-${project.name}"
 
-                    artifact project.tasks."moduleEmptyPublicationJar$t.capital"
-                    artifact project.tasks."modularPublicationJar$t.capital" {
-                        classifier "$t.name"
+                    afterEvaluate {
+                        artifact project.tasks."moduleEmptyPublicationJar$t.capital"
+                        artifact project.tasks."modularPublicationJar$t.capital" {
+                            classifier "$t.name"
+                        }
                     }
 
                     pom.withXml {
@@ -3868,7 +3873,8 @@
         enabled = COMPILE_SWT
         group = "Basic"
         description = "Creates the javafx-swt.jar for the $t.name target"
-        archiveName = "${project(":swt").buildDir}/libs/javafx-swt.jar";
+        destinationDir = file("${project(":swt").buildDir}/libs")
+        archiveName = "javafx-swt.jar"
         includeEmptyDirs = false
         from("${project(":swt").buildDir}/classes/java/main");
         include("**/javafx/embed/swt/**")
@@ -3888,7 +3894,7 @@
         dependsOn(javafxSwtTask)
 
         doLast() {
-            ant.jar (update: true, index: true, destfile: javafxSwtTask.archiveName)
+            ant.jar (update: true, index: true, destfile: "${javafxSwtTask.destinationDir}/${javafxSwtTask.archiveName}")
         }
     }
 
--- a/build.properties	Fri Mar 22 08:11:38 2019 -0700
+++ b/build.properties	Tue Apr 02 09:58:07 2019 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -74,3 +74,12 @@
 
 jfx.build.jdk.version.min=11
 jfx.build.jdk.buildnum.min=28
+
+# The jfx.gradle.version property defines the version of gradle that is
+# used in the build. It must match the version number in
+# gradle/wrapper/gradle-wrapper.properties and should also be recorded in
+# gradle/legal/gradle.md.
+# The jfx.gradle.version.min property defines the minimum version of gradle
+# that is supported. It must be <= jfx.gradle.version.
+jfx.gradle.version=5.3
+jfx.gradle.version.min=4.8
--- a/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy	Fri Mar 22 08:11:38 2019 -0700
+++ b/buildSrc/src/main/groovy/com/sun/javafx/gradle/NativeCompileTask.groovy	Tue Apr 02 09:58:07 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,7 @@
         updateFiles();
         def source = project.files(allFiles);
         boolean forceCompile = false;
-        final Set<File> files = new HashSet<File>();
+        Set<File> files = new HashSet<File>();
         source.each { File file ->
             final Map fileData = dependencies.get(file.toString());
             final boolean isModified = fileData == null ||
--- a/gradle/legal/gradle.md	Fri Mar 22 08:11:38 2019 -0700
+++ b/gradle/legal/gradle.md	Tue Apr 02 09:58:07 2019 -0700
@@ -1,4 +1,4 @@
-## Gradle v4.8
+## Gradle v5.3
 
 ### Apache 2.0 License
 <pre>
--- a/gradle/wrapper/gradle-wrapper.properties	Fri Mar 22 08:11:38 2019 -0700
+++ b/gradle/wrapper/gradle-wrapper.properties	Tue Apr 02 09:58:07 2019 -0700
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
--- a/modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/platform/PlatformManager.java	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.media/src/main/java/com/sun/media/jfxmediaimpl/platform/PlatformManager.java	Tue Apr 02 09:58:07 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,14 +32,12 @@
 import com.sun.media.jfxmedia.logging.Logger;
 import com.sun.media.jfxmediaimpl.platform.java.JavaPlatform;
 import com.sun.media.jfxmediaimpl.HostUtils;
-import com.sun.media.jfxmediaimpl.platform.gstreamer.GSTPlatform;
-import com.sun.media.jfxmediaimpl.platform.osx.OSXPlatform;
-import com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.lang.reflect.Method;
 
 /**
  * Core media platform management code.
@@ -77,7 +75,7 @@
     private final List<Platform> platforms;
 
     private PlatformManager() {
-        platforms = new ArrayList<Platform>();
+        platforms = new ArrayList<>();
 
         Platform platty;
 
@@ -98,7 +96,8 @@
         }
 
         if (!HostUtils.isIOS() && isPlatformEnabled("GSTPlatform")) {
-            platty = GSTPlatform.getPlatformInstance();
+            platty = getPlatformInstance(
+                    "com.sun.media.jfxmediaimpl.platform.gstreamer.GSTPlatform");
             if (null != platty) {
                 platforms.add(platty);
             }
@@ -106,14 +105,16 @@
 
         // Add after GSTPlatform so it's used as a fallback
         if (HostUtils.isMacOSX() && isPlatformEnabled("OSXPlatform")) {
-            platty = OSXPlatform.getPlatformInstance();
+            platty = getPlatformInstance(
+                    "com.sun.media.jfxmediaimpl.platform.osx.OSXPlatform");
             if (null != platty) {
                 platforms.add(platty);
             }
         }
 
         if (HostUtils.isIOS() && isPlatformEnabled("IOSPlatform")) {
-            platty = IOSPlatform.getPlatformInstance();
+            platty = getPlatformInstance(
+                    "com.sun.media.jfxmediaimpl.platform.ios.IOSPlatform");
             if (null != platty) {
                 platforms.add(platty);
             }
@@ -129,6 +130,23 @@
         }
     }
 
+    private Platform getPlatformInstance(String platformClass) {
+        try {
+            Class c = Class.forName(platformClass);
+            Method m = c.getDeclaredMethod("getPlatformInstance", (Class[])null);
+            Object platform = m.invoke(null, (Object[])null);
+            return (Platform)platform;
+        } catch (Exception e) {
+            if (Logger.canLog(Logger.DEBUG)) {
+                Logger.logMsg(Logger.DEBUG, "Failed to get platform instance" +
+                              " for " + platformClass + ". Exception: " +
+                              e.getMessage());
+            }
+        }
+
+        return null;
+    }
+
     public synchronized void loadPlatforms() {
         // Use an iterator so we can remove on failure
         Iterator<Platform> iter = platforms.iterator();
--- a/modules/javafx.web/src/main/legal/libxslt.md	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/legal/libxslt.md	Tue Apr 02 09:58:07 2019 -0700
@@ -1,4 +1,4 @@
-## xmlsoft.org: libxslt v1.1.32
+## xmlsoft.org: libxslt v1.1.33
 
 ### libxslt License
 <pre>
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/config.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/config.h	Tue Apr 02 09:58:07 2019 -0700
@@ -32,7 +32,7 @@
 #define HAVE_FTIME 1
 
 /* Define if gcrypt library is available. */
-/* #undef HAVE_GCRYPT 1 */
+
 
 /* Define to 1 if you have the `gettimeofday' function. */
 #define HAVE_GETTIMEOFDAY 1
@@ -143,7 +143,7 @@
 #define HAVE_VSPRINTF 1
 
 /* Define to 1 if you have the <xlocale.h> header file. */
-/* #undef HAVE_XLOCALE_H */
+
 
 /* Define to 1 if you have the `_stat' function. */
 /* #undef HAVE__STAT */
@@ -162,7 +162,7 @@
 #define PACKAGE_NAME "libxslt"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxslt 1.1.32"
+#define PACKAGE_STRING "libxslt 1.1.33"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libxslt"
@@ -171,7 +171,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.1.32"
+#define PACKAGE_VERSION "1.1.33"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -199,7 +199,7 @@
 
 
 /* Version number of package */
-#define VERSION "1.1.32"
+#define VERSION "1.1.33"
 
 /* Define if debugging support is enabled */
 /* #undef WITH_DEBUGGER */
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/libexslt/exsltconfig.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/libexslt/exsltconfig.h	Tue Apr 02 09:58:07 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * exsltconfig.h: compile-time version informations for the EXSLT library
+ * exsltconfig.h: compile-time version information for the EXSLT library
  *
  * See Copyright for the status of this software.
  *
@@ -18,7 +18,7 @@
  *
  * the version string like "1.2.3"
  */
-#define LIBEXSLT_DOTTED_VERSION "1.1.32"
+#define LIBEXSLT_DOTTED_VERSION "1.1.33"
 
 /**
  * LIBEXSLT_VERSION:
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/libxslt/xsltwin32config.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/linux/libxslt/xsltwin32config.h	Tue Apr 02 09:58:07 2019 -0700
@@ -1,7 +1,7 @@
 /*
- * Summary: compile-time version informations for the XSLT engine
+ * Summary: compile-time version information for the XSLT engine
  *          when compiled on windows
- * Description: compile-time version informations for the XSLT engine
+ * Description: compile-time version information for the XSLT engine
  *              when compiled on windows. This file is generated.
  *
  * Copy: See Copyright for the status of this software.
@@ -23,21 +23,21 @@
  *
  * the version string like "1.2.3"
  */
-#define LIBXSLT_DOTTED_VERSION "1.1.32"
+#define LIBXSLT_DOTTED_VERSION "1.1.33"
 
 /**
  * LIBXSLT_VERSION:
  *
  * the version number: 1.2.3 value is 1002003
  */
-#define LIBXSLT_VERSION 10132
+#define LIBXSLT_VERSION 10133
 
 /**
  * LIBXSLT_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "1002003"
  */
-#define LIBXSLT_VERSION_STRING "10132"
+#define LIBXSLT_VERSION_STRING "10133"
 
 /**
  * LIBXSLT_VERSION_EXTRA:
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/mac/config.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/mac/config.h	Tue Apr 02 09:58:07 2019 -0700
@@ -161,7 +161,7 @@
 #define PACKAGE_NAME "libxslt"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxslt 1.1.32"
+#define PACKAGE_STRING "libxslt 1.1.33"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libxslt"
@@ -170,7 +170,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.1.32"
+#define PACKAGE_VERSION "1.1.33"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
@@ -198,7 +198,7 @@
 
 
 /* Version number of package */
-#define VERSION "1.1.32"
+#define VERSION "1.1.33"
 
 /* Define if debugging support is enabled */
 /* #undef WITH_DEBUGGER */
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/configure.ac	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/configure.ac	Tue Apr 02 09:58:07 2019 -0700
@@ -3,7 +3,7 @@
 
 m4_define([MAJOR_VERSION], [1])
 m4_define([MINOR_VERSION], [1])
-m4_define([MICRO_VERSION], [32])
+m4_define([MICRO_VERSION], [33])
 
 AC_INIT([libxslt], [MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
 AC_CONFIG_SRCDIR([libxslt/xslt.c])
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/Makefile.am	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -I$(top_srcdir)/libexslt \
-	      -I$(top_builddir) -I$(top_builddir)/libxslt \
-	      -I$(top_builddir)/libexslt
-
-AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS)
-
-lib_LTLIBRARIES = libexslt.la
-
-exsltincdir = $(includedir)/libexslt
-
-exsltinc_HEADERS =                      \
-	exslt.h				\
-	exsltexports.h
-nodist_exsltinc_HEADERS =               \
-	exsltconfig.h
-
-libexslt_la_SOURCES =                   \
-	exslt.c				\
-	common.c			\
-	crypto.c			\
-	math.c				\
-	sets.c				\
-	functions.c			\
-	strings.c			\
-	date.c				\
-	saxon.c				\
-	libexslt.h			\
-	dynamic.c
-
-libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(LIBGCRYPT_LIBS) $(M_LIBS)
-libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBEXSLT_VERSION_INFO)
-
-man_MANS = libexslt.3
-
-EXTRA_DIST = $(man_MANS)
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/common.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-#include <libxslt/transform.h>
-#include <libxslt/extra.h>
-#include <libxslt/preproc.h>
-
-#include "exslt.h"
-
-static void
-exsltNodeSetFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    if (xmlXPathStackIsNodeSet (ctxt)) {
-    xsltFunctionNodeSet (ctxt, nargs);
-    return;
-    } else {
-    xmlDocPtr fragment;
-    xsltTransformContextPtr tctxt = xsltXPathGetTransformContext(ctxt);
-    xmlNodePtr txt;
-    xmlChar *strval;
-    xmlXPathObjectPtr obj;
-    /*
-    * SPEC EXSLT:
-    * "You can also use this function to turn a string into a text
-    * node, which is helpful if you want to pass a string to a
-    * function that only accepts a node-set."
-    */
-    fragment = xsltCreateRVT(tctxt);
-    if (fragment == NULL) {
-        xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltNodeSetFunction: Failed to create a tree fragment.\n");
-        tctxt->state = XSLT_STATE_STOPPED;
-        return;
-    }
-    xsltRegisterLocalRVT(tctxt, fragment);
-
-    strval = xmlXPathPopString (ctxt);
-
-    txt = xmlNewDocText (fragment, strval);
-    xmlAddChild((xmlNodePtr) fragment, txt);
-    obj = xmlXPathNewNodeSet(txt);
-    if (obj == NULL) {
-        xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltNodeSetFunction: Failed to create a node set object.\n");
-        tctxt->state = XSLT_STATE_STOPPED;
-    }
-    if (strval != NULL)
-        xmlFree (strval);
-
-    valuePush (ctxt, obj);
-    }
-}
-
-static void
-exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlXPathObjectPtr obj, ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    obj = valuePop(ctxt);
-
-    switch (obj->type) {
-    case XPATH_STRING:
-    ret = xmlXPathNewCString("string");
-    break;
-    case XPATH_NUMBER:
-    ret = xmlXPathNewCString("number");
-    break;
-    case XPATH_BOOLEAN:
-    ret = xmlXPathNewCString("boolean");
-    break;
-    case XPATH_NODESET:
-    ret = xmlXPathNewCString("node-set");
-    break;
-    case XPATH_XSLT_TREE:
-    ret = xmlXPathNewCString("RTF");
-    break;
-    case XPATH_USERS:
-    ret = xmlXPathNewCString("external");
-    break;
-    default:
-    xsltGenericError(xsltGenericErrorContext,
-        "object-type() invalid arg\n");
-    ctxt->error = XPATH_INVALID_TYPE;
-    xmlXPathFreeObject(obj);
-    return;
-    }
-    xmlXPathFreeObject(obj);
-    valuePush(ctxt, ret);
-}
-
-
-/**
- * exsltCommonRegister:
- *
- * Registers the EXSLT - Common module
- */
-
-void
-exsltCommonRegister (void) {
-    xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
-                  EXSLT_COMMON_NAMESPACE,
-                  exsltNodeSetFunction);
-    xsltRegisterExtModuleFunction((const xmlChar *) "object-type",
-                  EXSLT_COMMON_NAMESPACE,
-                  exsltObjectTypeFunction);
-    xsltRegisterExtModuleElement((const xmlChar *) "document",
-                 EXSLT_COMMON_NAMESPACE,
-                 (xsltPreComputeFunction) xsltDocumentComp,
-                 (xsltTransformFunction) xsltDocumentElem);
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/crypto.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,808 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/parser.h>
-#include <libxml/encoding.h>
-#include <libxml/uri.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-#ifdef EXSLT_CRYPTO_ENABLED
-
-#define HASH_DIGEST_LENGTH 32
-#define MD5_DIGEST_LENGTH 16
-#define SHA1_DIGEST_LENGTH 20
-
-/* gcrypt rc4 can do 256 bit keys, but cryptoapi limit
-   seems to be 128 for the default provider */
-#define RC4_KEY_LENGTH 128
-
-/* The following routines have been declared static - this should be
-   reviewed to consider whether we want to expose them to the API
-   exsltCryptoBin2Hex
-   exsltCryptoHex2Bin
-   exsltCryptoGcryptInit
-   exsltCryptoGcryptHash
-   exsltCryptoGcryptRc4Encrypt
-   exsltCryptoGcryptRC4Decrypt
-*/
-
-/**
- * exsltCryptoBin2Hex:
- * @bin: binary blob to convert
- * @binlen: length of binary blob
- * @hex: buffer to store hex version of blob
- * @hexlen: length of buffer to store hex version of blob
- *
- * Helper function which encodes a binary blob as hex.
- */
-static void
-exsltCryptoBin2Hex (const unsigned char *bin, int binlen,
-            unsigned char *hex, int hexlen) {
-    static const char bin2hex[] = { '0', '1', '2', '3',
-    '4', '5', '6', '7',
-    '8', '9', 'a', 'b',
-    'c', 'd', 'e', 'f'
-    };
-
-    unsigned char lo, hi;
-    int i, pos;
-    for (i = 0, pos = 0; (i < binlen && pos < hexlen); i++) {
-    lo = bin[i] & 0xf;
-    hi = bin[i] >> 4;
-    hex[pos++] = bin2hex[hi];
-    hex[pos++] = bin2hex[lo];
-    }
-
-    hex[pos] = '\0';
-}
-
-/**
- * exsltCryptoHex2Bin:
- * @hex: hex version of blob to convert
- * @hexlen: length of hex buffer
- * @bin: destination binary buffer
- * @binlen: length of binary buffer
- *
- * Helper function which decodes a hex blob to binary
- */
-static int
-exsltCryptoHex2Bin (const unsigned char *hex, int hexlen,
-            unsigned char *bin, int binlen) {
-    int i = 0, j = 0;
-    unsigned char lo, hi, result, tmp;
-
-    while (i < hexlen && j < binlen) {
-    hi = lo = 0;
-
-    tmp = hex[i++];
-    if (tmp >= '0' && tmp <= '9')
-        hi = tmp - '0';
-    else if (tmp >= 'a' && tmp <= 'f')
-        hi = 10 + (tmp - 'a');
-
-    tmp = hex[i++];
-    if (tmp >= '0' && tmp <= '9')
-        lo = tmp - '0';
-    else if (tmp >= 'a' && tmp <= 'f')
-        lo = 10 + (tmp - 'a');
-
-    result = hi << 4;
-    result += lo;
-    bin[j++] = result;
-    }
-
-    return j;
-}
-
-#if defined(_WIN32) && !defined(__CYGWIN__)
-
-#define HAVE_CRYPTO
-#define PLATFORM_HASH   exsltCryptoCryptoApiHash
-#define PLATFORM_RC4_ENCRYPT exsltCryptoCryptoApiRc4Encrypt
-#define PLATFORM_RC4_DECRYPT exsltCryptoCryptoApiRc4Decrypt
-#define PLATFORM_MD4 CALG_MD4
-#define PLATFORM_MD5 CALG_MD5
-#define PLATFORM_SHA1 CALG_SHA1
-
-#include <windows.h>
-#include <wincrypt.h>
-#ifdef _MSC_VER
-#pragma comment(lib, "advapi32.lib")
-#endif
-
-static void
-exsltCryptoCryptoApiReportError (xmlXPathParserContextPtr ctxt,
-                 int line) {
-    char *lpMsgBuf;
-    DWORD dw = GetLastError ();
-
-    FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
-           FORMAT_MESSAGE_FROM_SYSTEM, NULL, dw,
-           MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
-           (LPTSTR) & lpMsgBuf, 0, NULL);
-
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL, NULL,
-            "exslt:crypto error (line %d). %s", line,
-            lpMsgBuf);
-    LocalFree (lpMsgBuf);
-}
-
-static HCRYPTHASH
-exsltCryptoCryptoApiCreateHash (xmlXPathParserContextPtr ctxt,
-                HCRYPTPROV hCryptProv, ALG_ID algorithm,
-                const unsigned char *msg, unsigned int msglen,
-                char *dest, unsigned int destlen)
-{
-    HCRYPTHASH hHash = 0;
-    DWORD dwHashLen = destlen;
-
-    if (!CryptCreateHash (hCryptProv, algorithm, 0, 0, &hHash)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    return 0;
-    }
-
-    if (!CryptHashData (hHash, msg, msglen, 0)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-
-    if (!CryptGetHashParam (hHash, HP_HASHVAL, (BYTE *) dest, &dwHashLen, 0)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-
-  fail:
-    return hHash;
-}
-
-/**
- * exsltCryptoCryptoApiHash:
- * @ctxt: an XPath parser context
- * @algorithm: hashing algorithm to use
- * @msg: text to be hashed
- * @msglen: length of text to be hashed
- * @dest: buffer to place hash result
- *
- * Helper function which hashes a message using MD4, MD5, or SHA1.
- * Uses Win32 CryptoAPI.
- */
-static void
-exsltCryptoCryptoApiHash (xmlXPathParserContextPtr ctxt,
-              ALG_ID algorithm, const char *msg,
-              unsigned long msglen,
-              char dest[HASH_DIGEST_LENGTH]) {
-    HCRYPTPROV hCryptProv;
-    HCRYPTHASH hHash;
-
-    if (!CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL,
-                  CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    return;
-    }
-
-    hHash = exsltCryptoCryptoApiCreateHash (ctxt, hCryptProv,
-                        algorithm, (unsigned char *) msg,
-                                            msglen, dest, HASH_DIGEST_LENGTH);
-    if (0 != hHash) {
-    CryptDestroyHash (hHash);
-    }
-
-    CryptReleaseContext (hCryptProv, 0);
-}
-
-static void
-exsltCryptoCryptoApiRc4Encrypt (xmlXPathParserContextPtr ctxt,
-                const unsigned char *key,
-                const unsigned char *msg, int msglen,
-                unsigned char *dest, int destlen) {
-    HCRYPTPROV hCryptProv;
-    HCRYPTKEY hKey;
-    HCRYPTHASH hHash;
-    DWORD dwDataLen;
-    char hash[HASH_DIGEST_LENGTH];
-
-    if (msglen > destlen) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto : internal error exsltCryptoCryptoApiRc4Encrypt dest buffer too small.\n");
-    return;
-    }
-
-    if (!CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL,
-                  CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    return;
-    }
-
-    hHash = exsltCryptoCryptoApiCreateHash (ctxt, hCryptProv,
-                        CALG_SHA1, key,
-                        RC4_KEY_LENGTH, hash,
-                        HASH_DIGEST_LENGTH);
-
-    if (!CryptDeriveKey
-    (hCryptProv, CALG_RC4, hHash, 0x00800000, &hKey)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-/* Now encrypt data. */
-    dwDataLen = msglen;
-    memcpy (dest, msg, msglen);
-    if (!CryptEncrypt (hKey, 0, TRUE, 0, dest, &dwDataLen, msglen)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-
-  fail:
-    if (0 != hHash) {
-    CryptDestroyHash (hHash);
-    }
-
-    CryptDestroyKey (hKey);
-    CryptReleaseContext (hCryptProv, 0);
-}
-
-static void
-exsltCryptoCryptoApiRc4Decrypt (xmlXPathParserContextPtr ctxt,
-                const unsigned char *key,
-                const unsigned char *msg, int msglen,
-                unsigned char *dest, int destlen) {
-    HCRYPTPROV hCryptProv;
-    HCRYPTKEY hKey;
-    HCRYPTHASH hHash;
-    DWORD dwDataLen;
-    char hash[HASH_DIGEST_LENGTH];
-
-    if (msglen > destlen) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto : internal error exsltCryptoCryptoApiRc4Encrypt dest buffer too small.\n");
-    return;
-    }
-
-    if (!CryptAcquireContext (&hCryptProv, NULL, NULL, PROV_RSA_FULL,
-                  CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    return;
-    }
-
-    hHash = exsltCryptoCryptoApiCreateHash (ctxt, hCryptProv,
-                        CALG_SHA1, key,
-                        RC4_KEY_LENGTH, hash,
-                        HASH_DIGEST_LENGTH);
-
-    if (!CryptDeriveKey
-    (hCryptProv, CALG_RC4, hHash, 0x00800000, &hKey)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-/* Now encrypt data. */
-    dwDataLen = msglen;
-    memcpy (dest, msg, msglen);
-    if (!CryptDecrypt (hKey, 0, TRUE, 0, dest, &dwDataLen)) {
-    exsltCryptoCryptoApiReportError (ctxt, __LINE__);
-    goto fail;
-    }
-
-  fail:
-    if (0 != hHash) {
-    CryptDestroyHash (hHash);
-    }
-
-    CryptDestroyKey (hKey);
-    CryptReleaseContext (hCryptProv, 0);
-}
-
-#endif /* defined(_WIN32) */
-
-#if defined(HAVE_GCRYPT)
-
-#define HAVE_CRYPTO
-#define PLATFORM_HASH   exsltCryptoGcryptHash
-#define PLATFORM_RC4_ENCRYPT exsltCryptoGcryptRc4Encrypt
-#define PLATFORM_RC4_DECRYPT exsltCryptoGcryptRc4Decrypt
-#define PLATFORM_MD4 GCRY_MD_MD4
-#define PLATFORM_MD5 GCRY_MD_MD5
-#define PLATFORM_SHA1 GCRY_MD_SHA1
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>     /* needed by gcrypt.h 4 Jul 04 */
-#endif
-#include <gcrypt.h>
-
-static void
-exsltCryptoGcryptInit (void) {
-    static int gcrypt_init;
-    xmlLockLibrary ();
-
-    if (!gcrypt_init) {
-/* The function `gcry_check_version' must be called before any other
-     function in the library, because it initializes the thread support
-     subsystem in Libgcrypt. To achieve this in all generality, it is
-     necessary to synchronize the call to this function with all other calls
-     to functions in the library, using the synchronization mechanisms
-     available in your thread library. (from gcrypt.info)
-*/
-    gcry_check_version (GCRYPT_VERSION);
-    gcrypt_init = 1;
-    }
-
-    xmlUnlockLibrary ();
-}
-
-/**
- * exsltCryptoGcryptHash:
- * @ctxt: an XPath parser context
- * @algorithm: hashing algorithm to use
- * @msg: text to be hashed
- * @msglen: length of text to be hashed
- * @dest: buffer to place hash result
- *
- * Helper function which hashes a message using MD4, MD5, or SHA1.
- * using gcrypt
- */
-static void
-exsltCryptoGcryptHash (xmlXPathParserContextPtr ctxt ATTRIBUTE_UNUSED,
-/* changed the enum to int */
-               int algorithm, const char *msg,
-               unsigned long msglen,
-               char dest[HASH_DIGEST_LENGTH]) {
-    exsltCryptoGcryptInit ();
-    gcry_md_hash_buffer (algorithm, dest, msg, msglen);
-}
-
-static void
-exsltCryptoGcryptRc4Encrypt (xmlXPathParserContextPtr ctxt,
-                 const unsigned char *key,
-                 const unsigned char *msg, int msglen,
-                 unsigned char *dest, int destlen) {
-    gcry_cipher_hd_t cipher;
-    gcry_error_t rc = 0;
-
-    exsltCryptoGcryptInit ();
-
-    rc = gcry_cipher_open (&cipher, GCRY_CIPHER_ARCFOUR,
-               GCRY_CIPHER_MODE_STREAM, 0);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_open)\n",
-                gcry_strerror (rc));
-    }
-
-    rc = gcry_cipher_setkey (cipher, key, RC4_KEY_LENGTH);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_setkey)\n",
-                gcry_strerror (rc));
-    }
-
-    rc = gcry_cipher_encrypt (cipher, (unsigned char *) dest, destlen,
-                  (const unsigned char *) msg, msglen);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_encrypt)\n",
-                gcry_strerror (rc));
-    }
-
-    gcry_cipher_close (cipher);
-}
-
-static void
-exsltCryptoGcryptRc4Decrypt (xmlXPathParserContextPtr ctxt,
-                 const unsigned char *key,
-                 const unsigned char *msg, int msglen,
-                 unsigned char *dest, int destlen) {
-    gcry_cipher_hd_t cipher;
-    gcry_error_t rc = 0;
-
-    exsltCryptoGcryptInit ();
-
-    rc = gcry_cipher_open (&cipher, GCRY_CIPHER_ARCFOUR,
-               GCRY_CIPHER_MODE_STREAM, 0);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_open)\n",
-                gcry_strerror (rc));
-    }
-
-    rc = gcry_cipher_setkey (cipher, key, RC4_KEY_LENGTH);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_setkey)\n",
-                gcry_strerror (rc));
-    }
-
-    rc = gcry_cipher_decrypt (cipher, (unsigned char *) dest, destlen,
-                  (const unsigned char *) msg, msglen);
-    if (rc) {
-    xsltTransformError (xsltXPathGetTransformContext (ctxt), NULL,
-                NULL,
-                "exslt:crypto internal error %s (gcry_cipher_decrypt)\n",
-                gcry_strerror (rc));
-    }
-
-    gcry_cipher_close (cipher);
-}
-
-#endif /* defined(HAVE_GCRYPT) */
-
-#if defined(HAVE_CRYPTO)
-
-/**
- * exsltCryptoPopString:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Helper function which checks for and returns first string argument and its
- * length in bytes.
- */
-static int
-exsltCryptoPopString (xmlXPathParserContextPtr ctxt, int nargs,
-              xmlChar ** str) {
-
-    int str_len = 0;
-
-    if ((nargs < 1) || (nargs > 2)) {
-    xmlXPathSetArityError (ctxt);
-    return 0;
-    }
-
-    *str = xmlXPathPopString (ctxt);
-    str_len = xmlStrlen (*str);
-
-    if (str_len == 0) {
-    xmlXPathReturnEmptyString (ctxt);
-    xmlFree (*str);
-    return 0;
-    }
-
-    return str_len;
-}
-
-/**
- * exsltCryptoMd4Function:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * computes the md4 hash of a string and returns as hex
- */
-static void
-exsltCryptoMd4Function (xmlXPathParserContextPtr ctxt, int nargs) {
-
-    int str_len = 0;
-    xmlChar *str = NULL, *ret = NULL;
-    unsigned char hash[HASH_DIGEST_LENGTH];
-    unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
-
-    str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0)
-    return;
-
-    PLATFORM_HASH (ctxt, PLATFORM_MD4, (const char *) str, str_len,
-           (char *) hash);
-    exsltCryptoBin2Hex (hash, sizeof (hash) - 1, hex, sizeof (hex) - 1);
-
-    ret = xmlStrdup ((xmlChar *) hex);
-    xmlXPathReturnString (ctxt, ret);
-
-    if (str != NULL)
-    xmlFree (str);
-}
-
-/**
- * exsltCryptoMd5Function:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * computes the md5 hash of a string and returns as hex
- */
-static void
-exsltCryptoMd5Function (xmlXPathParserContextPtr ctxt, int nargs) {
-
-    int str_len = 0;
-    xmlChar *str = NULL, *ret = NULL;
-    unsigned char hash[HASH_DIGEST_LENGTH];
-    unsigned char hex[MD5_DIGEST_LENGTH * 2 + 1];
-
-    str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0)
-    return;
-
-    PLATFORM_HASH (ctxt, PLATFORM_MD5, (const char *) str, str_len,
-           (char *) hash);
-    exsltCryptoBin2Hex (hash, sizeof (hash) - 1, hex, sizeof (hex) - 1);
-
-    ret = xmlStrdup ((xmlChar *) hex);
-    xmlXPathReturnString (ctxt, ret);
-
-    if (str != NULL)
-    xmlFree (str);
-}
-
-/**
- * exsltCryptoSha1Function:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * computes the sha1 hash of a string and returns as hex
- */
-static void
-exsltCryptoSha1Function (xmlXPathParserContextPtr ctxt, int nargs) {
-
-    int str_len = 0;
-    xmlChar *str = NULL, *ret = NULL;
-    unsigned char hash[HASH_DIGEST_LENGTH];
-    unsigned char hex[SHA1_DIGEST_LENGTH * 2 + 1];
-
-    str_len = exsltCryptoPopString (ctxt, nargs, &str);
-    if (str_len == 0)
-    return;
-
-    PLATFORM_HASH (ctxt, PLATFORM_SHA1, (const char *) str, str_len,
-           (char *) hash);
-    exsltCryptoBin2Hex (hash, sizeof (hash) - 1, hex, sizeof (hex) - 1);
-
-    ret = xmlStrdup ((xmlChar *) hex);
-    xmlXPathReturnString (ctxt, ret);
-
-    if (str != NULL)
-    xmlFree (str);
-}
-
-/**
- * exsltCryptoRc4EncryptFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * computes the sha1 hash of a string and returns as hex
- */
-static void
-exsltCryptoRc4EncryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-
-    int key_len = 0;
-    int str_len = 0, bin_len = 0, hex_len = 0;
-    xmlChar *key = NULL, *str = NULL, *padkey = NULL;
-    xmlChar *bin = NULL, *hex = NULL;
-    xsltTransformContextPtr tctxt = NULL;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError (ctxt);
-    return;
-    }
-    tctxt = xsltXPathGetTransformContext(ctxt);
-
-    str = xmlXPathPopString (ctxt);
-    str_len = xmlStrlen (str);
-
-    if (str_len == 0) {
-    xmlXPathReturnEmptyString (ctxt);
-    xmlFree (str);
-    return;
-    }
-
-    key = xmlXPathPopString (ctxt);
-    key_len = xmlStrlen (key);
-
-    if (key_len == 0) {
-    xmlXPathReturnEmptyString (ctxt);
-    xmlFree (key);
-    xmlFree (str);
-    return;
-    }
-
-    padkey = xmlMallocAtomic (RC4_KEY_LENGTH + 1);
-    if (padkey == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate padkey\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    memset(padkey, 0, RC4_KEY_LENGTH + 1);
-
-    if ((key_len > RC4_KEY_LENGTH) || (key_len < 0)) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: key size too long or key broken\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    memcpy (padkey, key, key_len);
-
-/* encrypt it */
-    bin_len = str_len;
-    bin = xmlStrdup (str);
-    if (bin == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate string\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    PLATFORM_RC4_ENCRYPT (ctxt, padkey, str, str_len, bin, bin_len);
-
-/* encode it */
-    hex_len = str_len * 2 + 1;
-    hex = xmlMallocAtomic (hex_len);
-    if (hex == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate result\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-
-    exsltCryptoBin2Hex (bin, str_len, hex, hex_len);
-    xmlXPathReturnString (ctxt, hex);
-
-done:
-    if (key != NULL)
-    xmlFree (key);
-    if (str != NULL)
-    xmlFree (str);
-    if (padkey != NULL)
-    xmlFree (padkey);
-    if (bin != NULL)
-    xmlFree (bin);
-}
-
-/**
- * exsltCryptoRc4DecryptFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * computes the sha1 hash of a string and returns as hex
- */
-static void
-exsltCryptoRc4DecryptFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-
-    int key_len = 0;
-    int str_len = 0, bin_len = 0, ret_len = 0;
-    xmlChar *key = NULL, *str = NULL, *padkey = NULL, *bin =
-    NULL, *ret = NULL;
-    xsltTransformContextPtr tctxt = NULL;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError (ctxt);
-    return;
-    }
-    tctxt = xsltXPathGetTransformContext(ctxt);
-
-    str = xmlXPathPopString (ctxt);
-    str_len = xmlStrlen (str);
-
-    if (str_len == 0) {
-    xmlXPathReturnEmptyString (ctxt);
-    xmlFree (str);
-    return;
-    }
-
-    key = xmlXPathPopString (ctxt);
-    key_len = xmlStrlen (key);
-
-    if (key_len == 0) {
-    xmlXPathReturnEmptyString (ctxt);
-    xmlFree (key);
-    xmlFree (str);
-    return;
-    }
-
-    padkey = xmlMallocAtomic (RC4_KEY_LENGTH + 1);
-    if (padkey == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate padkey\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    memset(padkey, 0, RC4_KEY_LENGTH + 1);
-    if ((key_len > RC4_KEY_LENGTH) || (key_len < 0)) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: key size too long or key broken\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    memcpy (padkey, key, key_len);
-
-/* decode hex to binary */
-    bin_len = str_len;
-    bin = xmlMallocAtomic (bin_len);
-    if (bin == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate string\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    ret_len = exsltCryptoHex2Bin (str, str_len, bin, bin_len);
-
-/* decrypt the binary blob */
-    ret = xmlMallocAtomic (ret_len + 1);
-    if (ret == NULL) {
-    xsltTransformError(tctxt, NULL, tctxt->inst,
-        "exsltCryptoRc4EncryptFunction: Failed to allocate result\n");
-    tctxt->state = XSLT_STATE_STOPPED;
-    xmlXPathReturnEmptyString (ctxt);
-    goto done;
-    }
-    PLATFORM_RC4_DECRYPT (ctxt, padkey, bin, ret_len, ret, ret_len);
-    ret[ret_len] = 0;
-
-    xmlXPathReturnString (ctxt, ret);
-
-done:
-    if (key != NULL)
-    xmlFree (key);
-    if (str != NULL)
-    xmlFree (str);
-    if (padkey != NULL)
-    xmlFree (padkey);
-    if (bin != NULL)
-    xmlFree (bin);
-}
-
-/**
- * exsltCryptoRegister:
- *
- * Registers the EXSLT - Crypto module
- */
-
-void
-exsltCryptoRegister (void) {
-    xsltRegisterExtModuleFunction ((const xmlChar *) "md4",
-                   EXSLT_CRYPTO_NAMESPACE,
-                   exsltCryptoMd4Function);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "md5",
-                   EXSLT_CRYPTO_NAMESPACE,
-                   exsltCryptoMd5Function);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "sha1",
-                   EXSLT_CRYPTO_NAMESPACE,
-                   exsltCryptoSha1Function);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "rc4_encrypt",
-                   EXSLT_CRYPTO_NAMESPACE,
-                   exsltCryptoRc4EncryptFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "rc4_decrypt",
-                   EXSLT_CRYPTO_NAMESPACE,
-                   exsltCryptoRc4DecryptFunction);
-}
-
-#else
-/**
- * exsltCryptoRegister:
- *
- * Registers the EXSLT - Crypto module
- */
-void
-exsltCryptoRegister (void) {
-}
-
-#endif /* defined(HAVE_CRYPTO) */
-
-#endif /* EXSLT_CRYPTO_ENABLED */
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/date.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3957 +0,0 @@
-/*
- * date.c: Implementation of the EXSLT -- Dates and Times module
- *
- * References:
- *   http://www.exslt.org/date/date.html
- *
- * See Copyright for the status of this software.
- *
- * Authors:
- *   Charlie Bozeman <cbozeman@HiWAAY.net>
- *   Thomas Broyer <tbroyer@ltgt.net>
- *
- * TODO:
- * elements:
- *   date-format
- * functions:
- *   format-date
- *   parse-date
- *   sum
- */
-
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#if defined(HAVE_LOCALTIME_R) && defined(__GLIBC__) /* _POSIX_SOURCE required by gnu libc */
-#ifndef _AIX51      /* but on AIX we're not using gnu libc */
-#define _POSIX_SOURCE
-#endif
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-#include <string.h>
-#include <limits.h>
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-/* needed to get localtime_r on Solaris */
-#ifdef __sun
-#ifndef __EXTENSIONS__
-#define __EXTENSIONS__
-#endif
-#endif
-
-#ifdef HAVE_TIME_H
-#include <time.h>
-#endif
-
-/*
- * types of date and/or time (from schema datatypes)
- *   somewhat ordered from least specific to most specific (i.e.
- *   most truncated to least truncated).
- */
-typedef enum {
-    EXSLT_UNKNOWN  =    0,
-    XS_TIME        =    1,       /* time is left-truncated */
-    XS_GDAY        = (XS_TIME   << 1),
-    XS_GMONTH      = (XS_GDAY   << 1),
-    XS_GMONTHDAY   = (XS_GMONTH | XS_GDAY),
-    XS_GYEAR       = (XS_GMONTH << 1),
-    XS_GYEARMONTH  = (XS_GYEAR  | XS_GMONTH),
-    XS_DATE        = (XS_GYEAR  | XS_GMONTH | XS_GDAY),
-    XS_DATETIME    = (XS_DATE   | XS_TIME)
-} exsltDateType;
-
-/* Date value */
-typedef struct _exsltDateVal exsltDateVal;
-typedef exsltDateVal *exsltDateValPtr;
-struct _exsltDateVal {
-    exsltDateType   type;
-    long        year;
-    unsigned int    mon :4; /* 1 <=  mon    <= 12   */
-    unsigned int    day :5; /* 1 <=  day    <= 31   */
-    unsigned int    hour    :5; /* 0 <=  hour   <= 23   */
-    unsigned int    min :6; /* 0 <=  min    <= 59   */
-    double      sec;
-    unsigned int    tz_flag :1; /* is tzo explicitely set? */
-    signed int      tzo :12;    /* -1440 <= tzo <= 1440 currently only -840 to +840 are needed */
-};
-
-/* Duration value */
-typedef struct _exsltDateDurVal exsltDateDurVal;
-typedef exsltDateDurVal *exsltDateDurValPtr;
-struct _exsltDateDurVal {
-    long    mon;    /* mon stores years also */
-    long    day;
-    double  sec;    /* sec stores min and hour also
-               0 <= sec < SECS_PER_DAY */
-};
-
-/****************************************************************
- *                              *
- *          Compat./Port. macros            *
- *                              *
- ****************************************************************/
-
-#if defined(HAVE_TIME_H)                    \
-    && (defined(HAVE_LOCALTIME) || defined(HAVE_LOCALTIME_R))   \
-    && (defined(HAVE_GMTIME) || defined(HAVE_GMTIME_R))     \
-    && defined(HAVE_TIME)
-#define WITH_TIME
-#endif
-
-/****************************************************************
- *                              *
- *      Convenience macros and functions        *
- *                              *
- ****************************************************************/
-
-#define IS_TZO_CHAR(c)                      \
-    ((c == 0) || (c == 'Z') || (c == '+') || (c == '-'))
-
-#define VALID_ALWAYS(num)   (num >= 0)
-#define VALID_MONTH(mon)        ((mon >= 1) && (mon <= 12))
-/* VALID_DAY should only be used when month is unknown */
-#define VALID_DAY(day)          ((day >= 1) && (day <= 31))
-#define VALID_HOUR(hr)          ((hr >= 0) && (hr <= 23))
-#define VALID_MIN(min)          ((min >= 0) && (min <= 59))
-#define VALID_SEC(sec)          ((sec >= 0) && (sec < 60))
-#define VALID_TZO(tzo)          ((tzo > -1440) && (tzo < 1440))
-#define IS_LEAP(y)                      \
-    (((y & 3) == 0) && ((y % 25 != 0) || ((y & 15) == 0)))
-
-static const unsigned long daysInMonth[12] =
-    { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-static const unsigned long daysInMonthLeap[12] =
-    { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
-#define MAX_DAYINMONTH(yr,mon)                                  \
-        (IS_LEAP(yr) ? daysInMonthLeap[mon - 1] : daysInMonth[mon - 1])
-
-#define VALID_MDAY(dt)                      \
-    (IS_LEAP(dt->year) ?                        \
-        (dt->day <= daysInMonthLeap[dt->mon - 1]) :         \
-        (dt->day <= daysInMonth[dt->mon - 1]))
-
-#define VALID_DATE(dt)                      \
-    (VALID_MONTH(dt->mon) && VALID_MDAY(dt))
-
-/*
-    hour and min structure vals are unsigned, so normal macros give
-    warnings on some compilers.
-*/
-#define VALID_TIME(dt)                      \
-    ((dt->hour <=23 ) && (dt->min <= 59) &&         \
-     VALID_SEC(dt->sec) && VALID_TZO(dt->tzo))
-
-#define VALID_DATETIME(dt)                  \
-    (VALID_DATE(dt) && VALID_TIME(dt))
-
-#define SECS_PER_MIN            60
-#define MINS_PER_HOUR           60
-#define HOURS_PER_DAY           24
-#define SECS_PER_HOUR           (MINS_PER_HOUR * SECS_PER_MIN)
-#define SECS_PER_DAY            (HOURS_PER_DAY * SECS_PER_HOUR)
-#define MINS_PER_DAY            (HOURS_PER_DAY * MINS_PER_HOUR)
-#define DAYS_PER_EPOCH          (400 * 365 + 100 - 4 + 1)
-#define YEARS_PER_EPOCH         400
-
-static const unsigned long dayInYearByMonth[12] =
-    { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
-static const unsigned long dayInLeapYearByMonth[12] =
-    { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 };
-
-#define DAY_IN_YEAR(day, month, year)               \
-        ((IS_LEAP(year) ?                   \
-                dayInLeapYearByMonth[month - 1] :       \
-                dayInYearByMonth[month - 1]) + day)
-
-/**
- * _exsltDateParseGYear:
- * @dt:  pointer to a date structure
- * @str: pointer to the string to analyze
- *
- * Parses a xs:gYear without time zone and fills in the appropriate
- * field of the @dt structure. @str is updated to point just after the
- * xs:gYear. It is supposed that @dt->year is big enough to contain
- * the year.
- *
- * According to XML Schema Part 2, the year "0000" is an illegal year value
- * which probably means that the year preceding AD 1 is BC 1. Internally,
- * we allow a year 0 and adjust the value when parsing and formatting.
- *
- * Returns 0 or the error code
- */
-static int
-_exsltDateParseGYear (exsltDateValPtr dt, const xmlChar **str)
-{
-    const xmlChar *cur = *str, *firstChar;
-    int isneg = 0, digcnt = 0;
-
-    if (((*cur < '0') || (*cur > '9')) &&
-    (*cur != '-') && (*cur != '+'))
-    return -1;
-
-    if (*cur == '-') {
-    isneg = 1;
-    cur++;
-    }
-
-    firstChar = cur;
-
-    while ((*cur >= '0') && (*cur <= '9')) {
-        if (dt->year >= LONG_MAX / 10)
-            return -1;
-    dt->year = dt->year * 10 + (*cur - '0');
-    cur++;
-    digcnt++;
-    }
-
-    /* year must be at least 4 digits (CCYY); over 4
-     * digits cannot have a leading zero. */
-    if ((digcnt < 4) || ((digcnt > 4) && (*firstChar == '0')))
-    return 1;
-
-    if (dt->year == 0)
-    return 2;
-
-    /* The internal representation of negative years is continuous. */
-    if (isneg)
-    dt->year = -dt->year + 1;
-
-    *str = cur;
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed year %04ld\n", dt->year);
-#endif
-
-    return 0;
-}
-
-/**
- * FORMAT_GYEAR:
- * @yr:  the year to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @yr in xsl:gYear format. Result is appended to @cur and
- * @cur is updated to point after the xsl:gYear.
- */
-#define FORMAT_GYEAR(yr, cur)                   \
-    if (yr <= 0) {                          \
-        *cur = '-';                     \
-        cur++;                      \
-    }                           \
-    {                           \
-        long year = (yr <= 0) ? -yr + 1 : yr;               \
-        xmlChar tmp_buf[100], *tmp = tmp_buf;       \
-        /* result is in reverse-order */            \
-        while (year > 0) {                  \
-        *tmp = '0' + (xmlChar)(year % 10);      \
-        year /= 10;                 \
-        tmp++;                      \
-        }                           \
-        /* virtually adds leading zeros */          \
-        while ((tmp - tmp_buf) < 4)             \
-        *tmp++ = '0';                   \
-        /* restore the correct order */         \
-        while (tmp > tmp_buf) {             \
-        tmp--;                      \
-        *cur = *tmp;                    \
-        cur++;                      \
-        }                           \
-    }
-
-/**
- * PARSE_2_DIGITS:
- * @num:  the integer to fill in
- * @cur:  an #xmlChar *
- * @func: validation function for the number
- * @invalid: an integer
- *
- * Parses a 2-digits integer and updates @num with the value. @cur is
- * updated to point just after the integer.
- * In case of error, @invalid is set to %TRUE, values of @num and
- * @cur are undefined.
- */
-#define PARSE_2_DIGITS(num, cur, func, invalid)         \
-    if ((cur[0] < '0') || (cur[0] > '9') ||         \
-        (cur[1] < '0') || (cur[1] > '9'))           \
-        invalid = 1;                    \
-    else {                          \
-        int val;                        \
-        val = (cur[0] - '0') * 10 + (cur[1] - '0');     \
-        if (!func(val))                 \
-            invalid = 2;                    \
-        else                        \
-            num = val;                  \
-    }                           \
-    cur += 2;
-
-/**
- * FORMAT_2_DIGITS:
- * @num:  the integer to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats a 2-digits integer. Result is appended to @cur and
- * @cur is updated to point after the integer.
- */
-#define FORMAT_2_DIGITS(num, cur)               \
-    *cur = '0' + ((num / 10) % 10);             \
-    cur++;                          \
-    *cur = '0' + (num % 10);                \
-    cur++;
-
-/**
- * PARSE_FLOAT:
- * @num:  the double to fill in
- * @cur:  an #xmlChar *
- * @invalid: an integer
- *
- * Parses a float and updates @num with the value. @cur is
- * updated to point just after the float. The float must have a
- * 2-digits integer part and may or may not have a decimal part.
- * In case of error, @invalid is set to %TRUE, values of @num and
- * @cur are undefined.
- */
-#define PARSE_FLOAT(num, cur, invalid)              \
-    PARSE_2_DIGITS(num, cur, VALID_ALWAYS, invalid);    \
-    if (!invalid && (*cur == '.')) {            \
-        double mult = 1;                        \
-        cur++;                      \
-        if ((*cur < '0') || (*cur > '9'))           \
-        invalid = 1;                    \
-        while ((*cur >= '0') && (*cur <= '9')) {        \
-        mult /= 10;                 \
-        num += (*cur - '0') * mult;         \
-        cur++;                      \
-        }                           \
-    }
-
-/**
- * FORMAT_FLOAT:
- * @num:  the double to format
- * @cur: a pointer to an allocated buffer
- * @pad: a flag for padding to 2 integer digits
- *
- * Formats a float. Result is appended to @cur and @cur is updated to
- * point after the integer. If the @pad flag is non-zero, then the
- * float representation has a minimum 2-digits integer part. The
- * fractional part is formatted if @num has a fractional value.
- */
-#define FORMAT_FLOAT(num, cur, pad)             \
-    {                           \
-            xmlChar *sav, *str;                                 \
-            if ((pad) && (num < 10.0))                          \
-                *cur++ = '0';                                   \
-            str = xmlXPathCastNumberToString(num);              \
-            sav = str;                                          \
-            while (*str != 0)                                   \
-                *cur++ = *str++;                                \
-            xmlFree(sav);                                       \
-    }
-
-/**
- * _exsltDateParseGMonth:
- * @dt:  pointer to a date structure
- * @str: pointer to the string to analyze
- *
- * Parses a xs:gMonth without time zone and fills in the appropriate
- * field of the @dt structure. @str is updated to point just after the
- * xs:gMonth.
- *
- * Returns 0 or the error code
- */
-static int
-_exsltDateParseGMonth (exsltDateValPtr dt, const xmlChar **str)
-{
-    const xmlChar *cur = *str;
-    int ret = 0;
-
-    PARSE_2_DIGITS(dt->mon, cur, VALID_MONTH, ret);
-    if (ret != 0)
-    return ret;
-
-    *str = cur;
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed month %02i\n", dt->mon);
-#endif
-
-    return 0;
-}
-
-/**
- * FORMAT_GMONTH:
- * @mon:  the month to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @mon in xsl:gMonth format. Result is appended to @cur and
- * @cur is updated to point after the xsl:gMonth.
- */
-#define FORMAT_GMONTH(mon, cur)                 \
-    FORMAT_2_DIGITS(mon, cur)
-
-/**
- * _exsltDateParseGDay:
- * @dt:  pointer to a date structure
- * @str: pointer to the string to analyze
- *
- * Parses a xs:gDay without time zone and fills in the appropriate
- * field of the @dt structure. @str is updated to point just after the
- * xs:gDay.
- *
- * Returns 0 or the error code
- */
-static int
-_exsltDateParseGDay (exsltDateValPtr dt, const xmlChar **str)
-{
-    const xmlChar *cur = *str;
-    int ret = 0;
-
-    PARSE_2_DIGITS(dt->day, cur, VALID_DAY, ret);
-    if (ret != 0)
-    return ret;
-
-    *str = cur;
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed day %02i\n", dt->day);
-#endif
-
-    return 0;
-}
-
-/**
- * FORMAT_GDAY:
- * @dt:  the #exsltDateVal to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @dt in xsl:gDay format. Result is appended to @cur and
- * @cur is updated to point after the xsl:gDay.
- */
-#define FORMAT_GDAY(dt, cur)                    \
-    FORMAT_2_DIGITS(dt->day, cur)
-
-/**
- * FORMAT_DATE:
- * @dt:  the #exsltDateVal to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @dt in xsl:date format. Result is appended to @cur and
- * @cur is updated to point after the xsl:date.
- */
-#define FORMAT_DATE(dt, cur)                    \
-    FORMAT_GYEAR(dt->year, cur);                \
-    *cur = '-';                     \
-    cur++;                          \
-    FORMAT_GMONTH(dt->mon, cur);                \
-    *cur = '-';                     \
-    cur++;                          \
-    FORMAT_GDAY(dt, cur);
-
-/**
- * _exsltDateParseTime:
- * @dt:  pointer to a date structure
- * @str: pointer to the string to analyze
- *
- * Parses a xs:time without time zone and fills in the appropriate
- * fields of the @dt structure. @str is updated to point just after the
- * xs:time.
- * In case of error, values of @dt fields are undefined.
- *
- * Returns 0 or the error code
- */
-static int
-_exsltDateParseTime (exsltDateValPtr dt, const xmlChar **str)
-{
-    const xmlChar *cur = *str;
-    unsigned int hour = 0; /* use temp var in case str is not xs:time */
-    int ret = 0;
-
-    PARSE_2_DIGITS(hour, cur, VALID_HOUR, ret);
-    if (ret != 0)
-    return ret;
-
-    if (*cur != ':')
-    return 1;
-    cur++;
-
-    /* the ':' insures this string is xs:time */
-    dt->hour = hour;
-
-    PARSE_2_DIGITS(dt->min, cur, VALID_MIN, ret);
-    if (ret != 0)
-    return ret;
-
-    if (*cur != ':')
-    return 1;
-    cur++;
-
-    PARSE_FLOAT(dt->sec, cur, ret);
-    if (ret != 0)
-    return ret;
-
-    if (!VALID_TIME(dt))
-    return 2;
-
-    *str = cur;
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed time %02i:%02i:%02.f\n",
-             dt->hour, dt->min, dt->sec);
-#endif
-
-    return 0;
-}
-
-/**
- * FORMAT_TIME:
- * @dt:  the #exsltDateVal to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @dt in xsl:time format. Result is appended to @cur and
- * @cur is updated to point after the xsl:time.
- */
-#define FORMAT_TIME(dt, cur)                    \
-    FORMAT_2_DIGITS(dt->hour, cur);             \
-    *cur = ':';                     \
-    cur++;                          \
-    FORMAT_2_DIGITS(dt->min, cur);              \
-    *cur = ':';                     \
-    cur++;                          \
-    FORMAT_FLOAT(dt->sec, cur, 1);
-
-/**
- * _exsltDateParseTimeZone:
- * @dt:  pointer to a date structure
- * @str: pointer to the string to analyze
- *
- * Parses a time zone without time zone and fills in the appropriate
- * field of the @dt structure. @str is updated to point just after the
- * time zone.
- *
- * Returns 0 or the error code
- */
-static int
-_exsltDateParseTimeZone (exsltDateValPtr dt, const xmlChar **str)
-{
-    const xmlChar *cur;
-    int ret = 0;
-
-    if (str == NULL)
-    return -1;
-    cur = *str;
-    switch (*cur) {
-    case 0:
-    dt->tz_flag = 0;
-    dt->tzo = 0;
-    break;
-
-    case 'Z':
-    dt->tz_flag = 1;
-    dt->tzo = 0;
-    cur++;
-    break;
-
-    case '+':
-    case '-': {
-    int isneg = 0, tmp = 0;
-    isneg = (*cur == '-');
-
-    cur++;
-
-    PARSE_2_DIGITS(tmp, cur, VALID_HOUR, ret);
-    if (ret != 0)
-        return ret;
-
-    if (*cur != ':')
-        return 1;
-    cur++;
-
-    dt->tzo = tmp * 60;
-
-    PARSE_2_DIGITS(tmp, cur, VALID_MIN, ret);
-    if (ret != 0)
-        return ret;
-
-    dt->tzo += tmp;
-    if (isneg)
-        dt->tzo = - dt->tzo;
-
-    if (!VALID_TZO(dt->tzo))
-        return 2;
-
-    break;
-      }
-    default:
-    return 1;
-    }
-
-    *str = cur;
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed time zone offset (%s) %i\n",
-             dt->tz_flag ? "explicit" : "implicit", dt->tzo);
-#endif
-
-    return 0;
-}
-
-/**
- * FORMAT_TZ:
- * @tzo:  the timezone offset to format
- * @cur: a pointer to an allocated buffer
- *
- * Formats @tzo timezone. Result is appended to @cur and
- * @cur is updated to point after the timezone.
- */
-#define FORMAT_TZ(tzo, cur)                 \
-    if (tzo == 0) {                         \
-        *cur = 'Z';                     \
-        cur++;                      \
-    } else {                        \
-        int aTzo = (tzo < 0) ? - tzo : tzo;                 \
-        int tzHh = aTzo / 60, tzMm = aTzo % 60;     \
-        *cur = (tzo < 0) ? '-' : '+' ;          \
-        cur++;                      \
-        FORMAT_2_DIGITS(tzHh, cur);             \
-        *cur = ':';                     \
-        cur++;                      \
-        FORMAT_2_DIGITS(tzMm, cur);             \
-    }
-
-/****************************************************************
- *                              *
- *  XML Schema Dates/Times Datatypes Handling       *
- *                              *
- ****************************************************************/
-
-/**
- * exsltDateCreateDate:
- * @type:       type to create
- *
- * Creates a new #exsltDateVal, uninitialized.
- *
- * Returns the #exsltDateValPtr
- */
-static exsltDateValPtr
-exsltDateCreateDate (exsltDateType type)
-{
-    exsltDateValPtr ret;
-
-    ret = (exsltDateValPtr) xmlMalloc(sizeof(exsltDateVal));
-    if (ret == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltDateCreateDate: out of memory\n");
-    return (NULL);
-    }
-    memset (ret, 0, sizeof(exsltDateVal));
-
-    ret->mon = 1;
-    ret->day = 1;
-
-    if (type != EXSLT_UNKNOWN)
-        ret->type = type;
-
-    return ret;
-}
-
-/**
- * exsltDateFreeDate:
- * @date: an #exsltDateValPtr
- *
- * Frees up the @date
- */
-static void
-exsltDateFreeDate (exsltDateValPtr date) {
-    if (date == NULL)
-    return;
-
-    xmlFree(date);
-}
-
-/**
- * exsltDateCreateDuration:
- *
- * Creates a new #exsltDateDurVal, uninitialized.
- *
- * Returns the #exsltDateDurValPtr
- */
-static exsltDateDurValPtr
-exsltDateCreateDuration (void)
-{
-    exsltDateDurValPtr ret;
-
-    ret = (exsltDateDurValPtr) xmlMalloc(sizeof(exsltDateDurVal));
-    if (ret == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltDateCreateDuration: out of memory\n");
-    return (NULL);
-    }
-    memset (ret, 0, sizeof(exsltDateDurVal));
-
-    return ret;
-}
-
-/**
- * exsltDateFreeDuration:
- * @date: an #exsltDateDurValPtr
- *
- * Frees up the @duration
- */
-static void
-exsltDateFreeDuration (exsltDateDurValPtr duration) {
-    if (duration == NULL)
-    return;
-
-    xmlFree(duration);
-}
-
-#ifdef WITH_TIME
-/**
- * exsltDateCurrent:
- *
- * Returns the current date and time.
- */
-static exsltDateValPtr
-exsltDateCurrent (void)
-{
-    struct tm localTm, gmTm;
-#ifndef HAVE_GMTIME_R
-    struct tm *tb = NULL;
-#endif
-    time_t secs;
-    int local_s, gm_s;
-    exsltDateValPtr ret;
-#ifdef HAVE_ERRNO_H
-    char *source_date_epoch;
-#endif /* HAVE_ERRNO_H */
-    int override = 0;
-
-    ret = exsltDateCreateDate(XS_DATETIME);
-    if (ret == NULL)
-        return NULL;
-
-#ifdef HAVE_ERRNO_H
-    /*
-     * Allow the date and time to be set externally by an exported
-     * environment variable to enable reproducible builds.
-     */
-    source_date_epoch = getenv("SOURCE_DATE_EPOCH");
-    if (source_date_epoch) {
-        errno = 0;
-    secs = (time_t) strtol (source_date_epoch, NULL, 10);
-    if (errno == 0) {
-#if HAVE_GMTIME_R
-        if (gmtime_r(&secs, &localTm) != NULL)
-            override = 1;
-#else
-        tb = gmtime(&secs);
-        if (tb != NULL) {
-            localTm = *tb;
-        override = 1;
-        }
-#endif
-        }
-    }
-#endif /* HAVE_ERRNO_H */
-
-    if (override == 0) {
-    /* get current time */
-    secs    = time(NULL);
-
-#if HAVE_LOCALTIME_R
-    localtime_r(&secs, &localTm);
-#else
-    localTm = *localtime(&secs);
-#endif
-    }
-
-    /* get real year, not years since 1900 */
-    ret->year = localTm.tm_year + 1900;
-
-    ret->mon  = localTm.tm_mon + 1;
-    ret->day  = localTm.tm_mday;
-    ret->hour = localTm.tm_hour;
-    ret->min  = localTm.tm_min;
-
-    /* floating point seconds */
-    ret->sec  = (double) localTm.tm_sec;
-
-    /* determine the time zone offset from local to gm time */
-#if HAVE_GMTIME_R
-    gmtime_r(&secs, &gmTm);
-#else
-    tb = gmtime(&secs);
-    if (tb == NULL)
-        return NULL;
-    gmTm = *tb;
-#endif
-    ret->tz_flag = 0;
-#if 0
-    ret->tzo = (((ret->day * 1440) +
-                 (ret->hour * 60) +
-                  ret->min) -
-                ((gmTm.tm_mday * 1440) + (gmTm.tm_hour * 60) +
-                  gmTm.tm_min));
-#endif
-    local_s = localTm.tm_hour * SECS_PER_HOUR +
-        localTm.tm_min * SECS_PER_MIN +
-        localTm.tm_sec;
-
-    gm_s = gmTm.tm_hour * SECS_PER_HOUR +
-        gmTm.tm_min * SECS_PER_MIN +
-        gmTm.tm_sec;
-
-    if (localTm.tm_year < gmTm.tm_year) {
-    ret->tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
-    } else if (localTm.tm_year > gmTm.tm_year) {
-    ret->tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
-    } else if (localTm.tm_mon < gmTm.tm_mon) {
-    ret->tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
-    } else if (localTm.tm_mon > gmTm.tm_mon) {
-    ret->tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
-    } else if (localTm.tm_mday < gmTm.tm_mday) {
-    ret->tzo = -((SECS_PER_DAY - local_s) + gm_s)/60;
-    } else if (localTm.tm_mday > gmTm.tm_mday) {
-    ret->tzo = ((SECS_PER_DAY - gm_s) + local_s)/60;
-    } else  {
-    ret->tzo = (local_s - gm_s)/60;
-    }
-
-    return ret;
-}
-#endif
-
-/**
- * exsltDateParse:
- * @dateTime:  string to analyze
- *
- * Parses a date/time string
- *
- * Returns a newly built #exsltDateValPtr of NULL in case of error
- */
-static exsltDateValPtr
-exsltDateParse (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    int ret;
-    const xmlChar *cur = dateTime;
-
-#define RETURN_TYPE_IF_VALID(t)                 \
-    if (IS_TZO_CHAR(*cur)) {                    \
-    ret = _exsltDateParseTimeZone(dt, &cur);        \
-    if (ret == 0) {                     \
-        if (*cur != 0)                  \
-        goto error;                 \
-        dt->type = t;                   \
-        return dt;                      \
-    }                           \
-    }
-
-    if (dateTime == NULL)
-    return NULL;
-
-    if ((*cur != '-') && (*cur < '0') && (*cur > '9'))
-    return NULL;
-
-    dt = exsltDateCreateDate(EXSLT_UNKNOWN);
-    if (dt == NULL)
-    return NULL;
-
-    if ((cur[0] == '-') && (cur[1] == '-')) {
-    /*
-     * It's an incomplete date (xs:gMonthDay, xs:gMonth or
-     * xs:gDay)
-     */
-    cur += 2;
-
-    /* is it an xs:gDay? */
-    if (*cur == '-') {
-      ++cur;
-        ret = _exsltDateParseGDay(dt, &cur);
-        if (ret != 0)
-        goto error;
-
-        RETURN_TYPE_IF_VALID(XS_GDAY);
-
-        goto error;
-    }
-
-    /*
-     * it should be an xs:gMonthDay or xs:gMonth
-     */
-    ret = _exsltDateParseGMonth(dt, &cur);
-    if (ret != 0)
-        goto error;
-
-    if (*cur != '-')
-        goto error;
-    cur++;
-
-    /* is it an xs:gMonth? */
-    if (*cur == '-') {
-        cur++;
-        RETURN_TYPE_IF_VALID(XS_GMONTH);
-        goto error;
-    }
-
-    /* it should be an xs:gMonthDay */
-    ret = _exsltDateParseGDay(dt, &cur);
-    if (ret != 0)
-        goto error;
-
-    RETURN_TYPE_IF_VALID(XS_GMONTHDAY);
-
-    goto error;
-    }
-
-    /*
-     * It's a right-truncated date or an xs:time.
-     * Try to parse an xs:time then fallback on right-truncated dates.
-     */
-    if ((*cur >= '0') && (*cur <= '9')) {
-    ret = _exsltDateParseTime(dt, &cur);
-    if (ret == 0) {
-        /* it's an xs:time */
-        RETURN_TYPE_IF_VALID(XS_TIME);
-    }
-    }
-
-    /* fallback on date parsing */
-    cur = dateTime;
-
-    ret = _exsltDateParseGYear(dt, &cur);
-    if (ret != 0)
-    goto error;
-
-    /* is it an xs:gYear? */
-    RETURN_TYPE_IF_VALID(XS_GYEAR);
-
-    if (*cur != '-')
-    goto error;
-    cur++;
-
-    ret = _exsltDateParseGMonth(dt, &cur);
-    if (ret != 0)
-    goto error;
-
-    /* is it an xs:gYearMonth? */
-    RETURN_TYPE_IF_VALID(XS_GYEARMONTH);
-
-    if (*cur != '-')
-    goto error;
-    cur++;
-
-    ret = _exsltDateParseGDay(dt, &cur);
-    if ((ret != 0) || !VALID_DATE(dt))
-    goto error;
-
-    /* is it an xs:date? */
-    RETURN_TYPE_IF_VALID(XS_DATE);
-
-    if (*cur != 'T')
-    goto error;
-    cur++;
-
-    /* it should be an xs:dateTime */
-    ret = _exsltDateParseTime(dt, &cur);
-    if (ret != 0)
-    goto error;
-
-    ret = _exsltDateParseTimeZone(dt, &cur);
-    if ((ret != 0) || (*cur != 0) || !VALID_DATETIME(dt))
-    goto error;
-
-    dt->type = XS_DATETIME;
-
-    return dt;
-
-error:
-    if (dt != NULL)
-    exsltDateFreeDate(dt);
-    return NULL;
-}
-
-/**
- * exsltDateParseDuration:
- * @duration:  string to analyze
- *
- * Parses a duration string
- *
- * Returns a newly built #exsltDateDurValPtr of NULL in case of error
- */
-static exsltDateDurValPtr
-exsltDateParseDuration (const xmlChar *duration)
-{
-    const xmlChar  *cur = duration;
-    exsltDateDurValPtr dur;
-    int isneg = 0;
-    unsigned int seq = 0;
-    long days, secs = 0;
-    double sec_frac = 0.0;
-
-    if (duration == NULL)
-    return NULL;
-
-    if (*cur == '-') {
-        isneg = 1;
-        cur++;
-    }
-
-    /* duration must start with 'P' (after sign) */
-    if (*cur++ != 'P')
-    return NULL;
-
-    dur = exsltDateCreateDuration();
-    if (dur == NULL)
-    return NULL;
-
-    while (*cur != 0) {
-        long           num = 0;
-        size_t         has_digits = 0;
-        int            has_frac = 0;
-        const xmlChar  desig[] = {'Y', 'M', 'D', 'H', 'M', 'S'};
-
-        /* input string should be empty or invalid date/time item */
-        if (seq >= sizeof(desig))
-            goto error;
-
-        /* T designator must be present for time items */
-        if (*cur == 'T') {
-            if (seq > 3)
-                goto error;
-            cur++;
-            seq = 3;
-        } else if (seq == 3)
-            goto error;
-
-        /* Parse integral part. */
-        while (*cur >= '0' && *cur <= '9') {
-            long digit = *cur - '0';
-
-            if (num > LONG_MAX / 10)
-                goto error;
-            num *= 10;
-            if (num > LONG_MAX - digit)
-                goto error;
-            num += digit;
-
-            has_digits = 1;
-            cur++;
-        }
-
-        if (*cur == '.') {
-            /* Parse fractional part. */
-            double mult = 1.0;
-            cur++;
-            has_frac = 1;
-            while (*cur >= '0' && *cur <= '9') {
-                mult /= 10.0;
-                sec_frac += (*cur - '0') * mult;
-                has_digits = 1;
-                cur++;
-            }
-        }
-
-        while (*cur != desig[seq]) {
-            seq++;
-            /* No T designator or invalid char. */
-            if (seq == 3 || seq == sizeof(desig))
-                goto error;
-        }
-        cur++;
-
-        if (!has_digits || (has_frac && (seq != 5)))
-            goto error;
-
-        switch (seq) {
-            case 0:
-                /* Year */
-                if (num > LONG_MAX / 12)
-                    goto error;
-                dur->mon = num * 12;
-                break;
-            case 1:
-                /* Month */
-                if (dur->mon > LONG_MAX - num)
-                    goto error;
-                dur->mon += num;
-                break;
-            case 2:
-                /* Day */
-                dur->day = num;
-                break;
-            case 3:
-                /* Hour */
-                days = num / HOURS_PER_DAY;
-                if (dur->day > LONG_MAX - days)
-                    goto error;
-                dur->day += days;
-                secs = (num % HOURS_PER_DAY) * SECS_PER_HOUR;
-                break;
-            case 4:
-                /* Minute */
-                days = num / MINS_PER_DAY;
-                if (dur->day > LONG_MAX - days)
-                    goto error;
-                dur->day += days;
-                secs += (num % MINS_PER_DAY) * SECS_PER_MIN;
-                break;
-            case 5:
-                /* Second */
-                days = num / SECS_PER_DAY;
-                if (dur->day > LONG_MAX - days)
-                    goto error;
-                dur->day += days;
-                secs += num % SECS_PER_DAY;
-                break;
-        }
-
-        seq++;
-    }
-
-    days = secs / SECS_PER_DAY;
-    if (dur->day > LONG_MAX - days)
-        goto error;
-    dur->day += days;
-    dur->sec = (secs % SECS_PER_DAY) + sec_frac;
-
-    if (isneg) {
-        dur->mon = -dur->mon;
-        dur->day = -dur->day;
-        if (dur->sec != 0.0) {
-            dur->sec = SECS_PER_DAY - dur->sec;
-            dur->day -= 1;
-        }
-    }
-
-#ifdef DEBUG_EXSLT_DATE
-    xsltGenericDebug(xsltGenericDebugContext,
-             "Parsed duration %f\n", dur->sec);
-#endif
-
-    return dur;
-
-error:
-    if (dur != NULL)
-    exsltDateFreeDuration(dur);
-    return NULL;
-}
-
-/**
- * FORMAT_ITEM:
- * @num:        number to format
- * @cur:        current location to convert number
- * @limit:      max value
- * @item:       char designator
- *
- */
-#define FORMAT_ITEM(num, cur, limit, item)          \
-        if (num >= limit) {                 \
-            double comp = floor(num / limit);           \
-            FORMAT_FLOAT(comp, cur, 0);             \
-            *cur++ = item;                  \
-            num -= comp * limit;                \
-        }
-
-/**
- * exsltDateFormatDuration:
- * @dur: an #exsltDateDurValPtr
- *
- * Formats the duration.
- *
- * Returns a newly allocated string, or NULL in case of error
- */
-static xmlChar *
-exsltDateFormatDuration (const exsltDateDurValPtr dur)
-{
-    xmlChar buf[100], *cur = buf;
-    double secs, days;
-    double years, months;
-
-    if (dur == NULL)
-    return NULL;
-
-    /* quick and dirty check */
-    if ((dur->sec == 0.0) && (dur->day == 0) && (dur->mon == 0))
-        return xmlStrdup((xmlChar*)"P0D");
-
-    secs   = dur->sec;
-    days   = (double)dur->day;
-    years  = (double)(dur->mon / 12);
-    months = (double)(dur->mon % 12);
-
-    *cur = '\0';
-    if (days < 0) {
-        if (secs != 0.0) {
-            secs = SECS_PER_DAY - secs;
-            days += 1;
-        }
-        days = -days;
-        *cur = '-';
-    }
-    if (years < 0) {
-        years = -years;
-        *cur = '-';
-    }
-    if (months < 0) {
-        months = -months;
-        *cur = '-';
-    }
-    if (*cur == '-')
-    cur++;
-
-    *cur++ = 'P';
-
-    if (years != 0.0) {
-        FORMAT_ITEM(years, cur, 1, 'Y');
-    }
-
-    if (months != 0.0) {
-        FORMAT_ITEM(months, cur, 1, 'M');
-    }
-
-    FORMAT_ITEM(days, cur, 1, 'D');
-    if (secs > 0.0) {
-        *cur++ = 'T';
-    }
-    FORMAT_ITEM(secs, cur, SECS_PER_HOUR, 'H');
-    FORMAT_ITEM(secs, cur, SECS_PER_MIN, 'M');
-    if (secs > 0.0) {
-        FORMAT_FLOAT(secs, cur, 0);
-        *cur++ = 'S';
-    }
-
-    *cur = 0;
-
-    return xmlStrdup(buf);
-}
-
-/**
- * exsltDateFormatDateTime:
- * @dt: an #exsltDateValPtr
- *
- * Formats @dt in xs:dateTime format.
- *
- * Returns a newly allocated string, or NULL in case of error
- */
-static xmlChar *
-exsltDateFormatDateTime (const exsltDateValPtr dt)
-{
-    xmlChar buf[100], *cur = buf;
-
-    if ((dt == NULL) || !VALID_DATETIME(dt))
-    return NULL;
-
-    FORMAT_DATE(dt, cur);
-    *cur = 'T';
-    cur++;
-    FORMAT_TIME(dt, cur);
-    FORMAT_TZ(dt->tzo, cur);
-    *cur = 0;
-
-    return xmlStrdup(buf);
-}
-
-/**
- * exsltDateFormatDate:
- * @dt: an #exsltDateValPtr
- *
- * Formats @dt in xs:date format.
- *
- * Returns a newly allocated string, or NULL in case of error
- */
-static xmlChar *
-exsltDateFormatDate (const exsltDateValPtr dt)
-{
-    xmlChar buf[100], *cur = buf;
-
-    if ((dt == NULL) || !VALID_DATETIME(dt))
-    return NULL;
-
-    FORMAT_DATE(dt, cur);
-    if (dt->tz_flag || (dt->tzo != 0)) {
-    FORMAT_TZ(dt->tzo, cur);
-    }
-    *cur = 0;
-
-    return xmlStrdup(buf);
-}
-
-/**
- * exsltDateFormatTime:
- * @dt: an #exsltDateValPtr
- *
- * Formats @dt in xs:time format.
- *
- * Returns a newly allocated string, or NULL in case of error
- */
-static xmlChar *
-exsltDateFormatTime (const exsltDateValPtr dt)
-{
-    xmlChar buf[100], *cur = buf;
-
-    if ((dt == NULL) || !VALID_TIME(dt))
-    return NULL;
-
-    FORMAT_TIME(dt, cur);
-    if (dt->tz_flag || (dt->tzo != 0)) {
-    FORMAT_TZ(dt->tzo, cur);
-    }
-    *cur = 0;
-
-    return xmlStrdup(buf);
-}
-
-/**
- * exsltDateFormat:
- * @dt: an #exsltDateValPtr
- *
- * Formats @dt in the proper format.
- * Note: xs:gmonth and xs:gday are not formatted as there are no
- * routines that output them.
- *
- * Returns a newly allocated string, or NULL in case of error
- */
-static xmlChar *
-exsltDateFormat (const exsltDateValPtr dt)
-{
-
-    if (dt == NULL)
-    return NULL;
-
-    switch (dt->type) {
-    case XS_DATETIME:
-        return exsltDateFormatDateTime(dt);
-    case XS_DATE:
-        return exsltDateFormatDate(dt);
-    case XS_TIME:
-        return exsltDateFormatTime(dt);
-    default:
-        break;
-    }
-
-    if (dt->type & XS_GYEAR) {
-        xmlChar buf[100], *cur = buf;
-
-        FORMAT_GYEAR(dt->year, cur);
-        if (dt->type == XS_GYEARMONTH) {
-        *cur = '-';
-        cur++;
-        FORMAT_GMONTH(dt->mon, cur);
-        }
-
-        if (dt->tz_flag || (dt->tzo != 0)) {
-        FORMAT_TZ(dt->tzo, cur);
-        }
-        *cur = 0;
-        return xmlStrdup(buf);
-    }
-
-    return NULL;
-}
-
-/**
- * _exsltDateCastYMToDays:
- * @dt: an #exsltDateValPtr
- *
- * Convert mon and year of @dt to total number of days. Take the
- * number of years since (or before) 1 AD and add the number of leap
- * years. This is a function  because negative
- * years must be handled a little differently.
- *
- * Returns number of days.
- */
-static long
-_exsltDateCastYMToDays (const exsltDateValPtr dt)
-{
-    long ret;
-
-    if (dt->year <= 0)
-        ret = ((dt->year-1) * 365) +
-              (((dt->year)/4)-((dt->year)/100)+
-               ((dt->year)/400)) +
-              DAY_IN_YEAR(0, dt->mon, dt->year) - 1;
-    else
-        ret = ((dt->year-1) * 365) +
-              (((dt->year-1)/4)-((dt->year-1)/100)+
-               ((dt->year-1)/400)) +
-              DAY_IN_YEAR(0, dt->mon, dt->year);
-
-    return ret;
-}
-
-/**
- * TIME_TO_NUMBER:
- * @dt:  an #exsltDateValPtr
- *
- * Calculates the number of seconds in the time portion of @dt.
- *
- * Returns seconds.
- */
-#define TIME_TO_NUMBER(dt)                              \
-    ((double)((dt->hour * SECS_PER_HOUR) +   \
-              (dt->min * SECS_PER_MIN)) + dt->sec)
-
-/**
- * _exsltDateTruncateDate:
- * @dt: an #exsltDateValPtr
- * @type: dateTime type to set to
- *
- * Set @dt to truncated @type.
- *
- * Returns 0 success, non-zero otherwise.
- */
-static int
-_exsltDateTruncateDate (exsltDateValPtr dt, exsltDateType type)
-{
-    if (dt == NULL)
-        return 1;
-
-    if ((type & XS_TIME) != XS_TIME) {
-        dt->hour = 0;
-        dt->min  = 0;
-        dt->sec  = 0.0;
-    }
-
-    if ((type & XS_GDAY) != XS_GDAY)
-        dt->day = 1;
-
-    if ((type & XS_GMONTH) != XS_GMONTH)
-        dt->mon = 1;
-
-    if ((type & XS_GYEAR) != XS_GYEAR)
-        dt->year = 0;
-
-    dt->type = type;
-
-    return 0;
-}
-
-/**
- * _exsltDayInWeek:
- * @yday: year day (1-366)
- * @yr: year
- *
- * Determine the day-in-week from @yday and @yr. 0001-01-01 was
- * a Monday so all other days are calculated from there. Take the
- * number of years since (or before) add the number of leap years and
- * the day-in-year and mod by 7. This is a function  because negative
- * years must be handled a little differently.
- *
- * Returns day in week (Sunday = 0).
- */
-static long
-_exsltDateDayInWeek(long yday, long yr)
-{
-    long ret;
-
-    if (yr <= 0) {
-        ret = ((yr-2 + ((yr/4)-(yr/100)+(yr/400)) + yday) % 7);
-        if (ret < 0)
-            ret += 7;
-    } else
-        ret = (((yr-1) + (((yr-1)/4)-((yr-1)/100)+((yr-1)/400)) + yday) % 7);
-
-    return ret;
-}
-
-/**
- * _exsltDateAdd:
- * @dt: an #exsltDateValPtr
- * @dur: an #exsltDateDurValPtr
- *
- * Compute a new date/time from @dt and @dur. This function assumes @dt
- * is either #XS_DATETIME, #XS_DATE, #XS_GYEARMONTH, or #XS_GYEAR.
- *
- * Returns date/time pointer or NULL.
- */
-static exsltDateValPtr
-_exsltDateAdd (exsltDateValPtr dt, exsltDateDurValPtr dur)
-{
-    exsltDateValPtr ret;
-    long carry, temp;
-    double sum;
-
-    if ((dt == NULL) || (dur == NULL))
-        return NULL;
-
-    ret = exsltDateCreateDate(dt->type);
-    if (ret == NULL)
-        return NULL;
-
-    /*
-     * Note that temporary values may need more bits than the values in
-     * bit field.
-     */
-
-    /* month */
-    temp  = dt->mon + dur->mon % 12;
-    carry = dur->mon / 12;
-    if (temp < 1) {
-        temp  += 12;
-        carry -= 1;
-    }
-    else if (temp > 12) {
-        temp  -= 12;
-        carry += 1;
-    }
-    ret->mon = temp;
-
-    /*
-     * year (may be modified later)
-     *
-     * Add epochs from dur->day now to avoid overflow later and to speed up
-     * pathological cases.
-     */
-    carry += (dur->day / DAYS_PER_EPOCH) * YEARS_PER_EPOCH;
-    if ((carry > 0 && dt->year > LONG_MAX - carry) ||
-        (carry < 0 && dt->year < LONG_MIN - carry)) {
-        /* Overflow */
-        exsltDateFreeDate(ret);
-        return NULL;
-    }
-    ret->year = dt->year + carry;
-
-    /* time zone */
-    ret->tzo     = dt->tzo;
-    ret->tz_flag = dt->tz_flag;
-
-    /* seconds */
-    sum    = dt->sec + dur->sec;
-    ret->sec = fmod(sum, 60.0);
-    carry  = (long)(sum / 60.0);
-
-    /* minute */
-    temp  = dt->min + carry % 60;
-    carry = carry / 60;
-    if (temp >= 60) {
-        temp  -= 60;
-        carry += 1;
-    }
-    ret->min = temp;
-
-    /* hours */
-    temp  = dt->hour + carry % 24;
-    carry = carry / 24;
-    if (temp >= 24) {
-        temp  -= 24;
-        carry += 1;
-    }
-    ret->hour = temp;
-
-    /* days */
-    if (dt->day > MAX_DAYINMONTH(ret->year, ret->mon))
-        temp = MAX_DAYINMONTH(ret->year, ret->mon);
-    else if (dt->day < 1)
-        temp = 1;
-    else
-        temp = dt->day;
-
-    temp += dur->day % DAYS_PER_EPOCH + carry;
-
-    while (1) {
-        if (temp < 1) {
-            if (ret->mon > 1) {
-                ret->mon -= 1;
-            }
-            else {
-                if (ret->year == LONG_MIN) {
-                    exsltDateFreeDate(ret);
-                    return NULL;
-                }
-                ret->mon   = 12;
-                ret->year -= 1;
-            }
-            temp += MAX_DAYINMONTH(ret->year, ret->mon);
-        } else if (temp > (long)MAX_DAYINMONTH(ret->year, ret->mon)) {
-            temp -= MAX_DAYINMONTH(ret->year, ret->mon);
-            if (ret->mon < 12) {
-                ret->mon += 1;
-            }
-            else {
-                if (ret->year == LONG_MAX) {
-                    exsltDateFreeDate(ret);
-                    return NULL;
-                }
-                ret->mon   = 1;
-                ret->year += 1;
-            }
-        } else
-            break;
-    }
-
-    ret->day = temp;
-
-    /*
-     * adjust the date/time type to the date values
-     */
-    if (ret->type != XS_DATETIME) {
-        if ((ret->hour) || (ret->min) || (ret->sec))
-            ret->type = XS_DATETIME;
-        else if (ret->type != XS_DATE) {
-            if (ret->day != 1)
-                ret->type = XS_DATE;
-            else if ((ret->type != XS_GYEARMONTH) && (ret->mon != 1))
-                ret->type = XS_GYEARMONTH;
-        }
-    }
-
-    return ret;
-}
-
-/**
- * _exsltDateDifference:
- * @x: an #exsltDateValPtr
- * @y: an #exsltDateValPtr
- * @flag: force difference in days
- *
- * Calculate the difference between @x and @y as a duration
- * (i.e. y - x). If the @flag is set then even if the least specific
- * format of @x or @y is xs:gYear or xs:gYearMonth.
- *
- * Returns a duration pointer or NULL.
- */
-static exsltDateDurValPtr
-_exsltDateDifference (exsltDateValPtr x, exsltDateValPtr y, int flag)
-{
-    exsltDateDurValPtr ret;
-
-    if ((x == NULL) || (y == NULL))
-        return NULL;
-
-    if (((x->type < XS_GYEAR) || (x->type > XS_DATETIME)) ||
-        ((y->type < XS_GYEAR) || (y->type > XS_DATETIME)))
-        return NULL;
-
-    /*
-     * the operand with the most specific format must be converted to
-     * the same type as the operand with the least specific format.
-     */
-    if (x->type != y->type) {
-        if (x->type < y->type) {
-            _exsltDateTruncateDate(y, x->type);
-        } else {
-            _exsltDateTruncateDate(x, y->type);
-        }
-    }
-
-    ret = exsltDateCreateDuration();
-    if (ret == NULL)
-        return NULL;
-
-    if (((x->type == XS_GYEAR) || (x->type == XS_GYEARMONTH)) && (!flag)) {
-        /* compute the difference in months */
-        if ((x->year >= LONG_MAX / 24) || (x->year <= LONG_MIN / 24) ||
-            (y->year >= LONG_MAX / 24) || (y->year <= LONG_MIN / 24)) {
-            /* Possible overflow. */
-            exsltDateFreeDuration(ret);
-            return NULL;
-        }
-        ret->mon = (y->year - x->year) * 12 + (y->mon - x->mon);
-    } else {
-        long carry;
-
-        if ((x->year > LONG_MAX / 731) || (x->year < LONG_MIN / 731) ||
-            (y->year > LONG_MAX / 731) || (y->year < LONG_MIN / 731)) {
-            /* Possible overflow. */
-            exsltDateFreeDuration(ret);
-            return NULL;
-        }
-
-        ret->sec  = TIME_TO_NUMBER(y) - TIME_TO_NUMBER(x);
-        ret->sec += (x->tzo - y->tzo) * SECS_PER_MIN;
-        carry    = (long)floor(ret->sec / SECS_PER_DAY);
-        ret->sec  = ret->sec - carry * SECS_PER_DAY;
-
-        ret->day  = _exsltDateCastYMToDays(y) - _exsltDateCastYMToDays(x);
-        ret->day += y->day - x->day;
-        ret->day += carry;
-    }
-
-    return ret;
-}
-
-/**
- * _exsltDateAddDurCalc
- * @ret: an exsltDateDurValPtr for the return value:
- * @x: an exsltDateDurValPtr for the first operand
- * @y: an exsltDateDurValPtr for the second operand
- *
- * Add two durations, catering for possible negative values.
- * The sum is placed in @ret.
- *
- * Returns 1 for success, 0 if error detected.
- */
-static int
-_exsltDateAddDurCalc (exsltDateDurValPtr ret, exsltDateDurValPtr x,
-              exsltDateDurValPtr y)
-{
-    /* months */
-    if ((x->mon > 0 && y->mon > LONG_MAX - x->mon) ||
-        (x->mon < 0 && y->mon < LONG_MIN - x->mon)) {
-        /* Overflow */
-        return 0;
-    }
-    ret->mon = x->mon + y->mon;
-
-    /* days */
-    if ((x->day > 0 && y->day > LONG_MAX - x->day) ||
-        (x->day < 0 && y->day < LONG_MIN - x->day)) {
-        /* Overflow */
-        return 0;
-    }
-    ret->day = x->day + y->day;
-
-    /* seconds */
-    ret->sec = x->sec + y->sec;
-    if (ret->sec >= SECS_PER_DAY) {
-        if (ret->day == LONG_MAX) {
-            /* Overflow */
-            return 0;
-        }
-        ret->sec -= SECS_PER_DAY;
-        ret->day += 1;
-    }
-
-    /*
-     * are the results indeterminate? i.e. how do you subtract days from
-     * months or years?
-     */
-    if (ret->day >= 0) {
-        if (((ret->day > 0) || (ret->sec > 0)) && (ret->mon < 0))
-            return 0;
-    }
-    else {
-        if (ret->mon > 0)
-            return 0;
-    }
-    return 1;
-}
-
-/**
- * _exsltDateAddDuration:
- * @x: an #exsltDateDurValPtr
- * @y: an #exsltDateDurValPtr
- *
- * Compute a new duration from @x and @y.
- *
- * Returns a duration pointer or NULL.
- */
-static exsltDateDurValPtr
-_exsltDateAddDuration (exsltDateDurValPtr x, exsltDateDurValPtr y)
-{
-    exsltDateDurValPtr ret;
-
-    if ((x == NULL) || (y == NULL))
-        return NULL;
-
-    ret = exsltDateCreateDuration();
-    if (ret == NULL)
-        return NULL;
-
-    if (_exsltDateAddDurCalc(ret, x, y))
-        return ret;
-
-    exsltDateFreeDuration(ret);
-    return NULL;
-}
-
-/****************************************************************
- *                              *
- *      EXSLT - Dates and Times functions       *
- *                              *
- ****************************************************************/
-
-/**
- * exsltDateDateTime:
- *
- * Implements the EXSLT - Dates and Times date-time() function:
- *     string date:date-time()
- *
- * Returns the current date and time as a date/time string.
- */
-static xmlChar *
-exsltDateDateTime (void)
-{
-    xmlChar *ret = NULL;
-#ifdef WITH_TIME
-    exsltDateValPtr cur;
-
-    cur = exsltDateCurrent();
-    if (cur != NULL) {
-    ret = exsltDateFormatDateTime(cur);
-    exsltDateFreeDate(cur);
-    }
-#endif
-
-    return ret;
-}
-
-/**
- * exsltDateDate:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times date() function:
- *     string date:date (string?)
- *
- * Returns the date specified in the date/time string given as the
- * argument.  If no argument is given, then the current local
- * date/time, as returned by date:date-time is used as a default
- * argument.
- * The date/time string specified as an argument must be a string in
- * the format defined as the lexical representation of either
- * xs:dateTime or xs:date.  If the argument is not in either of these
- * formats, returns NULL.
- */
-static xmlChar *
-exsltDateDate (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt = NULL;
-    xmlChar *ret = NULL;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return NULL;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return NULL;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return NULL;
-    }
-    }
-
-    ret = exsltDateFormatDate(dt);
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateTime:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times time() function:
- *     string date:time (string?)
- *
- * Returns the time specified in the date/time string given as the
- * argument.  If no argument is given, then the current local
- * date/time, as returned by date:date-time is used as a default
- * argument.
- * The date/time string specified as an argument must be a string in
- * the format defined as the lexical representation of either
- * xs:dateTime or xs:time.  If the argument is not in either of these
- * formats, returns NULL.
- */
-static xmlChar *
-exsltDateTime (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt = NULL;
-    xmlChar *ret = NULL;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return NULL;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return NULL;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_TIME)) {
-        exsltDateFreeDate(dt);
-        return NULL;
-    }
-    }
-
-    ret = exsltDateFormatTime(dt);
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateYear:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times year() function
- *    number date:year (string?)
- * Returns the year of a date as a number.  If no argument is given,
- * then the current local date/time, as returned by date:date-time is
- * used as a default argument.
- * The date/time string specified as the first argument must be a
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gYear (CCYY)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateYear (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long year;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE) &&
-        (dt->type != XS_GYEARMONTH) && (dt->type != XS_GYEAR)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    year = dt->year;
-    if (year <= 0) year -= 1; /* Adjust for missing year 0. */
-    ret = (double) year;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateLeapYear:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times leap-year() function:
- *    boolean date:leap-yea (string?)
- * Returns true if the year given in a date is a leap year.  If no
- * argument is given, then the current local date/time, as returned by
- * date:date-time is used as a default argument.
- * The date/time string specified as the first argument must be a
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gYear (CCYY)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static xmlXPathObjectPtr
-exsltDateLeapYear (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt = NULL;
-    xmlXPathObjectPtr ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-#endif
-    } else {
-    dt = exsltDateParse(dateTime);
-    if ((dt != NULL) &&
-            (dt->type != XS_DATETIME) && (dt->type != XS_DATE) &&
-        (dt->type != XS_GYEARMONTH) && (dt->type != XS_GYEAR)) {
-        exsltDateFreeDate(dt);
-        dt = NULL;
-    }
-    }
-
-    if (dt == NULL) {
-        ret = xmlXPathNewFloat(xmlXPathNAN);
-    }
-    else {
-        ret = xmlXPathNewBoolean(IS_LEAP(dt->year));
-        exsltDateFreeDate(dt);
-    }
-
-    return ret;
-}
-
-/**
- * exsltDateMonthInYear:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times month-in-year() function:
- *    number date:month-in-year (string?)
- * Returns the month of a date as a number.  If no argument is given,
- * then the current local date/time, as returned by date:date-time is
- * used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gMonth (--MM--)
- *  - xs:gMonthDay (--MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateMonthInYear (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE) &&
-        (dt->type != XS_GYEARMONTH) && (dt->type != XS_GMONTH) &&
-        (dt->type != XS_GMONTHDAY)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = (double) dt->mon;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateMonthName:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Time month-name() function
- *    string date:month-name (string?)
- * Returns the full name of the month of a date.  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gMonth (--MM--)
- * If the date/time string is not in one of these formats, then an
- * empty string ('') is returned.
- * The result is an English month name: one of 'January', 'February',
- * 'March', 'April', 'May', 'June', 'July', 'August', 'September',
- * 'October', 'November' or 'December'.
- */
-static const xmlChar *
-exsltDateMonthName (const xmlChar *dateTime)
-{
-    static const xmlChar monthNames[13][10] = {
-        { 0 },
-    { 'J', 'a', 'n', 'u', 'a', 'r', 'y', 0 },
-    { 'F', 'e', 'b', 'r', 'u', 'a', 'r', 'y', 0 },
-    { 'M', 'a', 'r', 'c', 'h', 0 },
-    { 'A', 'p', 'r', 'i', 'l', 0 },
-    { 'M', 'a', 'y', 0 },
-    { 'J', 'u', 'n', 'e', 0 },
-    { 'J', 'u', 'l', 'y', 0 },
-    { 'A', 'u', 'g', 'u', 's', 't', 0 },
-    { 'S', 'e', 'p', 't', 'e', 'm', 'b', 'e', 'r', 0 },
-    { 'O', 'c', 't', 'o', 'b', 'e', 'r', 0 },
-    { 'N', 'o', 'v', 'e', 'm', 'b', 'e', 'r', 0 },
-    { 'D', 'e', 'c', 'e', 'm', 'b', 'e', 'r', 0 }
-    };
-    double month;
-    int index = 0;
-    month = exsltDateMonthInYear(dateTime);
-    if (!xmlXPathIsNaN(month) && (month >= 1.0) && (month <= 12.0))
-      index = (int) month;
-    return monthNames[index];
-}
-
-/**
- * exsltDateMonthAbbreviation:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Time month-abbreviation() function
- *    string date:month-abbreviation (string?)
- * Returns the abbreviation of the month of a date.  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gMonth (--MM--)
- * If the date/time string is not in one of these formats, then an
- * empty string ('') is returned.
- * The result is an English month abbreviation: one of 'Jan', 'Feb',
- * 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov' or
- * 'Dec'.
- */
-static const xmlChar *
-exsltDateMonthAbbreviation (const xmlChar *dateTime)
-{
-    static const xmlChar monthAbbreviations[13][4] = {
-        { 0 },
-    { 'J', 'a', 'n', 0 },
-    { 'F', 'e', 'b', 0 },
-    { 'M', 'a', 'r', 0 },
-    { 'A', 'p', 'r', 0 },
-    { 'M', 'a', 'y', 0 },
-    { 'J', 'u', 'n', 0 },
-    { 'J', 'u', 'l', 0 },
-    { 'A', 'u', 'g', 0 },
-    { 'S', 'e', 'p', 0 },
-    { 'O', 'c', 't', 0 },
-    { 'N', 'o', 'v', 0 },
-    { 'D', 'e', 'c', 0 }
-    };
-    double month;
-    int index = 0;
-    month = exsltDateMonthInYear(dateTime);
-    if (!xmlXPathIsNaN(month) && (month >= 1.0) && (month <= 12.0))
-      index = (int) month;
-    return monthAbbreviations[index];
-}
-
-/**
- * exsltDateWeekInYear:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times week-in-year() function
- *    number date:week-in-year (string?)
- * Returns the week of the year as a number.  If no argument is given,
- * then the current local date/time, as returned by date:date-time is
- * used as the default argument.  For the purposes of numbering,
- * counting follows ISO 8601: week 1 in a year is the week containing
- * the first Thursday of the year, with new weeks beginning on a
- * Monday.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of
- * xs:dateTime in one of the formats defined in [XML Schema Part 2:
- * Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateWeekInYear (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long diy, diw, year, ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    diy = DAY_IN_YEAR(dt->day, dt->mon, dt->year);
-
-    /*
-     * Determine day-in-week (0=Sun, 1=Mon, etc.) then adjust so Monday
-     * is the first day-in-week
-     */
-    diw = (_exsltDateDayInWeek(diy, dt->year) + 6) % 7;
-
-    /* ISO 8601 adjustment, 3 is Thu */
-    diy += (3 - diw);
-    if(diy < 1) {
-    year = dt->year - 1;
-    if(year == 0) year--;
-    diy = DAY_IN_YEAR(31, 12, year) + diy;
-    } else if (diy > (long)DAY_IN_YEAR(31, 12, dt->year)) {
-    diy -= DAY_IN_YEAR(31, 12, dt->year);
-    }
-
-    ret = ((diy - 1) / 7) + 1;
-
-    exsltDateFreeDate(dt);
-
-    return (double) ret;
-}
-
-/**
- * exsltDateWeekInMonth:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times week-in-month() function
- *    number date:week-in-month (string?)
- * The date:week-in-month function returns the week in a month of a
- * date as a number. If no argument is given, then the current local
- * date/time, as returned by date:date-time is used the default
- * argument. For the purposes of numbering, the first day of the month
- * is in week 1 and new weeks begin on a Monday (so the first and last
- * weeks in a month will often have less than 7 days in them).
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of
- * xs:dateTime in one of the formats defined in [XML Schema Part 2:
- * Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateWeekInMonth (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long fdiy, fdiw, ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    fdiy = DAY_IN_YEAR(1, dt->mon, dt->year);
-    /*
-     * Determine day-in-week (0=Sun, 1=Mon, etc.) then adjust so Monday
-     * is the first day-in-week
-     */
-    fdiw = (_exsltDateDayInWeek(fdiy, dt->year) + 6) % 7;
-
-    ret = ((dt->day + fdiw - 1) / 7) + 1;
-
-    exsltDateFreeDate(dt);
-
-    return (double) ret;
-}
-
-/**
- * exsltDateDayInYear:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-in-year() function
- *    number date:day-in-year (string?)
- * Returns the day of a date in a year as a number.  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of
- * xs:dateTime in one of the formats defined in [XML Schema Part 2:
- * Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateDayInYear (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = DAY_IN_YEAR(dt->day, dt->mon, dt->year);
-
-    exsltDateFreeDate(dt);
-
-    return (double) ret;
-}
-
-/**
- * exsltDateDayInMonth:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-in-month() function:
- *    number date:day-in-month (string?)
- * Returns the day of a date as a number.  If no argument is given,
- * then the current local date/time, as returned by date:date-time is
- * used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gMonthDay (--MM-DD)
- *  - xs:gDay (---DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateDayInMonth (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE) &&
-        (dt->type != XS_GMONTHDAY) && (dt->type != XS_GDAY)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = (double) dt->day;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateDayOfWeekInMonth:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-of-week-in-month() function:
- *    number date:day-of-week-in-month (string?)
- * Returns the day-of-the-week in a month of a date as a number
- * (e.g. 3 for the 3rd Tuesday in May).  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a right-truncated
- * string in the format defined as the lexical representation of
- * xs:dateTime in one of the formats defined in [XML Schema Part 2:
- * Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateDayOfWeekInMonth (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = ((dt->day -1) / 7) + 1;
-
-    exsltDateFreeDate(dt);
-
-    return (double) ret;
-}
-
-/**
- * exsltDateDayInWeek:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-in-week() function:
- *    number date:day-in-week (string?)
- * Returns the day of the week given in a date as a number.  If no
- * argument is given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- * The numbering of days of the week starts at 1 for Sunday, 2 for
- * Monday and so on up to 7 for Saturday.
- */
-static double
-exsltDateDayInWeek (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    long diy, ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_DATE)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    diy = DAY_IN_YEAR(dt->day, dt->mon, dt->year);
-
-    ret = _exsltDateDayInWeek(diy, dt->year) + 1;
-
-    exsltDateFreeDate(dt);
-
-    return (double) ret;
-}
-
-/**
- * exsltDateDayName:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Time day-name() function
- *    string date:day-name (string?)
- * Returns the full name of the day of the week of a date.  If no
- * argument is given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then an
- * empty string ('') is returned.
- * The result is an English day name: one of 'Sunday', 'Monday',
- * 'Tuesday', 'Wednesday', 'Thursday' or 'Friday'.
- */
-static const xmlChar *
-exsltDateDayName (const xmlChar *dateTime)
-{
-    static const xmlChar dayNames[8][10] = {
-        { 0 },
-    { 'S', 'u', 'n', 'd', 'a', 'y', 0 },
-    { 'M', 'o', 'n', 'd', 'a', 'y', 0 },
-    { 'T', 'u', 'e', 's', 'd', 'a', 'y', 0 },
-    { 'W', 'e', 'd', 'n', 'e', 's', 'd', 'a', 'y', 0 },
-    { 'T', 'h', 'u', 'r', 's', 'd', 'a', 'y', 0 },
-    { 'F', 'r', 'i', 'd', 'a', 'y', 0 },
-    { 'S', 'a', 't', 'u', 'r', 'd', 'a', 'y', 0 }
-    };
-    double day;
-    int index = 0;
-    day = exsltDateDayInWeek(dateTime);
-    if(!xmlXPathIsNaN(day) && (day >= 1.0) && (day <= 7.0))
-      index = (int) day;
-    return dayNames[index];
-}
-
-/**
- * exsltDateDayAbbreviation:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Time day-abbreviation() function
- *    string date:day-abbreviation (string?)
- * Returns the abbreviation of the day of the week of a date.  If no
- * argument is given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- * If the date/time string is not in one of these formats, then an
- * empty string ('') is returned.
- * The result is a three-letter English day abbreviation: one of
- * 'Sun', 'Mon', 'Tue', 'Wed', 'Thu' or 'Fri'.
- */
-static const xmlChar *
-exsltDateDayAbbreviation (const xmlChar *dateTime)
-{
-    static const xmlChar dayAbbreviations[8][4] = {
-        { 0 },
-    { 'S', 'u', 'n', 0 },
-    { 'M', 'o', 'n', 0 },
-    { 'T', 'u', 'e', 0 },
-    { 'W', 'e', 'd', 0 },
-    { 'T', 'h', 'u', 0 },
-    { 'F', 'r', 'i', 0 },
-    { 'S', 'a', 't', 0 }
-    };
-    double day;
-    int index = 0;
-    day = exsltDateDayInWeek(dateTime);
-    if(!xmlXPathIsNaN(day) && (day >= 1.0) && (day <= 7.0))
-      index = (int) day;
-    return dayAbbreviations[index];
-}
-
-/**
- * exsltDateHourInDay:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-in-month() function:
- *    number date:day-in-month (string?)
- * Returns the hour of the day as a number.  If no argument is given,
- * then the current local date/time, as returned by date:date-time is
- * used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateHourInDay (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_TIME)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = (double) dt->hour;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateMinuteInHour:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times day-in-month() function:
- *    number date:day-in-month (string?)
- * Returns the minute of the hour as a number.  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- */
-static double
-exsltDateMinuteInHour (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_TIME)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = (double) dt->min;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateSecondInMinute:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times second-in-minute() function:
- *    number date:day-in-month (string?)
- * Returns the second of the minute as a number.  If no argument is
- * given, then the current local date/time, as returned by
- * date:date-time is used the default argument.
- * The date/time string specified as the argument is a left or
- * right-truncated string in the format defined as the lexical
- * representation of xs:dateTime in one of the formats defined in [XML
- * Schema Part 2: Datatypes].  The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:time (hh:mm:ss)
- * If the date/time string is not in one of these formats, then NaN is
- * returned.
- *
- * Returns the second or NaN.
- */
-static double
-exsltDateSecondInMinute (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    double ret;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-    dt = exsltDateParse(dateTime);
-    if (dt == NULL)
-        return xmlXPathNAN;
-    if ((dt->type != XS_DATETIME) && (dt->type != XS_TIME)) {
-        exsltDateFreeDate(dt);
-        return xmlXPathNAN;
-    }
-    }
-
-    ret = dt->sec;
-    exsltDateFreeDate(dt);
-
-    return ret;
-}
-
-/**
- * exsltDateAdd:
- * @xstr: date/time string
- * @ystr: date/time string
- *
- * Implements the date:add (string,string) function which returns the
- * date/time * resulting from adding a duration to a date/time.
- * The first argument (@xstr) must be right-truncated date/time
- * strings in one of the formats defined in [XML Schema Part 2:
- * Datatypes]. The permitted formats are as follows:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gYear (CCYY)
- * The second argument (@ystr) is a string in the format defined for
- * xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
- * The return value is a right-truncated date/time strings in one of
- * the formats defined in [XML Schema Part 2: Datatypes] and listed
- * above. This value is calculated using the algorithm described in
- * [Appendix E Adding durations to dateTimes] of [XML Schema Part 2:
- * Datatypes].
-
- * Returns date/time string or NULL.
- */
-static xmlChar *
-exsltDateAdd (const xmlChar *xstr, const xmlChar *ystr)
-{
-    exsltDateValPtr dt, res;
-    exsltDateDurValPtr dur;
-    xmlChar     *ret;
-
-    if ((xstr == NULL) || (ystr == NULL))
-        return NULL;
-
-    dt = exsltDateParse(xstr);
-    if (dt == NULL)
-        return NULL;
-    else if ((dt->type < XS_GYEAR) || (dt->type > XS_DATETIME)) {
-        exsltDateFreeDate(dt);
-        return NULL;
-    }
-
-    dur = exsltDateParseDuration(ystr);
-    if (dur == NULL) {
-        exsltDateFreeDate(dt);
-        return NULL;
-    }
-
-    res = _exsltDateAdd(dt, dur);
-
-    exsltDateFreeDate(dt);
-    exsltDateFreeDuration(dur);
-
-    if (res == NULL)
-        return NULL;
-
-    ret = exsltDateFormat(res);
-    exsltDateFreeDate(res);
-
-    return ret;
-}
-
-/**
- * exsltDateAddDuration:
- * @xstr:      first duration string
- * @ystr:      second duration string
- *
- * Implements the date:add-duration (string,string) function which returns
- * the duration resulting from adding two durations together.
- * Both arguments are strings in the format defined for xs:duration
- * in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. If either
- * argument is not in this format, the function returns an empty string
- * ('').
- * The return value is a string in the format defined for xs:duration
- * in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
- * The durations can usually be added by summing the numbers given for
- * each of the components in the durations. However, if the durations
- * are differently signed, then this sometimes results in durations
- * that are impossible to express in this syntax (e.g. 'P1M' + '-P1D').
- * In these cases, the function returns an empty string ('').
- *
- * Returns duration string or NULL.
- */
-static xmlChar *
-exsltDateAddDuration (const xmlChar *xstr, const xmlChar *ystr)
-{
-    exsltDateDurValPtr x, y, res;
-    xmlChar     *ret;
-
-    if ((xstr == NULL) || (ystr == NULL))
-        return NULL;
-
-    x = exsltDateParseDuration(xstr);
-    if (x == NULL)
-        return NULL;
-
-    y = exsltDateParseDuration(ystr);
-    if (y == NULL) {
-        exsltDateFreeDuration(x);
-        return NULL;
-    }
-
-    res = _exsltDateAddDuration(x, y);
-
-    exsltDateFreeDuration(x);
-    exsltDateFreeDuration(y);
-
-    if (res == NULL)
-        return NULL;
-
-    ret = exsltDateFormatDuration(res);
-    exsltDateFreeDuration(res);
-
-    return ret;
-}
-
-/**
- * exsltDateSumFunction:
- * @ns:      a node set of duration strings
- *
- * The date:sum function adds a set of durations together.
- * The string values of the nodes in the node set passed as an argument
- * are interpreted as durations and added together as if using the
- * date:add-duration function. (from exslt.org)
- *
- * The return value is a string in the format defined for xs:duration
- * in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
- * The durations can usually be added by summing the numbers given for
- * each of the components in the durations. However, if the durations
- * are differently signed, then this sometimes results in durations
- * that are impossible to express in this syntax (e.g. 'P1M' + '-P1D').
- * In these cases, the function returns an empty string ('').
- *
- * Returns duration string or NULL.
- */
-static void
-exsltDateSumFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlNodeSetPtr ns;
-    void *user = NULL;
-    xmlChar *tmp;
-    exsltDateDurValPtr x, total;
-    xmlChar *ret;
-    int i;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError (ctxt);
-    return;
-    }
-
-    /* We need to delay the freeing of value->user */
-    if ((ctxt->value != NULL) && ctxt->value->boolval != 0) {
-    user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = NULL;
-    }
-
-    ns = xmlXPathPopNodeSet (ctxt);
-    if (xmlXPathCheckError (ctxt))
-    return;
-
-    if ((ns == NULL) || (ns->nodeNr == 0)) {
-    xmlXPathReturnEmptyString (ctxt);
-    if (ns != NULL)
-        xmlXPathFreeNodeSet (ns);
-    return;
-    }
-
-    total = exsltDateCreateDuration ();
-    if (total == NULL) {
-        xmlXPathFreeNodeSet (ns);
-        return;
-    }
-
-    for (i = 0; i < ns->nodeNr; i++) {
-    int result;
-    tmp = xmlXPathCastNodeToString (ns->nodeTab[i]);
-    if (tmp == NULL) {
-        xmlXPathFreeNodeSet (ns);
-        exsltDateFreeDuration (total);
-        return;
-    }
-
-    x = exsltDateParseDuration (tmp);
-    if (x == NULL) {
-        xmlFree (tmp);
-        exsltDateFreeDuration (total);
-        xmlXPathFreeNodeSet (ns);
-        xmlXPathReturnEmptyString (ctxt);
-        return;
-    }
-
-    result = _exsltDateAddDurCalc(total, total, x);
-
-    exsltDateFreeDuration (x);
-    xmlFree (tmp);
-    if (!result) {
-        exsltDateFreeDuration (total);
-        xmlXPathFreeNodeSet (ns);
-        xmlXPathReturnEmptyString (ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateFormatDuration (total);
-    exsltDateFreeDuration (total);
-
-    xmlXPathFreeNodeSet (ns);
-    if (user != NULL)
-    xmlFreeNodeList ((xmlNodePtr) user);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString (ctxt);
-    else
-    xmlXPathReturnString (ctxt, ret);
-}
-
-/**
- * exsltDateSeconds:
- * @dateTime: a date/time string
- *
- * Implements the EXSLT - Dates and Times seconds() function:
- *    number date:seconds(string?)
- * The date:seconds function returns the number of seconds specified
- * by the argument string. If no argument is given, then the current
- * local date/time, as returned by exsltDateCurrent() is used as the
- * default argument. If the date/time string is a xs:duration, then the
- * years and months must be zero (or not present). Parsing a duration
- * converts the fields to seconds. If the date/time string is not a
- * duration (and not null), then the legal formats are:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date     (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gYear      (CCYY)
- * In these cases the difference between the @dateTime and
- * 1970-01-01T00:00:00Z is calculated and converted to seconds.
- *
- * Note that there was some confusion over whether "difference" meant
- * that a dateTime of 1970-01-01T00:00:01Z should be a positive one or
- * a negative one.  After correspondence with exslt.org, it was determined
- * that the intent of the specification was to have it positive.  The
- * coding was modified in July 2003 to reflect this.
- *
- * Returns seconds or Nan.
- */
-static double
-exsltDateSeconds (const xmlChar *dateTime)
-{
-    exsltDateValPtr dt;
-    exsltDateDurValPtr dur = NULL;
-    double ret = xmlXPathNAN;
-
-    if (dateTime == NULL) {
-#ifdef WITH_TIME
-    dt = exsltDateCurrent();
-    if (dt == NULL)
-#endif
-        return xmlXPathNAN;
-    } else {
-        dt = exsltDateParse(dateTime);
-        if (dt == NULL)
-            dur = exsltDateParseDuration(dateTime);
-    }
-
-    if ((dt != NULL) && (dt->type >= XS_GYEAR)) {
-        exsltDateValPtr y;
-        exsltDateDurValPtr diff;
-
-        /*
-         * compute the difference between the given (or current) date
-         * and epoch date
-         */
-        y = exsltDateCreateDate(XS_DATETIME);
-        if (y != NULL) {
-            y->year = 1970;
-            y->mon  = 1;
-            y->day  = 1;
-            y->tz_flag = 1;
-
-            diff = _exsltDateDifference(y, dt, 1);
-            if (diff != NULL) {
-                ret = (double)diff->day * SECS_PER_DAY + diff->sec;
-                exsltDateFreeDuration(diff);
-            }
-            exsltDateFreeDate(y);
-        }
-
-    } else if ((dur != NULL) && (dur->mon == 0)) {
-        ret = (double)dur->day * SECS_PER_DAY + dur->sec;
-    }
-
-    if (dt != NULL)
-        exsltDateFreeDate(dt);
-    if (dur != NULL)
-        exsltDateFreeDuration(dur);
-
-    return ret;
-}
-
-/**
- * exsltDateDifference:
- * @xstr: date/time string
- * @ystr: date/time string
- *
- * Implements the date:difference (string,string) function which returns
- * the duration between the first date and the second date. If the first
- * date occurs before the second date, then the result is a positive
- * duration; if it occurs after the second date, the result is a
- * negative duration.  The two dates must both be right-truncated
- * date/time strings in one of the formats defined in [XML Schema Part
- * 2: Datatypes]. The date/time with the most specific format (i.e. the
- * least truncation) is converted into the same format as the date with
- * the least specific format (i.e. the most truncation). The permitted
- * formats are as follows, from most specific to least specific:
- *  - xs:dateTime (CCYY-MM-DDThh:mm:ss)
- *  - xs:date (CCYY-MM-DD)
- *  - xs:gYearMonth (CCYY-MM)
- *  - xs:gYear (CCYY)
- * If either of the arguments is not in one of these formats,
- * date:difference returns the empty string ('').
- * The difference between the date/times is returned as a string in the
- * format defined for xs:duration in [3.2.6 duration] of [XML Schema
- * Part 2: Datatypes].
- * If the date/time string with the least specific format is in either
- * xs:gYearMonth or xs:gYear format, then the number of days, hours,
- * minutes and seconds in the duration string must be equal to zero.
- * (The format of the string will be PnYnM.) The number of months
- * specified in the duration must be less than 12.
- * Otherwise, the number of years and months in the duration string
- * must be equal to zero. (The format of the string will be
- * PnDTnHnMnS.) The number of seconds specified in the duration string
- * must be less than 60; the number of minutes must be less than 60;
- * the number of hours must be less than 24.
- *
- * Returns duration string or NULL.
- */
-static xmlChar *
-exsltDateDifference (const xmlChar *xstr, const xmlChar *ystr)
-{
-    exsltDateValPtr x, y;
-    exsltDateDurValPtr dur;
-    xmlChar *ret = NULL;
-
-    if ((xstr == NULL) || (ystr == NULL))
-        return NULL;
-
-    x = exsltDateParse(xstr);
-    if (x == NULL)
-        return NULL;
-
-    y = exsltDateParse(ystr);
-    if (y == NULL) {
-        exsltDateFreeDate(x);
-        return NULL;
-    }
-
-    if (((x->type < XS_GYEAR) || (x->type > XS_DATETIME)) ||
-        ((y->type < XS_GYEAR) || (y->type > XS_DATETIME)))  {
-    exsltDateFreeDate(x);
-    exsltDateFreeDate(y);
-        return NULL;
-    }
-
-    dur = _exsltDateDifference(x, y, 0);
-
-    exsltDateFreeDate(x);
-    exsltDateFreeDate(y);
-
-    if (dur == NULL)
-        return NULL;
-
-    ret = exsltDateFormatDuration(dur);
-    exsltDateFreeDuration(dur);
-
-    return ret;
-}
-
-/**
- * exsltDateDuration:
- * @number: a xmlChar string
- *
- * Implements the The date:duration function returns a duration string
- * representing the number of seconds specified by the argument string.
- * If no argument is given, then the result of calling date:seconds
- * without any arguments is used as a default argument.
- * The duration is returned as a string in the format defined for
- * xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
- * The number of years and months in the duration string must be equal
- * to zero. (The format of the string will be PnDTnHnMnS.) The number
- * of seconds specified in the duration string must be less than 60;
- * the number of minutes must be less than 60; the number of hours must
- * be less than 24.
- * If the argument is Infinity, -Infinity or NaN, then date:duration
- * returns an empty string ('').
- *
- * Returns duration string or NULL.
- */
-static xmlChar *
-exsltDateDuration (const xmlChar *number)
-{
-    exsltDateDurValPtr dur;
-    double       secs, days;
-    xmlChar     *ret;
-
-    if (number == NULL)
-        secs = exsltDateSeconds(number);
-    else
-        secs = xmlXPathCastStringToNumber(number);
-
-    if ((xmlXPathIsNaN(secs)) || (xmlXPathIsInf(secs)))
-        return NULL;
-
-    dur = exsltDateCreateDuration();
-    if (dur == NULL)
-        return NULL;
-
-    days = floor(secs / SECS_PER_DAY);
-    dur->day = (long)days;
-    dur->sec = secs - days * SECS_PER_DAY;
-
-    ret = exsltDateFormatDuration(dur);
-    exsltDateFreeDuration(dur);
-
-    return ret;
-}
-
-/****************************************************************
- *                              *
- *      Wrappers for use by the XPath engine        *
- *                              *
- ****************************************************************/
-
-#ifdef WITH_TIME
-/**
- * exsltDateDateTimeFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDateTime() for use by the XPath engine.
- */
-static void
-exsltDateDateTimeFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret;
-
-    if (nargs != 0) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    ret = exsltDateDateTime();
-    if (ret == NULL)
-        xmlXPathReturnEmptyString(ctxt);
-    else
-        xmlXPathReturnString(ctxt, ret);
-}
-#endif
-
-/**
- * exsltDateDateFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDate() for use by the XPath engine.
- */
-static void
-exsltDateDateFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret, *dt = NULL;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateDate(dt);
-
-    if (ret == NULL) {
-    xsltGenericDebug(xsltGenericDebugContext,
-             "{http://exslt.org/dates-and-times}date: "
-             "invalid date or format %s\n", dt);
-    xmlXPathReturnEmptyString(ctxt);
-    } else {
-    xmlXPathReturnString(ctxt, ret);
-    }
-
-    if (dt != NULL)
-    xmlFree(dt);
-}
-
-/**
- * exsltDateTimeFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateTime() for use by the XPath engine.
- */
-static void
-exsltDateTimeFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret, *dt = NULL;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateTime(dt);
-
-    if (ret == NULL) {
-    xsltGenericDebug(xsltGenericDebugContext,
-             "{http://exslt.org/dates-and-times}time: "
-             "invalid date or format %s\n", dt);
-    xmlXPathReturnEmptyString(ctxt);
-    } else {
-    xmlXPathReturnString(ctxt, ret);
-    }
-
-    if (dt != NULL)
-    xmlFree(dt);
-}
-
-/**
- * exsltDateYearFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateYear() for use by the XPath engine.
- */
-static void
-exsltDateYearFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    double ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateYear(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltDateLeapYearFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateLeapYear() for use by the XPath engine.
- */
-static void
-exsltDateLeapYearFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    xmlXPathObjectPtr ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateLeapYear(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    valuePush(ctxt, ret);
-}
-
-#define X_IN_Y(x, y)                        \
-static void                         \
-exsltDate##x##In##y##Function (xmlXPathParserContextPtr ctxt,   \
-                  int nargs) {          \
-    xmlChar *dt = NULL;                     \
-    double ret;                         \
-                                \
-    if ((nargs < 0) || (nargs > 1)) {               \
-    xmlXPathSetArityError(ctxt);                \
-    return;                         \
-    }                               \
-                                \
-    if (nargs == 1) {                       \
-    dt = xmlXPathPopString(ctxt);               \
-    if (xmlXPathCheckError(ctxt)) {             \
-        xmlXPathSetTypeError(ctxt);             \
-        return;                     \
-    }                           \
-    }                               \
-                                \
-    ret = exsltDate##x##In##y(dt);              \
-                                \
-    if (dt != NULL)                     \
-    xmlFree(dt);                        \
-                                \
-    xmlXPathReturnNumber(ctxt, ret);                \
-}
-
-/**
- * exsltDateMonthInYearFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateMonthInYear() for use by the XPath engine.
- */
-X_IN_Y(Month,Year)
-
-/**
- * exsltDateMonthNameFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateMonthName() for use by the XPath engine.
- */
-static void
-exsltDateMonthNameFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    const xmlChar *ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateMonthName(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, xmlStrdup(ret));
-}
-
-/**
- * exsltDateMonthAbbreviationFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateMonthAbbreviation() for use by the XPath engine.
- */
-static void
-exsltDateMonthAbbreviationFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    const xmlChar *ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateMonthAbbreviation(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, xmlStrdup(ret));
-}
-
-/**
- * exsltDateWeekInYearFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateWeekInYear() for use by the XPath engine.
- */
-X_IN_Y(Week,Year)
-
-/**
- * exsltDateWeekInMonthFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateWeekInMonthYear() for use by the XPath engine.
- */
-X_IN_Y(Week,Month)
-
-/**
- * exsltDateDayInYearFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDayInYear() for use by the XPath engine.
- */
-X_IN_Y(Day,Year)
-
-/**
- * exsltDateDayInMonthFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDayInMonth() for use by the XPath engine.
- */
-X_IN_Y(Day,Month)
-
-/**
- * exsltDateDayOfWeekInMonthFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDayOfWeekInMonth() for use by the XPath engine.
- */
-X_IN_Y(DayOfWeek,Month)
-
-/**
- * exsltDateDayInWeekFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDayInWeek() for use by the XPath engine.
- */
-X_IN_Y(Day,Week)
-
-/**
- * exsltDateDayNameFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDayName() for use by the XPath engine.
- */
-static void
-exsltDateDayNameFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    const xmlChar *ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateDayName(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, xmlStrdup(ret));
-}
-
-/**
- * exsltDateMonthDayFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDayAbbreviation() for use by the XPath engine.
- */
-static void
-exsltDateDayAbbreviationFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *dt = NULL;
-    const xmlChar *ret;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    dt = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateDayAbbreviation(dt);
-
-    if (dt != NULL)
-    xmlFree(dt);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, xmlStrdup(ret));
-}
-
-
-/**
- * exsltDateHourInDayFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateHourInDay() for use by the XPath engine.
- */
-X_IN_Y(Hour,Day)
-
-/**
- * exsltDateMinuteInHourFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateMinuteInHour() for use by the XPath engine.
- */
-X_IN_Y(Minute,Hour)
-
-/**
- * exsltDateSecondInMinuteFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateSecondInMinute() for use by the XPath engine.
- */
-X_IN_Y(Second,Minute)
-
-/**
- * exsltDateSecondsFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateSeconds() for use by the XPath engine.
- */
-static void
-exsltDateSecondsFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *str = NULL;
-    double   ret;
-
-    if (nargs > 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    str = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateSeconds(str);
-    if (str != NULL)
-    xmlFree(str);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltDateAddFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps exsltDateAdd() for use by the XPath processor.
- */
-static void
-exsltDateAddFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret, *xstr, *ystr;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ystr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    xstr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlFree(ystr);
-    return;
-    }
-
-    ret = exsltDateAdd(xstr, ystr);
-
-    xmlFree(ystr);
-    xmlFree(xstr);
-
-    if (ret == NULL)
-        xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, ret);
-}
-
-/**
- * exsltDateAddDurationFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps exsltDateAddDuration() for use by the XPath processor.
- */
-static void
-exsltDateAddDurationFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret, *xstr, *ystr;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ystr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    xstr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlFree(ystr);
-    return;
-    }
-
-    ret = exsltDateAddDuration(xstr, ystr);
-
-    xmlFree(ystr);
-    xmlFree(xstr);
-
-    if (ret == NULL)
-        xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, ret);
-}
-
-/**
- * exsltDateDifferenceFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps exsltDateDifference() for use by the XPath processor.
- */
-static void
-exsltDateDifferenceFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret, *xstr, *ystr;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ystr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    xstr = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlFree(ystr);
-    return;
-    }
-
-    ret = exsltDateDifference(xstr, ystr);
-
-    xmlFree(ystr);
-    xmlFree(xstr);
-
-    if (ret == NULL)
-        xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, ret);
-}
-
-/**
- * exsltDateDurationFunction:
- * @ctxt: an XPath parser context
- * @nargs : the number of arguments
- *
- * Wraps exsltDateDuration() for use by the XPath engine
- */
-static void
-exsltDateDurationFunction (xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *ret;
-    xmlChar *number = NULL;
-
-    if ((nargs < 0) || (nargs > 1)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 1) {
-    number = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathSetTypeError(ctxt);
-        return;
-    }
-    }
-
-    ret = exsltDateDuration(number);
-
-    if (number != NULL)
-    xmlFree(number);
-
-    if (ret == NULL)
-    xmlXPathReturnEmptyString(ctxt);
-    else
-    xmlXPathReturnString(ctxt, ret);
-}
-
-/**
- * exsltDateRegister:
- *
- * Registers the EXSLT - Dates and Times module
- */
-void
-exsltDateRegister (void)
-{
-    xsltRegisterExtModuleFunction ((const xmlChar *) "add",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateAddFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "add-duration",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateAddDurationFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "date",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDateFunction);
-#ifdef WITH_TIME
-    xsltRegisterExtModuleFunction ((const xmlChar *) "date-time",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDateTimeFunction);
-#endif
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-abbreviation",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayAbbreviationFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-in-month",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayInMonthFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-in-week",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayInWeekFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-in-year",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayInYearFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-name",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayNameFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "day-of-week-in-month",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDayOfWeekInMonthFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "difference",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDifferenceFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "duration",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateDurationFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "hour-in-day",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateHourInDayFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "leap-year",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateLeapYearFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "minute-in-hour",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateMinuteInHourFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "month-abbreviation",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateMonthAbbreviationFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "month-in-year",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateMonthInYearFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "month-name",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateMonthNameFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "second-in-minute",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateSecondInMinuteFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "seconds",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateSecondsFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "sum",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateSumFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "time",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateTimeFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "week-in-month",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateWeekInMonthFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "week-in-year",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateWeekInYearFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "year",
-                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                   exsltDateYearFunction);
-}
-
-/**
- * exsltDateXpathCtxtRegister:
- *
- * Registers the EXSLT - Dates and Times module for use outside XSLT
- */
-int
-exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
-{
-    if (ctxt
-        && prefix
-        && !xmlXPathRegisterNs(ctxt,
-                               prefix,
-                               (const xmlChar *) EXSLT_DATE_NAMESPACE)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "add",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateAddFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "add-duration",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateAddDurationFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "date",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDateFunction)
-#ifdef WITH_TIME
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "date-time",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDateTimeFunction)
-#endif
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-abbreviation",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayAbbreviationFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-in-month",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayInMonthFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-in-week",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayInWeekFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-in-year",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayInYearFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-name",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayNameFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "day-of-week-in-month",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDayOfWeekInMonthFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "difference",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDifferenceFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "duration",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateDurationFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "hour-in-day",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateHourInDayFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "leap-year",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateLeapYearFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "minute-in-hour",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateMinuteInHourFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "month-abbreviation",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateMonthAbbreviationFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "month-in-year",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateMonthInYearFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "month-name",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateMonthNameFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "second-in-minute",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateSecondInMinuteFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "seconds",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateSecondsFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "sum",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateSumFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "time",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateTimeFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "week-in-month",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateWeekInMonthFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "week-in-year",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateWeekInYearFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "year",
-                                   (const xmlChar *) EXSLT_DATE_NAMESPACE,
-                                   exsltDateYearFunction)) {
-        return 0;
-    }
-    return -1;
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/dynamic.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,292 +0,0 @@
-/*
- * dynamic.c: Implementation of the EXSLT -- Dynamic module
- *
- * References:
- *   http://www.exslt.org/dyn/dyn.html
- *
- * See Copyright for the status of this software.
- *
- * Authors:
- *   Mark Vakoc <mark_vakoc@jdedwards.com>
- *   Thomas Broyer <tbroyer@ltgt.net>
- *
- * TODO:
- * elements:
- * functions:
- *    min
- *    max
- *    sum
- *    map
- *    closure
- */
-
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-/**
- * exsltDynEvaluateFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Evaluates the string as an XPath expression and returns the result
- * value, which may be a boolean, number, string, node set, result tree
- * fragment or external object.
- */
-
-static void
-exsltDynEvaluateFunction(xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlChar *str = NULL;
-    xmlXPathObjectPtr ret = NULL;
-
-    if (ctxt == NULL)
-        return;
-    if (nargs != 1) {
-        xsltPrintErrorContext(xsltXPathGetTransformContext(ctxt), NULL, NULL);
-        xsltGenericError(xsltGenericErrorContext,
-            "dyn:evalute() : invalid number of args %d\n", nargs);
-        ctxt->error = XPATH_INVALID_ARITY;
-        return;
-    }
-    str = xmlXPathPopString(ctxt);
-    /* return an empty node-set if an empty string is passed in */
-    if (!str||!xmlStrlen(str)) {
-        if (str) xmlFree(str);
-        valuePush(ctxt,xmlXPathNewNodeSet(NULL));
-        return;
-    }
-    ret = xmlXPathEval(str,ctxt->context);
-    if (ret)
-        valuePush(ctxt,ret);
-    else {
-        xsltGenericError(xsltGenericErrorContext,
-            "dyn:evaluate() : unable to evaluate expression '%s'\n",str);
-        valuePush(ctxt,xmlXPathNewNodeSet(NULL));
-    }
-    xmlFree(str);
-    return;
-}
-
-/**
- * exsltDynMapFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Evaluates the string as an XPath expression and returns the result
- * value, which may be a boolean, number, string, node set, result tree
- * fragment or external object.
- */
-
-static void
-exsltDynMapFunction(xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xmlChar *str = NULL;
-    xmlNodeSetPtr nodeset = NULL;
-    xsltTransformContextPtr tctxt;
-    xmlXPathCompExprPtr comp = NULL;
-    xmlXPathObjectPtr ret = NULL;
-    xmlDocPtr oldDoc, container = NULL;
-    xmlNodePtr oldNode;
-    int oldContextSize;
-    int oldProximityPosition;
-    int i, j;
-
-
-    if (nargs != 2) {
-        xmlXPathSetArityError(ctxt);
-        return;
-    }
-    str = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-        goto cleanup;
-
-    nodeset = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-        goto cleanup;
-
-    ret = xmlXPathNewNodeSet(NULL);
-    if (ret == NULL) {
-        xsltGenericError(xsltGenericErrorContext,
-                         "exsltDynMapFunction: ret == NULL\n");
-        goto cleanup;
-    }
-
-    if (str == NULL || !xmlStrlen(str) || !(comp = xmlXPathCompile(str)))
-        goto cleanup;
-
-    oldDoc = ctxt->context->doc;
-    oldNode = ctxt->context->node;
-    oldContextSize = ctxt->context->contextSize;
-    oldProximityPosition = ctxt->context->proximityPosition;
-
-        /**
-     * since we really don't know we're going to be adding node(s)
-     * down the road we create the RVT regardless
-     */
-    tctxt = xsltXPathGetTransformContext(ctxt);
-    if (tctxt == NULL) {
-    xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
-          "dyn:map : internal error tctxt == NULL\n");
-    goto cleanup;
-    }
-    container = xsltCreateRVT(tctxt);
-    if (container == NULL) {
-    xsltTransformError(tctxt, NULL, NULL,
-          "dyn:map : internal error container == NULL\n");
-    goto cleanup;
-    }
-    xsltRegisterLocalRVT(tctxt, container);
-    if (nodeset && nodeset->nodeNr > 0) {
-        xmlXPathNodeSetSort(nodeset);
-        ctxt->context->contextSize = nodeset->nodeNr;
-        ctxt->context->proximityPosition = 0;
-        for (i = 0; i < nodeset->nodeNr; i++) {
-            xmlXPathObjectPtr subResult = NULL;
-            xmlNodePtr cur = nodeset->nodeTab[i];
-
-            ctxt->context->proximityPosition++;
-            ctxt->context->node = cur;
-
-            if (cur->type == XML_NAMESPACE_DECL) {
-                /*
-                * The XPath module sets the owner element of a ns-node on
-                * the ns->next field.
-                */
-                cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
-                if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE)) {
-                    xsltGenericError(xsltGenericErrorContext,
-                        "Internal error in exsltDynMapFunction: "
-                        "Cannot retrieve the doc of a namespace node.\n");
-                    continue;
-                }
-                ctxt->context->doc = cur->doc;
-            } else {
-                ctxt->context->doc = cur->doc;
-            }
-
-            subResult = xmlXPathCompiledEval(comp, ctxt->context);
-            if (subResult != NULL) {
-                switch (subResult->type) {
-                    case XPATH_NODESET:
-                        if (subResult->nodesetval != NULL)
-                            for (j = 0; j < subResult->nodesetval->nodeNr;
-                                 j++)
-                                xmlXPathNodeSetAdd(ret->nodesetval,
-                                                   subResult->nodesetval->
-                                                   nodeTab[j]);
-                        break;
-                    case XPATH_BOOLEAN:
-                        if (container != NULL) {
-                            xmlNodePtr cur =
-                                xmlNewChild((xmlNodePtr) container, NULL,
-                                            BAD_CAST "boolean",
-                                            BAD_CAST (subResult->
-                                            boolval ? "true" : ""));
-                            if (cur != NULL) {
-                                cur->ns =
-                                    xmlNewNs(cur,
-                                             BAD_CAST
-                                             "http://exslt.org/common",
-                                             BAD_CAST "exsl");
-                                xmlXPathNodeSetAddUnique(ret->nodesetval,
-                                                         cur);
-                            }
-                        }
-                        break;
-                    case XPATH_NUMBER:
-                        if (container != NULL) {
-                            xmlChar *val =
-                                xmlXPathCastNumberToString(subResult->
-                                                           floatval);
-                            xmlNodePtr cur =
-                                xmlNewChild((xmlNodePtr) container, NULL,
-                                            BAD_CAST "number", val);
-                            if (val != NULL)
-                                xmlFree(val);
-
-                            if (cur != NULL) {
-                                cur->ns =
-                                    xmlNewNs(cur,
-                                             BAD_CAST
-                                             "http://exslt.org/common",
-                                             BAD_CAST "exsl");
-                                xmlXPathNodeSetAddUnique(ret->nodesetval,
-                                                         cur);
-                            }
-                        }
-                        break;
-                    case XPATH_STRING:
-                        if (container != NULL) {
-                            xmlNodePtr cur =
-                                xmlNewChild((xmlNodePtr) container, NULL,
-                                            BAD_CAST "string",
-                                            subResult->stringval);
-                            if (cur != NULL) {
-                                cur->ns =
-                                    xmlNewNs(cur,
-                                             BAD_CAST
-                                             "http://exslt.org/common",
-                                             BAD_CAST "exsl");
-                                xmlXPathNodeSetAddUnique(ret->nodesetval,
-                                                         cur);
-                            }
-                        }
-                        break;
-            default:
-                        break;
-                }
-                xmlXPathFreeObject(subResult);
-            }
-        }
-    }
-    ctxt->context->doc = oldDoc;
-    ctxt->context->node = oldNode;
-    ctxt->context->contextSize = oldContextSize;
-    ctxt->context->proximityPosition = oldProximityPosition;
-
-
-  cleanup:
-    /* restore the xpath context */
-    if (comp != NULL)
-        xmlXPathFreeCompExpr(comp);
-    if (nodeset != NULL)
-        xmlXPathFreeNodeSet(nodeset);
-    if (str != NULL)
-        xmlFree(str);
-    valuePush(ctxt, ret);
-    return;
-}
-
-
-/**
- * exsltDynRegister:
- *
- * Registers the EXSLT - Dynamic module
- */
-
-void
-exsltDynRegister (void) {
-    xsltRegisterExtModuleFunction ((const xmlChar *) "evaluate",
-                   EXSLT_DYNAMIC_NAMESPACE,
-                   exsltDynEvaluateFunction);
-  xsltRegisterExtModuleFunction ((const xmlChar *) "map",
-                   EXSLT_DYNAMIC_NAMESPACE,
-                   exsltDynMapFunction);
-
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exslt.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#include <libxml/xmlversion.h>
-
-#include "config.h"
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/extensions.h>
-
-#include <libexslt/exsltconfig.h>
-#include "exslt.h"
-
-const char *exsltLibraryVersion = LIBEXSLT_VERSION_STRING
-                LIBEXSLT_VERSION_EXTRA;
-const int exsltLibexsltVersion = LIBEXSLT_VERSION;
-const int exsltLibxsltVersion = LIBXSLT_VERSION;
-const int exsltLibxmlVersion = LIBXML_VERSION;
-
-/**
- * exsltRegisterAll:
- *
- * Registers all available EXSLT extensions
- */
-void
-exsltRegisterAll (void) {
-    xsltInitGlobals();
-    exsltCommonRegister();
-#ifdef EXSLT_CRYPTO_ENABLED
-    exsltCryptoRegister();
-#endif
-    exsltMathRegister();
-    exsltSetsRegister();
-    exsltFuncRegister();
-    exsltStrRegister();
-    exsltDateRegister();
-    exsltSaxonRegister();
-    exsltDynRegister();
-}
-
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exslt.h	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-
-#ifndef __EXSLT_H__
-#define __EXSLT_H__
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include "exsltexports.h"
-#include <libexslt/exsltconfig.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EXSLTPUBVAR const char *exsltLibraryVersion;
-EXSLTPUBVAR const int exsltLibexsltVersion;
-EXSLTPUBVAR const int exsltLibxsltVersion;
-EXSLTPUBVAR const int exsltLibxmlVersion;
-
-/**
- * EXSLT_COMMON_NAMESPACE:
- *
- * Namespace for EXSLT common functions
- */
-#define EXSLT_COMMON_NAMESPACE ((const xmlChar *) "http://exslt.org/common")
-/**
- * EXSLT_CRYPTO_NAMESPACE:
- *
- * Namespace for EXSLT crypto functions
- */
-#define EXSLT_CRYPTO_NAMESPACE ((const xmlChar *) "http://exslt.org/crypto")
-/**
- * EXSLT_MATH_NAMESPACE:
- *
- * Namespace for EXSLT math functions
- */
-#define EXSLT_MATH_NAMESPACE ((const xmlChar *) "http://exslt.org/math")
-/**
- * EXSLT_SETS_NAMESPACE:
- *
- * Namespace for EXSLT set functions
- */
-#define EXSLT_SETS_NAMESPACE ((const xmlChar *) "http://exslt.org/sets")
-/**
- * EXSLT_FUNCTIONS_NAMESPACE:
- *
- * Namespace for EXSLT functions extension functions
- */
-#define EXSLT_FUNCTIONS_NAMESPACE ((const xmlChar *) "http://exslt.org/functions")
-/**
- * EXSLT_STRINGS_NAMESPACE:
- *
- * Namespace for EXSLT strings functions
- */
-#define EXSLT_STRINGS_NAMESPACE ((const xmlChar *) "http://exslt.org/strings")
-/**
- * EXSLT_DATE_NAMESPACE:
- *
- * Namespace for EXSLT date functions
- */
-#define EXSLT_DATE_NAMESPACE ((const xmlChar *) "http://exslt.org/dates-and-times")
-/**
- * EXSLT_DYNAMIC_NAMESPACE:
- *
- * Namespace for EXSLT dynamic functions
- */
-#define EXSLT_DYNAMIC_NAMESPACE ((const xmlChar *) "http://exslt.org/dynamic")
-
-/**
- * SAXON_NAMESPACE:
- *
- * Namespace for SAXON extensions functions
- */
-#define SAXON_NAMESPACE ((const xmlChar *) "http://icl.com/saxon")
-
-EXSLTPUBFUN void EXSLTCALL exsltCommonRegister (void);
-#ifdef EXSLT_CRYPTO_ENABLED
-EXSLTPUBFUN void EXSLTCALL exsltCryptoRegister (void);
-#endif
-EXSLTPUBFUN void EXSLTCALL exsltMathRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltSetsRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltFuncRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltStrRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltDateRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltSaxonRegister (void);
-EXSLTPUBFUN void EXSLTCALL exsltDynRegister(void);
-
-EXSLTPUBFUN void EXSLTCALL exsltRegisterAll (void);
-
-EXSLTPUBFUN int EXSLTCALL exsltDateXpathCtxtRegister (xmlXPathContextPtr ctxt,
-                                                      const xmlChar *prefix);
-EXSLTPUBFUN int EXSLTCALL exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt,
-                                                      const xmlChar *prefix);
-EXSLTPUBFUN int EXSLTCALL exsltSetsXpathCtxtRegister (xmlXPathContextPtr ctxt,
-                                                      const xmlChar *prefix);
-EXSLTPUBFUN int EXSLTCALL exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt,
-                                                     const xmlChar *prefix);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __EXSLT_H__ */
-
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exsltconfig.h.in	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
- * exsltconfig.h: compile-time version informations for the EXSLT library
- *
- * See Copyright for the status of this software.
- *
- * daniel@veillard.com
- */
-
-#ifndef __XML_EXSLTCONFIG_H__
-#define __XML_EXSLTCONFIG_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * LIBEXSLT_DOTTED_VERSION:
- *
- * the version string like "1.2.3"
- */
-#define LIBEXSLT_DOTTED_VERSION "@VERSION@"
-
-/**
- * LIBEXSLT_VERSION:
- *
- * the version number: 1.2.3 value is 10203
- */
-#define LIBEXSLT_VERSION @LIBEXSLT_VERSION_NUMBER@
-
-/**
- * LIBEXSLT_VERSION_STRING:
- *
- * the version number string, 1.2.3 value is "10203"
- */
-#define LIBEXSLT_VERSION_STRING "@LIBEXSLT_VERSION_NUMBER@"
-
-/**
- * LIBEXSLT_VERSION_EXTRA:
- *
- * extra version information, used to show a CVS compilation
- */
-#define	LIBEXSLT_VERSION_EXTRA "@LIBEXSLT_VERSION_EXTRA@"
-
-/**
- * WITH_CRYPTO:
- *
- * Whether crypto support is configured into exslt
- */
-#if @WITH_CRYPTO@
-#define EXSLT_CRYPTO_ENABLED
-#endif
-
-/**
- * ATTRIBUTE_UNUSED:
- *
- * This macro is used to flag unused function parameters to GCC
- */
-#ifdef __GNUC__
-#ifdef HAVE_ANSIDECL_H
-#include <ansidecl.h>
-#endif
-#ifndef ATTRIBUTE_UNUSED
-#define ATTRIBUTE_UNUSED __attribute__((unused))
-#endif
-#else
-#define ATTRIBUTE_UNUSED
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __XML_EXSLTCONFIG_H__ */
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/exsltexports.h	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
- * exsltexports.h : macros for marking symbols as exportable/importable.
- *
- * See Copyright for the status of this software.
- *
- * igor@zlatkovic.com
- */
-
-#ifndef __EXSLT_EXPORTS_H__
-#define __EXSLT_EXPORTS_H__
-
-/**
- * EXSLTPUBFUN, EXSLTPUBVAR, EXSLTCALL
- *
- * Macros which declare an exportable function, an exportable variable and
- * the calling convention used for functions.
- *
- * Please use an extra block for every platform/compiler combination when
- * modifying this, rather than overlong #ifdef lines. This helps
- * readability as well as the fact that different compilers on the same
- * platform might need different definitions.
- */
-
-/**
- * EXSLTPUBFUN:
- *
- * Macros which declare an exportable function
- */
-#define EXSLTPUBFUN
-/**
- * EXSLTPUBVAR:
- *
- * Macros which declare an exportable variable
- */
-#define EXSLTPUBVAR extern
-/**
- * EXSLTCALL:
- *
- * Macros which declare the called convention for exported functions
- */
-#define EXSLTCALL
-
-/** DOC_DISABLE */
-
-/* Windows platform with MS compiler */
-#if defined(_WIN32) && defined(_MSC_VER)
-  #undef EXSLTPUBFUN
-  #undef EXSLTPUBVAR
-  #undef EXSLTCALL
-  #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
-    #define EXSLTPUBFUN __declspec(dllexport)
-    #define EXSLTPUBVAR __declspec(dllexport)
-  #else
-    #define EXSLTPUBFUN
-    #if !defined(LIBEXSLT_STATIC)
-      #define EXSLTPUBVAR __declspec(dllimport) extern
-    #else
-      #define EXSLTPUBVAR extern
-    #endif
-  #endif
-  #define EXSLTCALL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Windows platform with Borland compiler */
-#if defined(_WIN32) && defined(__BORLANDC__)
-  #undef EXSLTPUBFUN
-  #undef EXSLTPUBVAR
-  #undef EXSLTCALL
-  #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
-    #define EXSLTPUBFUN __declspec(dllexport)
-    #define EXSLTPUBVAR __declspec(dllexport) extern
-  #else
-    #define EXSLTPUBFUN
-    #if !defined(LIBEXSLT_STATIC)
-      #define EXSLTPUBVAR __declspec(dllimport) extern
-    #else
-      #define EXSLTPUBVAR extern
-    #endif
-  #endif
-  #define EXSLTCALL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Windows platform with GNU compiler (Mingw) */
-#if defined(_WIN32) && defined(__MINGW32__)
-  #undef EXSLTPUBFUN
-  #undef EXSLTPUBVAR
-  #undef EXSLTCALL
-/*
-  #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
-*/
-  #if !defined(LIBEXSLT_STATIC)
-    #define EXSLTPUBFUN __declspec(dllexport)
-    #define EXSLTPUBVAR __declspec(dllexport) extern
-  #else
-    #define EXSLTPUBFUN
-    #if !defined(LIBEXSLT_STATIC)
-      #define EXSLTPUBVAR __declspec(dllimport) extern
-    #else
-      #define EXSLTPUBVAR extern
-    #endif
-  #endif
-  #define EXSLTCALL __cdecl
-  #if !defined _REENTRANT
-    #define _REENTRANT
-  #endif
-#endif
-
-/* Cygwin platform, GNU compiler */
-#if defined(_WIN32) && defined(__CYGWIN__)
-  #undef EXSLTPUBFUN
-  #undef EXSLTPUBVAR
-  #undef EXSLTCALL
-  #if defined(IN_LIBEXSLT) && !defined(LIBEXSLT_STATIC)
-    #define EXSLTPUBFUN __declspec(dllexport)
-    #define EXSLTPUBVAR __declspec(dllexport)
-  #else
-    #define EXSLTPUBFUN
-    #if !defined(LIBEXSLT_STATIC)
-      #define EXSLTPUBVAR __declspec(dllimport) extern
-    #else
-      #define EXSLTPUBVAR
-    #endif
-  #endif
-  #define EXSLTCALL __cdecl
-#endif
-
-/* Compatibility */
-#if !defined(LIBEXSLT_PUBLIC)
-#define LIBEXSLT_PUBLIC EXSLTPUBVAR
-#endif
-
-#endif /* __EXSLT_EXPORTS_H__ */
-
-
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/functions.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,798 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/hash.h>
-#include <libxml/debugXML.h>
-
-#include <libxslt/xsltutils.h>
-#include <libxslt/variables.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-#include <libxslt/transform.h>
-#include <libxslt/imports.h>
-
-#include "exslt.h"
-
-typedef struct _exsltFuncFunctionData exsltFuncFunctionData;
-struct _exsltFuncFunctionData {
-    int nargs;          /* number of arguments to the function */
-    xmlNodePtr content;     /* the func:fuction template content */
-};
-
-typedef struct _exsltFuncData exsltFuncData;
-struct _exsltFuncData {
-    xmlHashTablePtr funcs;  /* pointer to the stylesheet module data */
-    xmlXPathObjectPtr result;   /* returned by func:result */
-    int error;          /* did an error occur? */
-};
-
-typedef struct _exsltFuncResultPreComp exsltFuncResultPreComp;
-struct _exsltFuncResultPreComp {
-    xsltElemPreComp comp;
-    xmlXPathCompExprPtr select;
-    xmlNsPtr *nsList;
-    int nsNr;
-};
-
-/* Used for callback function in exsltInitFunc */
-typedef struct _exsltFuncImportRegData exsltFuncImportRegData;
-struct _exsltFuncImportRegData {
-    xsltTransformContextPtr ctxt;
-    xmlHashTablePtr hash;
-};
-
-static void exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt,
-                       int nargs);
-static exsltFuncFunctionData *exsltFuncNewFunctionData(void);
-
-/*static const xmlChar *exsltResultDataID = (const xmlChar *) "EXSLT Result";*/
-
-/**
- * exsltFuncRegisterFunc:
- * @func:  the #exsltFuncFunctionData for the function
- * @ctxt:  an XSLT transformation context
- * @URI:  the function namespace URI
- * @name: the function name
- *
- * Registers a function declared by a func:function element
- */
-static void
-exsltFuncRegisterFunc (exsltFuncFunctionData *data,
-               xsltTransformContextPtr ctxt,
-               const xmlChar *URI, const xmlChar *name,
-               ATTRIBUTE_UNUSED const xmlChar *ignored) {
-    if ((data == NULL) || (ctxt == NULL) || (URI == NULL) || (name == NULL))
-    return;
-
-    xsltGenericDebug(xsltGenericDebugContext,
-             "exsltFuncRegisterFunc: register {%s}%s\n",
-             URI, name);
-    xsltRegisterExtFunction(ctxt, name, URI,
-                exsltFuncFunctionFunction);
-}
-
-/*
- * exsltFuncRegisterImportFunc
- * @data:    the exsltFuncFunctionData for the function
- * @ch:      structure containing context and hash table
- * @URI:     the function namespace URI
- * @name:    the function name
- *
- * Checks if imported function is already registered in top-level
- * stylesheet.  If not, copies function data and registers function
- */
-static void
-exsltFuncRegisterImportFunc (exsltFuncFunctionData *data,
-                 exsltFuncImportRegData *ch,
-                 const xmlChar *URI, const xmlChar *name,
-                 ATTRIBUTE_UNUSED const xmlChar *ignored) {
-    exsltFuncFunctionData *func=NULL;
-
-    if ((data == NULL) || (ch == NULL) || (URI == NULL) || (name == NULL))
-            return;
-
-    if (ch->ctxt == NULL || ch->hash == NULL)
-    return;
-
-    /* Check if already present */
-    func = (exsltFuncFunctionData*)xmlHashLookup2(ch->hash, URI, name);
-    if (func == NULL) {     /* Not yet present - copy it in */
-    func = exsltFuncNewFunctionData();
-        if (func == NULL)
-            return;
-    memcpy(func, data, sizeof(exsltFuncFunctionData));
-    if (xmlHashAddEntry2(ch->hash, URI, name, func) < 0) {
-        xsltGenericError(xsltGenericErrorContext,
-            "Failed to register function {%s}%s\n",
-            URI, name);
-    } else {        /* Do the registration */
-        xsltGenericDebug(xsltGenericDebugContext,
-                "exsltFuncRegisterImportFunc: register {%s}%s\n",
-            URI, name);
-        xsltRegisterExtFunction(ch->ctxt, name, URI,
-            exsltFuncFunctionFunction);
-    }
-    }
-}
-
-/**
- * exsltFuncInit:
- * @ctxt: an XSLT transformation context
- * @URI: the namespace URI for the extension
- *
- * Initializes the EXSLT - Functions module.
- * Called at transformation-time; merges all
- * functions declared in the import tree taking
- * import precedence into account, i.e. overriding
- * functions with lower import precedence.
- *
- * Returns the data for this transformation
- */
-static exsltFuncData *
-exsltFuncInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
-    exsltFuncData *ret;
-    xsltStylesheetPtr tmp;
-    exsltFuncImportRegData ch;
-    xmlHashTablePtr hash;
-
-    ret = (exsltFuncData *) xmlMalloc (sizeof(exsltFuncData));
-    if (ret == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncInit: not enough memory\n");
-    return(NULL);
-    }
-    memset(ret, 0, sizeof(exsltFuncData));
-
-    ret->result = NULL;
-    ret->error = 0;
-
-    ch.hash = (xmlHashTablePtr) xsltStyleGetExtData(ctxt->style, URI);
-    ret->funcs = ch.hash;
-    xmlHashScanFull(ch.hash, (xmlHashScannerFull) exsltFuncRegisterFunc, ctxt);
-    tmp = ctxt->style;
-    ch.ctxt = ctxt;
-    while ((tmp=xsltNextImport(tmp))!=NULL) {
-    hash = xsltGetExtInfo(tmp, URI);
-    if (hash != NULL) {
-        xmlHashScanFull(hash,
-            (xmlHashScannerFull) exsltFuncRegisterImportFunc, &ch);
-    }
-    }
-
-    return(ret);
-}
-
-/**
- * exsltFuncShutdown:
- * @ctxt: an XSLT transformation context
- * @URI: the namespace URI for the extension
- * @data: the module data to free up
- *
- * Shutdown the EXSLT - Functions module
- * Called at transformation-time.
- */
-static void
-exsltFuncShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
-           const xmlChar *URI ATTRIBUTE_UNUSED,
-           exsltFuncData *data) {
-    if (data->result != NULL)
-    xmlXPathFreeObject(data->result);
-    xmlFree(data);
-}
-
-/**
- * exsltFuncStyleInit:
- * @style: an XSLT stylesheet
- * @URI: the namespace URI for the extension
- *
- * Allocates the stylesheet data for EXSLT - Function
- * Called at compile-time.
- *
- * Returns the allocated data
- */
-static xmlHashTablePtr
-exsltFuncStyleInit (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
-            const xmlChar *URI ATTRIBUTE_UNUSED) {
-    return xmlHashCreate(1);
-}
-
-/**
- * exsltFuncStyleShutdown:
- * @style: an XSLT stylesheet
- * @URI: the namespace URI for the extension
- * @data: the stylesheet data to free up
- *
- * Shutdown the EXSLT - Function module
- * Called at compile-time.
- */
-static void
-exsltFuncStyleShutdown (xsltStylesheetPtr style ATTRIBUTE_UNUSED,
-            const xmlChar *URI ATTRIBUTE_UNUSED,
-            xmlHashTablePtr data) {
-    xmlHashFree(data, (xmlHashDeallocator) xmlFree);
-}
-
-/**
- * exsltFuncNewFunctionData:
- *
- * Allocates an #exslFuncFunctionData object
- *
- * Returns the new structure
- */
-static exsltFuncFunctionData *
-exsltFuncNewFunctionData (void) {
-    exsltFuncFunctionData *ret;
-
-    ret = (exsltFuncFunctionData *) xmlMalloc (sizeof(exsltFuncFunctionData));
-    if (ret == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncNewFunctionData: not enough memory\n");
-    return (NULL);
-    }
-    memset(ret, 0, sizeof(exsltFuncFunctionData));
-
-    ret->nargs = 0;
-    ret->content = NULL;
-
-    return(ret);
-}
-
-/**
- * exsltFreeFuncResultPreComp:
- * @comp:  the #exsltFuncResultPreComp to free up
- *
- * Deallocates an #exsltFuncResultPreComp
- */
-static void
-exsltFreeFuncResultPreComp (exsltFuncResultPreComp *comp) {
-    if (comp == NULL)
-    return;
-
-    if (comp->select != NULL)
-    xmlXPathFreeCompExpr (comp->select);
-    if (comp->nsList != NULL)
-        xmlFree(comp->nsList);
-    xmlFree(comp);
-}
-
-/**
- * exsltFuncFunctionFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Evaluates the func:function element that defines the called function.
- */
-static void
-exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlXPathObjectPtr oldResult, ret;
-    exsltFuncData *data;
-    exsltFuncFunctionData *func;
-    xmlNodePtr paramNode, oldInsert, fake;
-    int oldBase;
-    xsltStackElemPtr params = NULL, param;
-    xsltTransformContextPtr tctxt = xsltXPathGetTransformContext(ctxt);
-    int i, notSet;
-    struct objChain {
-    struct objChain *next;
-    xmlXPathObjectPtr obj;
-    };
-    struct objChain *savedObjChain = NULL, *savedObj;
-
-    /*
-     * retrieve func:function template
-     */
-    data = (exsltFuncData *) xsltGetExtData (tctxt,
-                         EXSLT_FUNCTIONS_NAMESPACE);
-    oldResult = data->result;
-    data->result = NULL;
-
-    func = (exsltFuncFunctionData*) xmlHashLookup2 (data->funcs,
-                            ctxt->context->functionURI,
-                            ctxt->context->function);
-    if (func == NULL) {
-        /* Should never happen */
-        xsltGenericError(xsltGenericErrorContext,
-                         "{%s}%s: not found\n",
-                         ctxt->context->functionURI, ctxt->context->function);
-        ctxt->error = XPATH_UNKNOWN_FUNC_ERROR;
-        return;
-    }
-
-    /*
-     * params handling
-     */
-    if (nargs > func->nargs) {
-    xsltGenericError(xsltGenericErrorContext,
-             "{%s}%s: called with too many arguments\n",
-             ctxt->context->functionURI, ctxt->context->function);
-    ctxt->error = XPATH_INVALID_ARITY;
-    return;
-    }
-    if (func->content != NULL) {
-    paramNode = func->content->prev;
-    }
-    else
-    paramNode = NULL;
-    if ((paramNode == NULL) && (func->nargs != 0)) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncFunctionFunction: nargs != 0 and "
-             "param == NULL\n");
-    return;
-    }
-
-    /*
-    * When a function is called recursively during evaluation of its
-    * arguments, the recursion check in xsltApplySequenceConstructor
-    * isn't reached.
-    */
-    if (tctxt->depth >= tctxt->maxTemplateDepth) {
-        xsltTransformError(tctxt, NULL, NULL,
-            "exsltFuncFunctionFunction: Potentially infinite recursion "
-            "detected in function {%s}%s.\n",
-            ctxt->context->functionURI, ctxt->context->function);
-        tctxt->state = XSLT_STATE_STOPPED;
-        return;
-    }
-    tctxt->depth++;
-
-    /*
-     * We have a problem with the evaluation of function parameters.
-     * The original library code did not evaluate XPath expressions until
-     * the last moment.  After version 1.1.17 of the libxslt, the logic
-     * of other parts of the library was changed, and the evaluation of
-     * XPath expressions within parameters now takes place as soon as the
-     * parameter is parsed/evaluated (xsltParseStylesheetCallerParam).
-     * This means that the parameters need to be evaluated in lexical
-     * order (since a variable is "in scope" as soon as it is declared).
-     * However, on entry to this routine, the values (from the caller) are
-     * in reverse order (held on the XPath context variable stack).  To
-     * accomplish what is required, I have added code to pop the XPath
-     * objects off of the stack at the beginning and save them, then use
-     * them (in the reverse order) as the params are evaluated.  This
-     * requires an xmlMalloc/xmlFree for each param set by the caller,
-     * which is not very nice.  There is probably a much better solution
-     * (like change other code to delay the evaluation).
-     */
-    /*
-     * In order to give the function params and variables a new 'scope'
-     * we change varsBase in the context.
-     */
-    oldBase = tctxt->varsBase;
-    tctxt->varsBase = tctxt->varsNr;
-    /* If there are any parameters */
-    if (paramNode != NULL) {
-        /* Fetch the stored argument values from the caller */
-    for (i = 0; i < nargs; i++) {
-        savedObj = xmlMalloc(sizeof(struct objChain));
-        savedObj->next = savedObjChain;
-        savedObj->obj = valuePop(ctxt);
-        savedObjChain = savedObj;
-    }
-
-    /*
-     * Prepare to process params in reverse order.  First, go to
-     * the beginning of the param chain.
-     */
-    for (i = 1; i <= func->nargs; i++) {
-        if (paramNode->prev == NULL)
-            break;
-        paramNode = paramNode->prev;
-    }
-    /*
-     * i has total # params found, nargs is number which are present
-     * as arguments from the caller
-     * Calculate the number of un-set parameters
-     */
-    notSet = func->nargs - nargs;
-    for (; i > 0; i--) {
-        param = xsltParseStylesheetCallerParam (tctxt, paramNode);
-        if (i > notSet) {   /* if parameter value set */
-        param->computed = 1;
-        if (param->value != NULL)
-            xmlXPathFreeObject(param->value);
-        savedObj = savedObjChain;   /* get next val from chain */
-        param->value = savedObj->obj;
-        savedObjChain = savedObjChain->next;
-        xmlFree(savedObj);
-        }
-        xsltLocalVariablePush(tctxt, param, -1);
-        param->next = params;
-        params = param;
-        paramNode = paramNode->next;
-    }
-    }
-    /*
-     * actual processing
-     */
-    fake = xmlNewDocNode(tctxt->output, NULL,
-             (const xmlChar *)"fake", NULL);
-    oldInsert = tctxt->insert;
-    tctxt->insert = fake;
-    xsltApplyOneTemplate (tctxt, tctxt->node,
-              func->content, NULL, NULL);
-    xsltLocalVariablePop(tctxt, tctxt->varsBase, -2);
-    tctxt->insert = oldInsert;
-    tctxt->varsBase = oldBase;  /* restore original scope */
-    if (params != NULL)
-    xsltFreeStackElemList(params);
-
-    if (data->error != 0)
-        goto error;
-
-    if (data->result != NULL) {
-    ret = data->result;
-        /*
-        * IMPORTANT: This enables previously tree fragments marked as
-        * being results of a function, to be garbage-collected after
-        * the calling process exits.
-        */
-        xsltFlagRVTs(tctxt, ret, XSLT_RVT_LOCAL);
-    } else
-    ret = xmlXPathNewCString("");
-
-    data->result = oldResult;
-
-    /*
-     * It is an error if the instantiation of the template results in
-     * the generation of result nodes.
-     */
-    if (fake->children != NULL) {
-#ifdef LIBXML_DEBUG_ENABLED
-    xmlDebugDumpNode (stderr, fake, 1);
-#endif
-    xsltGenericError(xsltGenericErrorContext,
-             "{%s}%s: cannot write to result tree while "
-             "executing a function\n",
-             ctxt->context->functionURI, ctxt->context->function);
-    xmlFreeNode(fake);
-    goto error;
-    }
-    xmlFreeNode(fake);
-    valuePush(ctxt, ret);
-
-error:
-    tctxt->depth--;
-}
-
-
-static void
-exsltFuncFunctionComp (xsltStylesheetPtr style, xmlNodePtr inst) {
-    xmlChar *name, *prefix;
-    xmlNsPtr ns;
-    xmlHashTablePtr data;
-    exsltFuncFunctionData *func;
-
-    if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
-    return;
-
-    {
-    xmlChar *qname;
-
-    qname = xmlGetProp(inst, (const xmlChar *) "name");
-    name = xmlSplitQName2 (qname, &prefix);
-    xmlFree(qname);
-    }
-    if ((name == NULL) || (prefix == NULL)) {
-    xsltGenericError(xsltGenericErrorContext,
-             "func:function: not a QName\n");
-    if (name != NULL)
-        xmlFree(name);
-    return;
-    }
-    /* namespace lookup */
-    ns = xmlSearchNs (inst->doc, inst, prefix);
-    if (ns == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "func:function: undeclared prefix %s\n",
-             prefix);
-    xmlFree(name);
-    xmlFree(prefix);
-    return;
-    }
-    xmlFree(prefix);
-
-    xsltParseTemplateContent(style, inst);
-
-    /*
-     * Create function data
-     */
-    func = exsltFuncNewFunctionData();
-    if (func == NULL) {
-        xmlFree(name);
-        return;
-    }
-    func->content = inst->children;
-    while (IS_XSLT_ELEM(func->content) &&
-       IS_XSLT_NAME(func->content, "param")) {
-    func->content = func->content->next;
-    func->nargs++;
-    }
-
-    /*
-     * Register the function data such that it can be retrieved
-     * by exslFuncFunctionFunction
-     */
-#ifdef XSLT_REFACTORED
-    /*
-    * Ensure that the hash table will be stored in the *current*
-    * stylesheet level in order to correctly evaluate the
-    * import precedence.
-    */
-    data = (xmlHashTablePtr)
-    xsltStyleStylesheetLevelGetExtData(style,
-        EXSLT_FUNCTIONS_NAMESPACE);
-#else
-    data = (xmlHashTablePtr)
-    xsltStyleGetExtData (style, EXSLT_FUNCTIONS_NAMESPACE);
-#endif
-    if (data == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncFunctionComp: no stylesheet data\n");
-    xmlFree(name);
-        xmlFree(func);
-    return;
-    }
-
-    if (xmlHashAddEntry2 (data, ns->href, name, func) < 0) {
-    xsltTransformError(NULL, style, inst,
-        "Failed to register function {%s}%s\n",
-             ns->href, name);
-    style->errors++;
-        xmlFree(func);
-    } else {
-    xsltGenericDebug(xsltGenericDebugContext,
-             "exsltFuncFunctionComp: register {%s}%s\n",
-             ns->href, name);
-    }
-    xmlFree(name);
-}
-
-static xsltElemPreCompPtr
-exsltFuncResultComp (xsltStylesheetPtr style, xmlNodePtr inst,
-             xsltTransformFunction function) {
-    xmlNodePtr test;
-    xmlChar *sel;
-    exsltFuncResultPreComp *ret;
-
-    if ((style == NULL) || (inst == NULL) || (inst->type != XML_ELEMENT_NODE))
-        return (NULL);
-
-    /*
-     * "Validity" checking
-     */
-    /* it is an error to have any following sibling elements aside
-     * from the xsl:fallback element.
-     */
-    for (test = inst->next; test != NULL; test = test->next) {
-    if (test->type != XML_ELEMENT_NODE)
-        continue;
-    if (IS_XSLT_ELEM(test) && IS_XSLT_NAME(test, "fallback"))
-        continue;
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncResultElem: only xsl:fallback is "
-             "allowed to follow func:result\n");
-    style->errors++;
-    return (NULL);
-    }
-    /* it is an error for a func:result element to not be a descendant
-     * of func:function.
-     * it is an error if a func:result occurs within a func:result
-     * element.
-     * it is an error if instanciating the content of a variable
-     * binding element (i.e. xsl:variable, xsl:param) results in the
-     * instanciation of a func:result element.
-     */
-    for (test = inst->parent; test != NULL; test = test->parent) {
-    if (IS_XSLT_ELEM(test) &&
-        IS_XSLT_NAME(test, "stylesheet")) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "func:result element not a descendant "
-                 "of a func:function\n");
-        style->errors++;
-        return (NULL);
-    }
-    if ((test->ns != NULL) &&
-        (xmlStrEqual(test->ns->href, EXSLT_FUNCTIONS_NAMESPACE))) {
-        if (xmlStrEqual(test->name, (const xmlChar *) "function")) {
-        break;
-        }
-        if (xmlStrEqual(test->name, (const xmlChar *) "result")) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "func:result element not allowed within"
-                 " another func:result element\n");
-            style->errors++;
-        return (NULL);
-        }
-    }
-    if (IS_XSLT_ELEM(test) &&
-        (IS_XSLT_NAME(test, "variable") ||
-         IS_XSLT_NAME(test, "param"))) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "func:result element not allowed within"
-                 " a variable binding element\n");
-            style->errors++;
-        return (NULL);
-    }
-    }
-
-    /*
-     * Precomputation
-     */
-    ret = (exsltFuncResultPreComp *)
-    xmlMalloc (sizeof(exsltFuncResultPreComp));
-    if (ret == NULL) {
-    xsltPrintErrorContext(NULL, NULL, NULL);
-        xsltGenericError(xsltGenericErrorContext,
-                         "exsltFuncResultComp : malloc failed\n");
-        style->errors++;
-        return (NULL);
-    }
-    memset(ret, 0, sizeof(exsltFuncResultPreComp));
-
-    xsltInitElemPreComp ((xsltElemPreCompPtr) ret, style, inst, function,
-         (xsltElemPreCompDeallocator) exsltFreeFuncResultPreComp);
-    ret->select = NULL;
-
-    /*
-     * Precompute the select attribute
-     */
-    sel = xmlGetNsProp(inst, (const xmlChar *) "select", NULL);
-    if (sel != NULL) {
-    ret->select = xmlXPathCompile (sel);
-    xmlFree(sel);
-    }
-    /*
-     * Precompute the namespace list
-     */
-    ret->nsList = xmlGetNsList(inst->doc, inst);
-    if (ret->nsList != NULL) {
-        int i = 0;
-        while (ret->nsList[i] != NULL)
-        i++;
-    ret->nsNr = i;
-    }
-    return ((xsltElemPreCompPtr) ret);
-}
-
-static void
-exsltFuncResultElem (xsltTransformContextPtr ctxt,
-                 xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr inst,
-             exsltFuncResultPreComp *comp) {
-    exsltFuncData *data;
-    xmlXPathObjectPtr ret;
-
-
-    /* It is an error if instantiating the content of the
-     * func:function element results in the instantiation of more than
-     * one func:result elements.
-     */
-    data = (exsltFuncData *) xsltGetExtData (ctxt, EXSLT_FUNCTIONS_NAMESPACE);
-    if (data == NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "exsltFuncReturnElem: data == NULL\n");
-    return;
-    }
-    if (data->result != NULL) {
-    xsltGenericError(xsltGenericErrorContext,
-             "func:result already instanciated\n");
-    data->error = 1;
-    return;
-    }
-    /*
-     * Processing
-     */
-    if (comp->select != NULL) {
-    xmlNsPtr *oldXPNsList;
-    int oldXPNsNr;
-    xmlNodePtr oldXPContextNode;
-    /* If the func:result element has a select attribute, then the
-     * value of the attribute must be an expression and the
-     * returned value is the object that results from evaluating
-     * the expression. In this case, the content must be empty.
-     */
-    if (inst->children != NULL) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "func:result content must be empty if"
-                 " the function has a select attribute\n");
-        data->error = 1;
-        return;
-    }
-    oldXPNsList = ctxt->xpathCtxt->namespaces;
-    oldXPNsNr = ctxt->xpathCtxt->nsNr;
-    oldXPContextNode = ctxt->xpathCtxt->node;
-
-    ctxt->xpathCtxt->namespaces = comp->nsList;
-    ctxt->xpathCtxt->nsNr = comp->nsNr;
-        ctxt->xpathCtxt->node = ctxt->node;
-
-    ret = xmlXPathCompiledEval(comp->select, ctxt->xpathCtxt);
-
-    ctxt->xpathCtxt->node = oldXPContextNode;
-    ctxt->xpathCtxt->nsNr = oldXPNsNr;
-    ctxt->xpathCtxt->namespaces = oldXPNsList;
-
-    if (ret == NULL) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "exsltFuncResultElem: ret == NULL\n");
-        return;
-    }
-    /*
-    * Mark it as a function result in order to avoid garbage
-    * collecting of tree fragments before the function exits.
-    */
-    xsltFlagRVTs(ctxt, ret, XSLT_RVT_FUNC_RESULT);
-    } else if (inst->children != NULL) {
-    /* If the func:result element does not have a select attribute
-     * and has non-empty content (i.e. the func:result element has
-     * one or more child nodes), then the content of the
-     * func:result element specifies the value.
-     */
-    xmlNodePtr oldInsert;
-    xmlDocPtr container;
-
-    container = xsltCreateRVT(ctxt);
-    if (container == NULL) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "exsltFuncResultElem: out of memory\n");
-        data->error = 1;
-        return;
-    }
-        /* Mark as function result. */
-        container->psvi = XSLT_RVT_FUNC_RESULT;
-
-    oldInsert = ctxt->insert;
-    ctxt->insert = (xmlNodePtr) container;
-    xsltApplyOneTemplate (ctxt, ctxt->node,
-                  inst->children, NULL, NULL);
-    ctxt->insert = oldInsert;
-
-    ret = xmlXPathNewValueTree((xmlNodePtr) container);
-    if (ret == NULL) {
-        xsltGenericError(xsltGenericErrorContext,
-                 "exsltFuncResultElem: ret == NULL\n");
-        data->error = 1;
-    } else {
-        ret->boolval = 0; /* Freeing is not handled there anymore */
-    }
-    } else {
-    /* If the func:result element has empty content and does not
-     * have a select attribute, then the returned value is an
-     * empty string.
-     */
-    ret = xmlXPathNewCString("");
-    }
-    data->result = ret;
-}
-
-/**
- * exsltFuncRegister:
- *
- * Registers the EXSLT - Functions module
- */
-void
-exsltFuncRegister (void) {
-    xsltRegisterExtModuleFull (EXSLT_FUNCTIONS_NAMESPACE,
-               (xsltExtInitFunction) exsltFuncInit,
-               (xsltExtShutdownFunction) exsltFuncShutdown,
-               (xsltStyleExtInitFunction) exsltFuncStyleInit,
-               (xsltStyleExtShutdownFunction) exsltFuncStyleShutdown);
-
-    xsltRegisterExtModuleTopLevel ((const xmlChar *) "function",
-                   EXSLT_FUNCTIONS_NAMESPACE,
-                   exsltFuncFunctionComp);
-    xsltRegisterExtModuleElement ((const xmlChar *) "result",
-              EXSLT_FUNCTIONS_NAMESPACE,
-              (xsltPreComputeFunction)exsltFuncResultComp,
-              (xsltTransformFunction) exsltFuncResultElem);
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/libexslt.3	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-.TH LIBEXSLT 3 "04 November 2003" libxslt
-.SH NAME
-libexslt \- extension library for XSLT
-.SH SYNOPSIS
-.B #include <libexslt/exslt.h>
-.sp
-.B void exsltCommonRegister(void);
-.br
-.B void exsltDateRegister(void);
-.br
-.B void exsltDynRegister(void);
-.br
-.B void exsltFuncRegister(void);
-.br
-.B void exsltMathRegister(void);
-.br
-.B void exsltSetsRegister(void);
-.br
-.B void exsltStrRegister(void);
-.br
-.B void exsltRegisterAll(void);
-.br
-.B void exsltSaxonRegister(void);
-.SH DESCRIPTION
-The 
-.B libexslt
-library is used to provide extensions to
-.SM XSLT
-functions. These extensions come from the
-.SM EXSLT
-project <http://www.exslt.org/>
-.LP
-.SH USAGE
-To make use of these functions in
-.SM XSLT
-the appropriate namespace must be defined on the
-.B xsl:stylesheet
-element.  To enable support for them in 
-.BR libxslt (3)
-you must call the appropriate functions (listed in the
-.B SYNOPSIS
-section) to register the extensions.  The
-.I xslt-config
-shell script can be used to obtain the necessary flags for
-the pre-processor and linker.
-The supported extensions are:
-.SS COMMON
-.TP 2.2i
-Namespace: http://exslt.org/common
-.TP 2.2i
-See http://www.exslt.org/exsl/index.html for a description.
-.TP 2.2i
-.B node-set()
-convert the given RTF into a node-set.
-.TP
-.B object-type()
-returns the type of the given argument.
-.TP
-.B document
-Create multiple output documents. See http://www.exslt.org/exsl/elements/document/index.html
-
-.SS MATH
-.TP 2.2i
-Namespace: http://exslt.org/math
-.TP 2.2i
-See http://www.exslt.org/math/index.html for a description.
-.TP 2.2i
-.B min()
-returns the minimum value of the given node-set
-.TP
-.B max()
-returns the maximum value of the given node-set
-.TP
-.B highest()
-returns the nodes in the node-set whose value is the maximum value for the node-set.
-.TP
-.B lowest()
-returns the nodes in the node-set whose value is the minimum value for the node-set.
-.TP
-.B constant()
-returns a number value of the given constant with the given precision. The constants are PI, E, SQRRT2, LN2, LN10, LOG2E, and SQRT1_2.
-.TP
-.B random()
-returns a random number between 0 and 1 inclusive.
-.TP
-.B abs()
-returns the absolute value of the argument.
-.TP
-.B sqrt()
-returns the square root of the argument.
-.TP
-.B power()
-returns the power base and power arguments.
-.TP
-.B log()
-returns the natural log of the argument.
-.TP
-.B sin()
-returns the sine of the argument.
-.TP
-.B cos()
-returns the cosine of the argument.
-.TP
-.B tan()
-returns the tangent of the argument.
-.TP
-.B asin()
-returns the arc sine of the argument.
-.TP
-.B acos()
-returns the arc cosine of the argument.
-.TP
-.B atan()
-returns the arc tangent of the argument.
-.TP
-.B atan2()
-returns the arc tangent function of the y/x arguments.
-.TP
-.B exp()
-returns the exponential function of the argument.
-
-.SS SETS
-.TP 2.2i
-Namespace: http://exslt.org/sets
-.TP 2.2i
-See http://www.exslt.org/set/index.html for a description.
-.TP 2.2i
-.B difference()
-returns the difference between the two given node-sets.
-.TP
-.B intersection()
-returns a node-set of the nodes within both given node-sets.
-.TP
-.B distinct()
-returns a node-set of all nodes in the first argument that are not in the seconds argument.
-.TP
-.B has-same-node()
-returns TRUE if there is an intersection between the two given node-sets.
-.TP
-.B leading()
-returns a node-set of all nodes in the first argument that precede the first node in the second argument.
-.TP
-.B trailing()
-returns a node-set of all nodes in the first argument that follow the first node in the second argument.
-
-.SS "DATES and TIMES"
-.TP 2.2i
-Namespace: http://exslt.org/dates-and-times
-.TP 2.2i
-See http://www.exslt.org/date/date.html for a description.
-.TP 2.2i
-.B date-time()
-returns the current date and time as a date/time string.
-.TP
-.B date()
-returns the date specified in the given date/time string.
-.TP
-.B time()
-returns the time specified in the date/time string given as the argument.
-.TP
-.B year()
-returns the year of a date as a number.
-.TP
-.B leap-year()
-returns true if the year given in a date is a leap year.
-.TP
-.B month-in-year()
-returns the month of a date as a number.
-.TP
-.B month-name()
-returns the full name of the month of a date.
-.TP
-.B month-abbreviation()
-returns the abbreviation of the month of a date.
-.TP
-.B week-in-year()
-returns the week of the year as a number.
-.TP
-.B week-in-month()
-returns the week in a month of a date as a number.
-.TP
-.B day-in-year()
-returns the month of a date as a number.
-.TP
-.B day-in-month()
-returns the day of a date as a number.
-.TP
-.B day-of-week-in-month()
-returns the day-of-the-week in a month of a date as a number.
-.TP
-.B day-in-week()
-returns the day of the week given in a date as a number.
-.TP
-.B day-name()
-returns the full name of the day of the week of a date.
-.TP
-.B day-abbreviation()
-returns the abbreviation of the day of the week of a date.
-.TP
-.B hour-in-day()
-returns the hour of the day as a number.
-.TP
-.B minute-in-hour()
-returns the minute of the hour as a number.
-.TP
-.B second-in-minute()
-returns the second of the minute as a number.
-.TP
-.B seconds()
-returns the number of seconds specified by the argument string.
-.TP
-.B add()
-returns the date/time resulting from adding a duration to a date/time. 
-.TP
-.B add-duration()
-returns the duration resulting from adding two given durations together. 
-.TP
-.B difference()
-returns the duration between the first date and the second date.
-.TP
-.B duration()
-returns a duration string that represents the given number of seconds since 1970-01-01T00:00:00.
-
-.SS STRINGS
-.TP 2.2i
-Namespace: http://exslt.org/strings
-.TP 2.2i
-See http://www.exslt.org/str/index.html for a description.
-.TP 2.2i
-.B tokenize()
-returns a node set of token elements, each containing one token from the string.
-.TP
-.B padding()
-returns a string padded to a certain length.
-.TP
-.B align()
-returns a string aligned within another string.
-.TP
-.B concat()
-returns the concatenation of the string values of the nodes in that node set.
-
-.SS FUNCTIONS
-.TP 2.2i
-Namespace: http://exslt.org/functions
-.TP 2.2i
-See http://www.exslt.org/func/index.html for a description.
-.TP 2.2i
-.B function
-declares an extension function.
-.TP
-.B result
-returns the result of an extension function declared in function().
-.SH FILES
-.TP
-.I /usr/bin/xslt-config
-shell script giving pre-processor and linker flags.
-.TP
-.I /usr/lib/libexslt.a
-static library
-.TP
-.I /usr/lib/libexslt.so
-sharable library
-.SH AUTHORS
-Manual page by Heiko W. Rupp (hwr@pilhuhn.de)
-.SH "SEE ALSO"
-.BR libxml (3), 
-.BR libxslt (3), 
-.BR xmllint (1)
-.BR xsltproc (1), 
-.\" end of manual page
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/libexslt.h	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
- * libexslt.h: internal header only used during the compilation of libexslt
- *
- * See COPYRIGHT for the status of this software
- *
- * Author: daniel@veillard.com
- */
-
-#ifndef __XSLT_LIBEXSLT_H__
-#define __XSLT_LIBEXSLT_H__
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && !defined (__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxslt/xsltconfig.h>
-#include <libxml/xmlversion.h>
-
-#if !defined LIBEXSLT_PUBLIC
-#if (defined (__CYGWIN__) || defined _MSC_VER) && !defined IN_LIBEXSLT && !defined LIBEXSLT_STATIC
-#define LIBEXSLT_PUBLIC __declspec(dllimport)
-#else
-#define LIBEXSLT_PUBLIC
-#endif
-#endif
-
-#endif /* ! __XSLT_LIBEXSLT_H__ */
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/math.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1202 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#ifdef HAVE_MATH_H
-#include <math.h>
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
-#include "exslt.h"
-
-/**
- * exsltMathMin:
- * @ns:  a node-set
- *
- * Implements the EXSLT - Math min() function:
- *    number math:min (node-set)
- *
- * Returns the minimum value of the nodes passed as the argument, or
- *         xmlXPathNAN if @ns is NULL or empty or if one of the nodes
- *         turns into NaN.
- */
-static double
-exsltMathMin (xmlNodeSetPtr ns) {
-    double ret, cur;
-    int i;
-
-    if ((ns == NULL) || (ns->nodeNr == 0))
-    return(xmlXPathNAN);
-    ret = xmlXPathCastNodeToNumber(ns->nodeTab[0]);
-    if (xmlXPathIsNaN(ret))
-    return(xmlXPathNAN);
-    for (i = 1; i < ns->nodeNr; i++) {
-    cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]);
-    if (xmlXPathIsNaN(cur))
-        return(xmlXPathNAN);
-    if (cur < ret)
-        ret = cur;
-    }
-    return(ret);
-}
-
-/**
- * exsltMathMinFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathMin for use by the XPath processor.
- */
-static void
-exsltMathMinFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr ns;
-    double ret;
-    void *user = NULL;
-
-    if (nargs != 1) {
-    xsltGenericError(xsltGenericErrorContext,
-             "math:min: invalid number of arguments\n");
-    ctxt->error = XPATH_INVALID_ARITY;
-    return;
-    }
-    /* We need to delay the freeing of value->user */
-    if ((ctxt->value != NULL) && (ctxt->value->boolval != 0)) {
-        user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = NULL;
-    }
-    ns = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathMin(ns);
-
-    xmlXPathFreeNodeSet(ns);
-    if (user != NULL)
-        xmlFreeNodeList((xmlNodePtr)user);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathMax:
- * @ns:  a node-set
- *
- * Implements the EXSLT - Math max() function:
- *    number math:max (node-set)
- *
- * Returns the maximum value of the nodes passed as arguments, or
- *         xmlXPathNAN if @ns is NULL or empty or if one of the nodes
- *         turns into NaN.
- */
-static double
-exsltMathMax (xmlNodeSetPtr ns) {
-    double ret, cur;
-    int i;
-
-    if ((ns == NULL) || (ns->nodeNr == 0))
-    return(xmlXPathNAN);
-    ret = xmlXPathCastNodeToNumber(ns->nodeTab[0]);
-    if (xmlXPathIsNaN(ret))
-    return(xmlXPathNAN);
-    for (i = 1; i < ns->nodeNr; i++) {
-    cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]);
-    if (xmlXPathIsNaN(cur))
-        return(xmlXPathNAN);
-    if (cur > ret)
-        ret = cur;
-    }
-    return(ret);
-}
-
-/**
- * exsltMathMaxFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathMax for use by the XPath processor.
- */
-static void
-exsltMathMaxFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr ns;
-    double ret;
-    void *user = NULL;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    /* We need to delay the freeing of value->user */
-    if ((ctxt->value != NULL) && (ctxt->value->boolval != 0)) {
-    user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = 0;
-    }
-    ns = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathMax(ns);
-
-    xmlXPathFreeNodeSet(ns);
-
-    if (user != NULL)
-        xmlFreeNodeList((xmlNodePtr)user);
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathHighest:
- * @ns:  a node-set
- *
- * Implements the EXSLT - Math highest() function:
- *    node-set math:highest (node-set)
- *
- * Returns the nodes in the node-set whose value is the maximum value
- *         for the node-set.
- */
-static xmlNodeSetPtr
-exsltMathHighest (xmlNodeSetPtr ns) {
-    xmlNodeSetPtr ret = xmlXPathNodeSetCreate(NULL);
-    double max, cur;
-    int i;
-
-    if ((ns == NULL) || (ns->nodeNr == 0))
-    return(ret);
-
-    max = xmlXPathCastNodeToNumber(ns->nodeTab[0]);
-    if (xmlXPathIsNaN(max))
-    return(ret);
-    else
-    xmlXPathNodeSetAddUnique(ret, ns->nodeTab[0]);
-
-    for (i = 1; i < ns->nodeNr; i++) {
-    cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]);
-    if (xmlXPathIsNaN(cur)) {
-        xmlXPathEmptyNodeSet(ret);
-        return(ret);
-    }
-    if (cur < max)
-        continue;
-    if (cur > max) {
-        max = cur;
-        xmlXPathEmptyNodeSet(ret);
-        xmlXPathNodeSetAddUnique(ret, ns->nodeTab[i]);
-        continue;
-    }
-    xmlXPathNodeSetAddUnique(ret, ns->nodeTab[i]);
-    }
-    return(ret);
-}
-
-/**
- * exsltMathHighestFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathHighest for use by the XPath processor
- */
-static void
-exsltMathHighestFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr ns, ret;
-    void *user = NULL;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    /* We need to delay the freeing of value->user */
-    if ((ctxt->value != NULL) && ctxt->value->boolval != 0) {
-        user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = NULL;
-    }
-    ns = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathHighest(ns);
-
-    xmlXPathFreeNodeSet(ns);
-    if (user != NULL)
-        xmlFreeNodeList((xmlNodePtr)user);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/**
- * exsltMathLowest:
- * @ns:  a node-set
- *
- * Implements the EXSLT - Math lowest() function
- *    node-set math:lowest (node-set)
- *
- * Returns the nodes in the node-set whose value is the minimum value
- *         for the node-set.
- */
-static xmlNodeSetPtr
-exsltMathLowest (xmlNodeSetPtr ns) {
-    xmlNodeSetPtr ret = xmlXPathNodeSetCreate(NULL);
-    double min, cur;
-    int i;
-
-    if ((ns == NULL) || (ns->nodeNr == 0))
-    return(ret);
-
-    min = xmlXPathCastNodeToNumber(ns->nodeTab[0]);
-    if (xmlXPathIsNaN(min))
-    return(ret);
-    else
-    xmlXPathNodeSetAddUnique(ret, ns->nodeTab[0]);
-
-    for (i = 1; i < ns->nodeNr; i++) {
-    cur = xmlXPathCastNodeToNumber(ns->nodeTab[i]);
-    if (xmlXPathIsNaN(cur)) {
-        xmlXPathEmptyNodeSet(ret);
-        return(ret);
-    }
-        if (cur > min)
-        continue;
-    if (cur < min) {
-        min = cur;
-        xmlXPathEmptyNodeSet(ret);
-        xmlXPathNodeSetAddUnique(ret, ns->nodeTab[i]);
-            continue;
-    }
-    xmlXPathNodeSetAddUnique(ret, ns->nodeTab[i]);
-    }
-    return(ret);
-}
-
-/**
- * exsltMathLowestFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathLowest for use by the XPath processor
- */
-static void
-exsltMathLowestFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr ns, ret;
-    void *user = NULL;
-
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    /* We need to delay the freeing of value->user */
-    if ((ctxt->value != NULL) && (ctxt->value->boolval != 0)) {
-        user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = NULL;
-    }
-    ns = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathLowest(ns);
-
-    xmlXPathFreeNodeSet(ns);
-    if (user != NULL)
-        xmlFreeNodeList((xmlNodePtr)user);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/* math other functions */
-
-/* constant values */
-#define EXSLT_PI        (const xmlChar *) \
-            "3.1415926535897932384626433832795028841971693993751"
-#define EXSLT_E         (const xmlChar *) \
-            "2.71828182845904523536028747135266249775724709369996"
-#define EXSLT_SQRRT2    (const xmlChar *) \
-            "1.41421356237309504880168872420969807856967187537694"
-#define EXSLT_LN2       (const xmlChar *) \
-            "0.69314718055994530941723212145817656807550013436025"
-#define EXSLT_LN10      (const xmlChar *) \
-            "2.30258509299404568402"
-#define EXSLT_LOG2E     (const xmlChar *) \
-            "1.4426950408889634074"
-#define EXSLT_SQRT1_2   (const xmlChar *) \
-            "0.70710678118654752440"
-
-/**
- * exsltMathConstant
- * @name: string
- * @precision:  number
- *
- * Implements the EXSLT - Math constant function:
- *     number math:constant(string, number)
- *
- * Returns a number value of the given constant with the given precision or
- * xmlXPathNAN if name is unknown.
- * The constants are PI, E, SQRRT2, LN2, LN10, LOG2E, and SQRT1_2
- */
-static double
-exsltMathConstant (xmlChar *name, double precision) {
-    xmlChar *str;
-    double ret;
-
-    if ((name == NULL) || (xmlXPathIsNaN(precision)) || (precision < 1.0)) {
-        return xmlXPathNAN;
-    }
-
-    if (xmlStrEqual(name, BAD_CAST "PI")) {
-        int len = xmlStrlen(EXSLT_PI);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_PI, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "E")) {
-        int len = xmlStrlen(EXSLT_E);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_E, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "SQRRT2")) {
-        int len = xmlStrlen(EXSLT_SQRRT2);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_SQRRT2, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "LN2")) {
-        int len = xmlStrlen(EXSLT_LN2);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_LN2, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "LN10")) {
-        int len = xmlStrlen(EXSLT_LN10);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_LN10, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "LOG2E")) {
-        int len = xmlStrlen(EXSLT_LOG2E);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_LOG2E, 0, len);
-
-    } else if (xmlStrEqual(name, BAD_CAST "SQRT1_2")) {
-        int len = xmlStrlen(EXSLT_SQRT1_2);
-
-        if (precision <= len)
-            len = (int)precision;
-
-        str = xmlStrsub(EXSLT_SQRT1_2, 0, len);
-
-    } else {
-    str = NULL;
-    }
-    if (str == NULL)
-        return xmlXPathNAN;
-    ret = xmlXPathCastStringToNumber(str);
-    xmlFree(str);
-    return ret;
-}
-
-/**
- * exsltMathConstantFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathConstant for use by the XPath processor.
- */
-static void
-exsltMathConstantFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double   ret;
-    xmlChar *name;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    name = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathConstant(name, ret);
-    if (name != NULL)
-    xmlFree(name);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-#if defined(HAVE_STDLIB_H) && defined(RAND_MAX)
-
-/**
- * exsltMathRandom:
- *
- * Implements the EXSLT - Math random() function:
- *    number math:random ()
- *
- * Returns a random number between 0 and 1 inclusive.
- */
-static double
-exsltMathRandom (void) {
-    double ret;
-    int num;
-
-    num = rand();
-    ret = (double)num / (double)RAND_MAX;
-    return(ret);
-}
-
-/**
- * exsltMathRandomFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathRandom for use by the XPath processor.
- */
-static void
-exsltMathRandomFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 0) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    ret = exsltMathRandom();
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-#endif /* defined(HAVE_STDLIB_H) && defined(RAND_MAX) */
-
-#if HAVE_MATH_H
-
-/**
- * exsltMathAbs:
- * @num:  a double
- *
- * Implements the EXSLT - Math abs() function:
- *    number math:abs (number)
- *
- * Returns the absolute value of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathAbs (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = fabs(num);
-    return(ret);
-}
-
-/**
- * exsltMathAbsFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathAbs for use by the XPath processor.
- */
-static void
-exsltMathAbsFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathAbs(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathSqrt:
- * @num:  a double
- *
- * Implements the EXSLT - Math sqrt() function:
- *    number math:sqrt (number)
- *
- * Returns the square root of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathSqrt (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = sqrt(num);
-    return(ret);
-}
-
-/**
- * exsltMathSqrtFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathSqrt for use by the XPath processor.
- */
-static void
-exsltMathSqrtFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathSqrt(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathPower:
- * @base:  a double
- * @power:  a double
- *
- * Implements the EXSLT - Math power() function:
- *    number math:power (number, number)
- *
- * Returns the power base and power arguments, or xmlXPathNAN
- * if either @base or @power is Nan.
- */
-static double
-exsltMathPower (double base, double power) {
-    double ret;
-
-    if ((xmlXPathIsNaN(base) || xmlXPathIsNaN(power)))
-    return(xmlXPathNAN);
-    ret = pow(base, power);
-    return(ret);
-}
-
-/**
- * exsltMathPower:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathPower for use by the XPath processor.
- */
-static void
-exsltMathPowerFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret, base;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    /* power */
-    base = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathPower(base, ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathLog:
- * @num:  a double
- *
- * Implements the EXSLT - Math log() function:
- *    number math:log (number)
- *
- * Returns the natural log of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathLog (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = log(num);
-    return(ret);
-}
-
-/**
- * exsltMathLogFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathLog for use by the XPath processor.
- */
-static void
-exsltMathLogFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathLog(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathSin:
- * @num:  a double
- *
- * Implements the EXSLT - Math sin() function:
- *    number math:sin (number)
- *
- * Returns the sine of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathSin (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = sin(num);
-    return(ret);
-}
-
-/**
- * exsltMathSinFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathSin for use by the XPath processor.
- */
-static void
-exsltMathSinFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathSin(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathCos:
- * @num:  a double
- *
- * Implements the EXSLT - Math cos() function:
- *    number math:cos (number)
- *
- * Returns the cosine of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathCos (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = cos(num);
-    return(ret);
-}
-
-/**
- * exsltMathCosFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathCos for use by the XPath processor.
- */
-static void
-exsltMathCosFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathCos(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathTan:
- * @num:  a double
- *
- * Implements the EXSLT - Math tan() function:
- *    number math:tan (number)
- *
- * Returns the tangent of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathTan (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = tan(num);
-    return(ret);
-}
-
-/**
- * exsltMathTanFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathTan for use by the XPath processor.
- */
-static void
-exsltMathTanFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathTan(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathAsin:
- * @num:  a double
- *
- * Implements the EXSLT - Math asin() function:
- *    number math:asin (number)
- *
- * Returns the arc sine of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathAsin (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = asin(num);
-    return(ret);
-}
-
-/**
- * exsltMathAsinFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathAsin for use by the XPath processor.
- */
-static void
-exsltMathAsinFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathAsin(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathAcos:
- * @num:  a double
- *
- * Implements the EXSLT - Math acos() function:
- *    number math:acos (number)
- *
- * Returns the arc cosine of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathAcos (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = acos(num);
-    return(ret);
-}
-
-/**
- * exsltMathAcosFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathAcos for use by the XPath processor.
- */
-static void
-exsltMathAcosFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathAcos(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathAtan:
- * @num:  a double
- *
- * Implements the EXSLT - Math atan() function:
- *    number math:atan (number)
- *
- * Returns the arc tangent of the argument, or xmlXPathNAN if @num is Nan.
- */
-static double
-exsltMathAtan (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = atan(num);
-    return(ret);
-}
-
-/**
- * exsltMathAtanFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathAtan for use by the XPath processor.
- */
-static void
-exsltMathAtanFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathAtan(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathAtan2:
- * @y:  a double
- * @x:  a double
- *
- * Implements the EXSLT - Math atan2() function:
- *    number math:atan2 (number, number)
- *
- * Returns the arc tangent function of the y/x arguments, or xmlXPathNAN
- * if either @y or @x is Nan.
- */
-static double
-exsltMathAtan2 (double y, double x) {
-    double ret;
-
-    if ((xmlXPathIsNaN(y) || xmlXPathIsNaN(x)))
-    return(xmlXPathNAN);
-    ret = atan2(y, x);
-    return(ret);
-}
-
-/**
- * exsltMathAtan2Function:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathAtan2 for use by the XPath processor.
- */
-static void
-exsltMathAtan2Function (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret, x;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    x = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    /* y */
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathAtan2(ret, x);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-/**
- * exsltMathExp:
- * @num:  a double
- *
- * Implements the EXSLT - Math exp() function:
- *    number math:exp (number)
- *
- * Returns the exponential function of the argument, or xmlXPathNAN if
- * @num is Nan.
- */
-static double
-exsltMathExp (double num) {
-    double ret;
-
-    if (xmlXPathIsNaN(num))
-    return(xmlXPathNAN);
-    ret = exp(num);
-    return(ret);
-}
-
-/**
- * exsltMathExpFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #exsltMathExp for use by the XPath processor.
- */
-static void
-exsltMathExpFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    double ret;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-    ret = xmlXPathPopNumber(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    ret = exsltMathExp(ret);
-
-    xmlXPathReturnNumber(ctxt, ret);
-}
-
-#endif /* HAVE_MATH_H */
-
-/**
- * exsltMathRegister:
- *
- * Registers the EXSLT - Math module
- */
-
-void
-exsltMathRegister (void) {
-    xsltRegisterExtModuleFunction ((const xmlChar *) "min",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathMinFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "max",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathMaxFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "highest",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathHighestFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "lowest",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathLowestFunction);
-    /* register other math functions */
-    xsltRegisterExtModuleFunction ((const xmlChar *) "constant",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathConstantFunction);
-#ifdef HAVE_STDLIB_H
-    xsltRegisterExtModuleFunction ((const xmlChar *) "random",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathRandomFunction);
-#endif
-#if HAVE_MATH_H
-    xsltRegisterExtModuleFunction ((const xmlChar *) "abs",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathAbsFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "sqrt",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathSqrtFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "power",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathPowerFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "log",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathLogFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "sin",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathSinFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "cos",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathCosFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "tan",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathTanFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "asin",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathAsinFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "acos",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathAcosFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "atan",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathAtanFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "atan2",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathAtan2Function);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "exp",
-                   EXSLT_MATH_NAMESPACE,
-                   exsltMathExpFunction);
-#endif
-}
-
-/**
- * exsltMathXpathCtxtRegister:
- *
- * Registers the EXSLT - Math module for use outside XSLT
- */
-int
-exsltMathXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
-{
-    if (ctxt
-        && prefix
-        && !xmlXPathRegisterNs(ctxt,
-                               prefix,
-                               (const xmlChar *) EXSLT_MATH_NAMESPACE)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "min",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathMinFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "max",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathMaxFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "highest",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathHighestFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "lowest",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathLowestFunction)
-#ifdef HAVE_STDLIB_H
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "random",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathRandomFunction)
-#endif
-#if HAVE_MATH_H
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "abs",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathAbsFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "sqrt",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathSqrtFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "power",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathPowerFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "log",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathLogFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "sin",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathSinFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "cos",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathCosFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "tan",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathTanFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "asin",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathAsinFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "acos",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathAcosFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "atan",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathAtanFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "atan2",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathAtan2Function)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "exp",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathExpFunction)
-#endif
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "constant",
-                                   (const xmlChar *) EXSLT_MATH_NAMESPACE,
-                                   exsltMathConstantFunction)) {
-        return 0;
-    }
-    return -1;
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/saxon.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,313 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/parser.h>
-#include <libxml/hash.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-/**
- * exsltSaxonInit:
- * @ctxt: an XSLT transformation context
- * @URI: the namespace URI for the extension
- *
- * Initializes the SAXON module.
- *
- * Returns the data for this transformation
- */
-static xmlHashTablePtr
-exsltSaxonInit (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
-        const xmlChar *URI ATTRIBUTE_UNUSED) {
-    return xmlHashCreate(1);
-}
-
-/**
- * exsltSaxonShutdown:
- * @ctxt: an XSLT transformation context
- * @URI: the namespace URI for the extension
- * @data: the module data to free up
- *
- * Shutdown the SAXON extension module
- */
-static void
-exsltSaxonShutdown (xsltTransformContextPtr ctxt ATTRIBUTE_UNUSED,
-            const xmlChar *URI ATTRIBUTE_UNUSED,
-            xmlHashTablePtr data) {
-    xmlHashFree(data, (xmlHashDeallocator) xmlXPathFreeCompExpr);
-}
-
-
-/**
- * exsltSaxonExpressionFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * The supplied string must contain an XPath expression. The result of
- * the function is a stored expression, which may be supplied as an
- * argument to other extension functions such as saxon:eval(),
- * saxon:sum() and saxon:distinct(). The result of the expression will
- * usually depend on the current node. The expression may contain
- * references to variables that are in scope at the point where
- * saxon:expression() is called: these variables will be replaced in
- * the stored expression with the values they take at the time
- * saxon:expression() is called, not the values of the variables at
- * the time the stored expression is evaluated.  Similarly, if the
- * expression contains namespace prefixes, these are interpreted in
- * terms of the namespace declarations in scope at the point where the
- * saxon:expression() function is called, not those in scope where the
- * stored expression is evaluated.
- *
- * TODO: current implementation doesn't conform to SAXON behaviour
- * regarding context and namespaces.
- */
-static void
-exsltSaxonExpressionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlChar *arg;
-    xmlXPathCompExprPtr ret;
-    xmlHashTablePtr hash;
-    xsltTransformContextPtr tctxt = xsltXPathGetTransformContext(ctxt);
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt) || (arg == NULL)) {
-    xmlXPathSetTypeError(ctxt);
-    return;
-    }
-
-    hash = (xmlHashTablePtr) xsltGetExtData(tctxt,
-                        ctxt->context->functionURI);
-
-    ret = xmlHashLookup(hash, arg);
-
-    if (ret == NULL) {
-     ret = xmlXPathCompile(arg);
-     if (ret == NULL) {
-          xmlFree(arg);
-              xmlXPathSetError(ctxt, XPATH_EXPR_ERROR);
-          return;
-     }
-     xmlHashAddEntry(hash, arg, (void *) ret);
-    }
-
-    xmlFree(arg);
-
-    xmlXPathReturnExternal(ctxt, ret);
-}
-
-/**
- * exsltSaxonEvalFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  number of arguments
- *
- * Implements de SAXON eval() function:
- *    object saxon:eval (saxon:stored-expression)
- * Returns the result of evaluating the supplied stored expression.
- * A stored expression may be obtained as the result of calling
- * the saxon:expression() function.
- * The stored expression is evaluated in the current context, that
- * is, the context node is the current node, and the context position
- * and context size are the same as the result of calling position()
- * or last() respectively.
- */
-static void
-exsltSaxonEvalFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-     xmlXPathCompExprPtr expr;
-     xmlXPathObjectPtr ret;
-
-     if (nargs != 1) {
-      xmlXPathSetArityError(ctxt);
-      return;
-     }
-
-     if (!xmlXPathStackIsExternal(ctxt)) {
-      xmlXPathSetTypeError(ctxt);
-      return;
-     }
-
-     expr = (xmlXPathCompExprPtr) xmlXPathPopExternal(ctxt);
-
-     ret = xmlXPathCompiledEval(expr, ctxt->context);
-     if (ret == NULL) {
-      xmlXPathSetError(ctxt, XPATH_EXPR_ERROR);
-      return;
-     }
-
-     valuePush(ctxt, ret);
-}
-
-/**
- * exsltSaxonEvaluateFunction:
- * @ctxt:  an XPath parser context
- * @nargs: number of arguments
- *
- * Implements the SAXON evaluate() function
- *     object saxon:evaluate (string)
- * The supplied string must contain an XPath expression. The result of
- * the function is the result of evaluating the XPath expression. This
- * is useful where an expression needs to be constructed at run-time or
- * passed to the stylesheet as a parameter, for example where the sort
- * key is determined dynamically. The context for the expression (e.g.
- * which variables and namespaces are available) is exactly the same as
- * if the expression were written explicitly at this point in the
- * stylesheet. The function saxon:evaluate(string) is shorthand for
- * saxon:eval(saxon:expression(string)).
- */
-static void
-exsltSaxonEvaluateFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-     if (nargs != 1) {
-      xmlXPathSetArityError(ctxt);
-      return;
-     }
-
-     exsltSaxonExpressionFunction(ctxt, 1);
-     exsltSaxonEvalFunction(ctxt, 1);
-}
-
-/**
- * exsltSaxonSystemIdFunction:
- * @ctxt:  an XPath parser context
- * @nargs: number of arguments
- *
- * Implements the SAXON systemId() function
- *     string saxon:systemId ()
- * This function returns the system ID of the document being styled.
- */
-static void
-exsltSaxonSystemIdFunction(xmlXPathParserContextPtr ctxt, int nargs)
-{
-    if (ctxt == NULL)
-        return;
-    if (nargs != 0) {
-        xmlXPathSetArityError(ctxt);
-        return;
-    }
-
-    if ((ctxt->context) && (ctxt->context->doc) &&
-        (ctxt->context->doc->URL))
-    valuePush(ctxt, xmlXPathNewString(ctxt->context->doc->URL));
-    else
-    valuePush(ctxt, xmlXPathNewString(BAD_CAST ""));
-}
-
-/**
- * exsltSaxonLineNumberFunction:
- * @ctxt:  an XPath parser context
- * @nargs: number of arguments
- *
- * Implements the SAXON line-number() function
- *     integer saxon:line-number()
- *
- * This returns the line number of the context node in the source document
- * within the entity that contains it. There are no arguments. If line numbers
- * are not maintained for the current document, the function returns -1. (To
- * ensure that line numbers are maintained, use the -l option on the command
- * line)
- *
- * The extension has been extended to have the following form:
- *     integer saxon:line-number([node-set-1])
- * If a node-set is given, this extension will return the line number of the
- * node in the argument node-set that is first in document order.
- */
-static void
-exsltSaxonLineNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodePtr cur = NULL;
-    xmlXPathObjectPtr obj = NULL;
-    long lineNo = -1;
-
-    if (nargs == 0) {
-    cur = ctxt->context->node;
-    } else if (nargs == 1) {
-    xmlNodeSetPtr nodelist;
-    int i;
-
-    if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NODESET)) {
-        xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
-        "saxon:line-number() : invalid arg expecting a node-set\n");
-        ctxt->error = XPATH_INVALID_TYPE;
-        return;
-    }
-
-    obj = valuePop(ctxt);
-    nodelist = obj->nodesetval;
-    if ((nodelist != NULL) && (nodelist->nodeNr > 0)) {
-            cur = nodelist->nodeTab[0];
-            for (i = 1;i < nodelist->nodeNr;i++) {
-                int ret = xmlXPathCmpNodes(cur, nodelist->nodeTab[i]);
-                if (ret == -1)
-                    cur = nodelist->nodeTab[i];
-            }
-        }
-    } else {
-    xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
-        "saxon:line-number() : invalid number of args %d\n",
-        nargs);
-    ctxt->error = XPATH_INVALID_ARITY;
-    return;
-    }
-
-    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL)) {
-        /*
-        * The XPath module sets the owner element of a ns-node on
-        * the ns->next field.
-        */
-        cur = (xmlNodePtr) ((xmlNsPtr) cur)->next;
-        if (cur == NULL || cur->type != XML_ELEMENT_NODE) {
-            xsltGenericError(xsltGenericErrorContext,
-                "Internal error in exsltSaxonLineNumberFunction: "
-                "Cannot retrieve the doc of a namespace node.\n");
-            cur = NULL;
-        }
-    }
-
-    if (cur != NULL)
-        lineNo = xmlGetLineNo(cur);
-
-    valuePush(ctxt, xmlXPathNewFloat(lineNo));
-
-    xmlXPathFreeObject(obj);
-}
-
-/**
- * exsltSaxonRegister:
- *
- * Registers the SAXON extension module
- */
-void
-exsltSaxonRegister (void) {
-     xsltRegisterExtModule (SAXON_NAMESPACE,
-                (xsltExtInitFunction) exsltSaxonInit,
-                (xsltExtShutdownFunction) exsltSaxonShutdown);
-     xsltRegisterExtModuleFunction((const xmlChar *) "expression",
-                   SAXON_NAMESPACE,
-                   exsltSaxonExpressionFunction);
-     xsltRegisterExtModuleFunction((const xmlChar *) "eval",
-                   SAXON_NAMESPACE,
-                   exsltSaxonEvalFunction);
-     xsltRegisterExtModuleFunction((const xmlChar *) "evaluate",
-                   SAXON_NAMESPACE,
-                   exsltSaxonEvaluateFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "line-number",
-                   SAXON_NAMESPACE,
-                   exsltSaxonLineNumberFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "systemId",
-                   SAXON_NAMESPACE,
-                   exsltSaxonSystemIdFunction);
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/sets.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-/**
- * exsltSetsDifferenceFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathDifference for use by the XPath processor
- */
-static void
-exsltSetsDifferenceFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr arg1, arg2, ret;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg2 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    arg1 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathFreeNodeSet(arg2);
-    return;
-    }
-
-    ret = xmlXPathDifference(arg1, arg2);
-
-    if (ret != arg1)
-    xmlXPathFreeNodeSet(arg1);
-    xmlXPathFreeNodeSet(arg2);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/**
- * exsltSetsIntersectionFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathIntersection for use by the XPath processor
- */
-static void
-exsltSetsIntersectionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr arg1, arg2, ret;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg2 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    arg1 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathFreeNodeSet(arg2);
-    return;
-    }
-
-    ret = xmlXPathIntersection(arg1, arg2);
-
-    xmlXPathFreeNodeSet(arg1);
-    xmlXPathFreeNodeSet(arg2);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/**
- * exsltSetsDistinctFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathDistinct for use by the XPath processor
- */
-static void
-exsltSetsDistinctFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlXPathObjectPtr obj;
-    xmlNodeSetPtr ns, ret;
-    int boolval = 0;
-    void *user = NULL;
-
-    if (nargs != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (ctxt->value != NULL) {
-        boolval = ctxt->value->boolval;
-    user = ctxt->value->user;
-    ctxt->value->boolval = 0;
-    ctxt->value->user = NULL;
-    }
-    ns = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    /* !!! must be sorted !!! */
-    ret = xmlXPathDistinctSorted(ns);
-
-    if (ret != ns)
-        xmlXPathFreeNodeSet(ns);
-
-    obj = xmlXPathWrapNodeSet(ret);
-    obj->user = user;
-    obj->boolval = boolval;
-    valuePush((ctxt), obj);
-}
-
-/**
- * exsltSetsHasSameNodesFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathHasSameNodes for use by the XPath processor
- */
-static void
-exsltSetsHasSameNodesFunction (xmlXPathParserContextPtr ctxt,
-                  int nargs) {
-    xmlNodeSetPtr arg1, arg2;
-    int ret;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg2 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    arg1 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-        xmlXPathFreeNodeSet(arg2);
-    return;
-    }
-
-    ret = xmlXPathHasSameNodes(arg1, arg2);
-
-    xmlXPathFreeNodeSet(arg1);
-    xmlXPathFreeNodeSet(arg2);
-
-    xmlXPathReturnBoolean(ctxt, ret);
-}
-
-/**
- * exsltSetsLeadingFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathLeading for use by the XPath processor
- */
-static void
-exsltSetsLeadingFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr arg1, arg2, ret;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg2 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    arg1 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-    xmlXPathFreeNodeSet(arg2);
-    return;
-    }
-
-    /*  If the second node set is empty, then the first node set is
-     * returned.
-     */
-    if (xmlXPathNodeSetIsEmpty(arg2)) {
-    xmlXPathReturnNodeSet(ctxt, arg1);
-
-    xmlXPathFreeNodeSet(arg2);
-
-    return;
-    }
-    /* !!! must be sorted */
-    ret = xmlXPathNodeLeadingSorted(arg1, xmlXPathNodeSetItem(arg2, 0));
-
-    xmlXPathFreeNodeSet(arg1);
-    xmlXPathFreeNodeSet(arg2);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/**
- * exsltSetsTrailingFunction:
- * @ctxt:  an XPath parser context
- * @nargs:  the number of arguments
- *
- * Wraps #xmlXPathTrailing for use by the XPath processor
- */
-static void
-exsltSetsTrailingFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlNodeSetPtr arg1, arg2, ret;
-
-    if (nargs != 2) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    arg2 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt))
-    return;
-
-    arg1 = xmlXPathPopNodeSet(ctxt);
-    if (xmlXPathCheckError(ctxt)) {
-    xmlXPathFreeNodeSet(arg2);
-    return;
-    }
-
-    /*  If the second node set is empty, then the first node set is
-     * returned.
-     */
-    if (xmlXPathNodeSetIsEmpty(arg2)) {
-    xmlXPathReturnNodeSet(ctxt, arg1);
-
-    xmlXPathFreeNodeSet(arg2);
-
-    return;
-    }
-    /* !!! mist be sorted */
-    ret = xmlXPathNodeTrailingSorted(arg1, xmlXPathNodeSetItem(arg2, 0));
-
-    xmlXPathFreeNodeSet(arg1);
-    xmlXPathFreeNodeSet(arg2);
-
-    xmlXPathReturnNodeSet(ctxt, ret);
-}
-
-/**
- * exsltSetsRegister:
- *
- * Registers the EXSLT - Sets module
- */
-
-void
-exsltSetsRegister (void) {
-    xsltRegisterExtModuleFunction ((const xmlChar *) "difference",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsDifferenceFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "intersection",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsIntersectionFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "distinct",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsDistinctFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "has-same-node",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsHasSameNodesFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "leading",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsLeadingFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "trailing",
-                   EXSLT_SETS_NAMESPACE,
-                   exsltSetsTrailingFunction);
-}
-
-/**
- * exsltSetsXpathCtxtRegister:
- *
- * Registers the EXSLT - Sets module for use outside XSLT
- */
-int
-exsltSetsXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
-{
-    if (ctxt
-        && prefix
-        && !xmlXPathRegisterNs(ctxt,
-                               prefix,
-                               (const xmlChar *) EXSLT_SETS_NAMESPACE)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "difference",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsDifferenceFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "intersection",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsIntersectionFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "distinct",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsDistinctFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "has-same-node",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsHasSameNodesFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "leading",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsLeadingFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "trailing",
-                                   (const xmlChar *) EXSLT_SETS_NAMESPACE,
-                                   exsltSetsTrailingFunction)) {
-        return 0;
-    }
-    return -1;
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libexslt/strings.c	Fri Mar 22 08:11:38 2019 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,891 +0,0 @@
-#define IN_LIBEXSLT
-#include "libexslt/libexslt.h"
-
-#if defined(_WIN32) && !defined (__CYGWIN__) && (!__MINGW32__)
-#include <win32config.h>
-#else
-#include "config.h"
-#endif
-
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/parser.h>
-#include <libxml/encoding.h>
-#include <libxml/uri.h>
-
-#include <libxslt/xsltconfig.h>
-#include <libxslt/xsltutils.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/extensions.h>
-
-#include "exslt.h"
-
-/**
- * exsltStrTokenizeFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Splits up a string on the characters of the delimiter string and returns a
- * node set of token elements, each containing one token from the string.
- */
-static void
-exsltStrTokenizeFunction(xmlXPathParserContextPtr ctxt, int nargs)
-{
-    xsltTransformContextPtr tctxt;
-    xmlChar *str, *delimiters, *cur;
-    const xmlChar *token, *delimiter;
-    xmlNodePtr node;
-    xmlDocPtr container;
-    xmlXPathObjectPtr ret = NULL;
-    int clen;
-
-    if ((nargs < 1) || (nargs > 2)) {
-        xmlXPathSetArityError(ctxt);
-        return;
-    }
-
-    if (nargs == 2) {
-        delimiters = xmlXPathPopString(ctxt);
-        if (xmlXPathCheckError(ctxt))
-            return;
-    } else {
-        delimiters = xmlStrdup((const xmlChar *) "\t\r\n ");
-    }
-    if (delimiters == NULL)
-        return;
-
-    str = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt) || (str == NULL)) {
-        xmlFree(delimiters);
-        return;
-    }
-
-    /* Return a result tree fragment */
-    tctxt = xsltXPathGetTransformContext(ctxt);
-    if (tctxt == NULL) {
-        xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
-          "exslt:tokenize : internal error tctxt == NULL\n");
-    goto fail;
-    }
-
-    container = xsltCreateRVT(tctxt);
-    if (container != NULL) {
-        xsltRegisterLocalRVT(tctxt, container);
-        ret = xmlXPathNewNodeSet(NULL);
-        if (ret != NULL) {
-            for (cur = str, token = str; *cur != 0; cur += clen) {
-            clen = xmlUTF8Strsize(cur, 1);
-        if (*delimiters == 0) { /* empty string case */
-            xmlChar ctmp;
-            ctmp = *(cur+clen);
-            *(cur+clen) = 0;
-                    node = xmlNewDocRawNode(container, NULL,
-                                       (const xmlChar *) "token", cur);
-            xmlAddChild((xmlNodePtr) container, node);
-            xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-                    *(cur+clen) = ctmp; /* restore the changed byte */
-                    token = cur + clen;
-                } else for (delimiter = delimiters; *delimiter != 0;
-                delimiter += xmlUTF8Strsize(delimiter, 1)) {
-                    if (!xmlUTF8Charcmp(cur, delimiter)) {
-                        if (cur == token) {
-                            /* discard empty tokens */
-                            token = cur + clen;
-                            break;
-                        }
-                        *cur = 0;   /* terminate the token */
-                        node = xmlNewDocRawNode(container, NULL,
-                                           (const xmlChar *) "token", token);
-            xmlAddChild((xmlNodePtr) container, node);
-            xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-                        *cur = *delimiter; /* restore the changed byte */
-                        token = cur + clen;
-                        break;
-                    }
-                }
-            }
-            if (token != cur) {
-        node = xmlNewDocRawNode(container, NULL,
-                    (const xmlChar *) "token", token);
-                xmlAddChild((xmlNodePtr) container, node);
-            xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-            }
-        }
-    }
-
-fail:
-    if (str != NULL)
-        xmlFree(str);
-    if (delimiters != NULL)
-        xmlFree(delimiters);
-    if (ret != NULL)
-        valuePush(ctxt, ret);
-    else
-        valuePush(ctxt, xmlXPathNewNodeSet(NULL));
-}
-
-/**
- * exsltStrSplitFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Splits up a string on a delimiting string and returns a node set of token
- * elements, each containing one token from the string.
- */
-static void
-exsltStrSplitFunction(xmlXPathParserContextPtr ctxt, int nargs) {
-    xsltTransformContextPtr tctxt;
-    xmlChar *str, *delimiter, *cur;
-    const xmlChar *token;
-    xmlNodePtr node;
-    xmlDocPtr container;
-    xmlXPathObjectPtr ret = NULL;
-    int delimiterLength;
-
-    if ((nargs < 1) || (nargs > 2)) {
-        xmlXPathSetArityError(ctxt);
-        return;
-    }
-
-    if (nargs == 2) {
-        delimiter = xmlXPathPopString(ctxt);
-        if (xmlXPathCheckError(ctxt))
-            return;
-    } else {
-        delimiter = xmlStrdup((const xmlChar *) " ");
-    }
-    if (delimiter == NULL)
-        return;
-    delimiterLength = xmlStrlen (delimiter);
-
-    str = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt) || (str == NULL)) {
-        xmlFree(delimiter);
-        return;
-    }
-
-    /* Return a result tree fragment */
-    tctxt = xsltXPathGetTransformContext(ctxt);
-    if (tctxt == NULL) {
-        xsltTransformError(xsltXPathGetTransformContext(ctxt), NULL, NULL,
-          "exslt:tokenize : internal error tctxt == NULL\n");
-    goto fail;
-    }
-
-    /*
-    * OPTIMIZE TODO: We are creating an xmlDoc for every split!
-    */
-    container = xsltCreateRVT(tctxt);
-    if (container != NULL) {
-        xsltRegisterLocalRVT(tctxt, container);
-        ret = xmlXPathNewNodeSet(NULL);
-        if (ret != NULL) {
-            for (cur = str, token = str; *cur != 0; cur++) {
-        if (delimiterLength == 0) {
-            if (cur != token) {
-            xmlChar tmp = *cur;
-            *cur = 0;
-                        node = xmlNewDocRawNode(container, NULL,
-                                           (const xmlChar *) "token", token);
-            xmlAddChild((xmlNodePtr) container, node);
-            xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-            *cur = tmp;
-            token++;
-            }
-        }
-        else if (!xmlStrncasecmp(cur, delimiter, delimiterLength)) {
-            if (cur == token) {
-            /* discard empty tokens */
-            cur = cur + delimiterLength - 1;
-            token = cur + 1;
-            continue;
-            }
-            *cur = 0;
-            node = xmlNewDocRawNode(container, NULL,
-                       (const xmlChar *) "token", token);
-            xmlAddChild((xmlNodePtr) container, node);
-            xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-            *cur = *delimiter;
-            cur = cur + delimiterLength - 1;
-            token = cur + 1;
-                }
-            }
-        if (token != cur) {
-        node = xmlNewDocRawNode(container, NULL,
-                   (const xmlChar *) "token", token);
-        xmlAddChild((xmlNodePtr) container, node);
-        xmlXPathNodeSetAddUnique(ret->nodesetval, node);
-        }
-        }
-    }
-
-fail:
-    if (str != NULL)
-        xmlFree(str);
-    if (delimiter != NULL)
-        xmlFree(delimiter);
-    if (ret != NULL)
-        valuePush(ctxt, ret);
-    else
-        valuePush(ctxt, xmlXPathNewNodeSet(NULL));
-}
-
-/**
- * exsltStrEncodeUriFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * URI-Escapes a string
- */
-static void
-exsltStrEncodeUriFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    int escape_all = 1, str_len = 0;
-    xmlChar *str = NULL, *ret = NULL, *tmp;
-
-    if ((nargs < 2) || (nargs > 3)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs >= 3) {
-        /* check for UTF-8 if encoding was explicitly given;
-           we don't support anything else yet */
-        tmp = xmlXPathPopString(ctxt);
-        if (xmlUTF8Strlen(tmp) != 5 || xmlStrcmp((const xmlChar *)"UTF-8",tmp)) {
-        xmlXPathReturnEmptyString(ctxt);
-        xmlFree(tmp);
-        return;
-    }
-    xmlFree(tmp);
-    }
-
-    escape_all = xmlXPathPopBoolean(ctxt);
-
-    str = xmlXPathPopString(ctxt);
-    str_len = xmlUTF8Strlen(str);
-
-    if (str_len <= 0) {
-        if (str_len < 0)
-            xsltGenericError(xsltGenericErrorContext,
-                             "exsltStrEncodeUriFunction: invalid UTF-8\n");
-    xmlXPathReturnEmptyString(ctxt);
-    xmlFree(str);
-    return;
-    }
-
-    ret = xmlURIEscapeStr(str,(const xmlChar *)(escape_all?"-_.!~*'()":"-_.!~*'();/?:@&=+$,[]"));
-    xmlXPathReturnString(ctxt, ret);
-
-    if (str != NULL)
-    xmlFree(str);
-}
-
-/**
- * exsltStrDecodeUriFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * reverses URI-Escaping of a string
- */
-static void
-exsltStrDecodeUriFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    int str_len = 0;
-    xmlChar *str = NULL, *ret = NULL, *tmp;
-
-    if ((nargs < 1) || (nargs > 2)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs >= 2) {
-        /* check for UTF-8 if encoding was explicitly given;
-           we don't support anything else yet */
-        tmp = xmlXPathPopString(ctxt);
-        if (xmlUTF8Strlen(tmp) != 5 || xmlStrcmp((const xmlChar *)"UTF-8",tmp)) {
-        xmlXPathReturnEmptyString(ctxt);
-        xmlFree(tmp);
-        return;
-    }
-    xmlFree(tmp);
-    }
-
-    str = xmlXPathPopString(ctxt);
-    str_len = xmlUTF8Strlen(str);
-
-    if (str_len <= 0) {
-        if (str_len < 0)
-            xsltGenericError(xsltGenericErrorContext,
-                             "exsltStrDecodeUriFunction: invalid UTF-8\n");
-    xmlXPathReturnEmptyString(ctxt);
-    xmlFree(str);
-    return;
-    }
-
-    ret = (xmlChar *) xmlURIUnescapeString((const char *)str,0,NULL);
-    if (!xmlCheckUTF8(ret)) {
-    /* FIXME: instead of throwing away the whole URI, we should
-        only discard the invalid sequence(s). How to do that? */
-    xmlXPathReturnEmptyString(ctxt);
-    xmlFree(str);
-    xmlFree(ret);
-    return;
-    }
-
-    xmlXPathReturnString(ctxt, ret);
-
-    if (str != NULL)
-    xmlFree(str);
-}
-
-/**
- * exsltStrPaddingFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Creates a padding string of a certain length.
- */
-static void
-exsltStrPaddingFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    int number, str_len = 0, str_size = 0;
-    double floatval;
-    xmlChar *str = NULL;
-    xmlBufferPtr buf;
-
-    if ((nargs < 1) || (nargs > 2)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 2) {
-    str = xmlXPathPopString(ctxt);
-    str_len = xmlUTF8Strlen(str);
-    str_size = xmlStrlen(str);
-    }
-
-    floatval = xmlXPathPopNumber(ctxt);
-
-    if (str_len <= 0) {
-        if (str_len < 0) {
-            xsltGenericError(xsltGenericErrorContext,
-                             "exsltStrPaddingFunction: invalid UTF-8\n");
-            xmlXPathReturnEmptyString(ctxt);
-            xmlFree(str);
-            return;
-        }
-    if (str != NULL) xmlFree(str);
-    str = xmlStrdup((const xmlChar *) " ");
-    str_len = 1;
-    str_size = 1;
-    }
-
-    if (xmlXPathIsNaN(floatval) || floatval < 0.0) {
-        number = 0;
-    } else if (floatval >= 100000.0) {
-        number = 100000;
-    }
-    else {
-        number = (int) floatval;
-    }
-
-    if (number <= 0) {
-    xmlXPathReturnEmptyString(ctxt);
-    xmlFree(str);
-    return;
-    }
-
-    buf = xmlBufferCreateSize(number);
-    if (buf == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-    xmlFree(str);
-    return;
-    }
-    xmlBufferSetAllocationScheme(buf, XML_BUFFER_ALLOC_DOUBLEIT);
-
-    while (number >= str_len) {
-        xmlBufferAdd(buf, str, str_size);
-    number -= str_len;
-    }
-    if (number > 0) {
-    str_size = xmlUTF8Strsize(str, number);
-        xmlBufferAdd(buf, str, str_size);
-    }
-
-    xmlXPathReturnString(ctxt, xmlBufferDetach(buf));
-
-    xmlBufferFree(buf);
-    if (str != NULL)
-    xmlFree(str);
-}
-
-/**
- * exsltStrAlignFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Aligns a string within another string.
- */
-static void
-exsltStrAlignFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlChar *str, *padding, *alignment, *ret;
-    int str_l, padding_l;
-
-    if ((nargs < 2) || (nargs > 3)) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (nargs == 3)
-    alignment = xmlXPathPopString(ctxt);
-    else
-    alignment = NULL;
-
-    padding = xmlXPathPopString(ctxt);
-    str = xmlXPathPopString(ctxt);
-
-    str_l = xmlUTF8Strlen (str);
-    padding_l = xmlUTF8Strlen (padding);
-
-    if (str_l < 0 || padding_l < 0) {
-        xsltGenericError(xsltGenericErrorContext,
-                         "exsltStrAlignFunction: invalid UTF-8\n");
-        xmlXPathReturnEmptyString(ctxt);
-        xmlFree(str);
-        xmlFree(padding);
-        xmlFree(alignment);
-        return;
-    }
-
-    if (str_l == padding_l) {
-    xmlXPathReturnString (ctxt, str);
-    xmlFree(padding);
-    xmlFree(alignment);
-    return;
-    }
-
-    if (str_l > padding_l) {
-    ret = xmlUTF8Strndup (str, padding_l);
-    } else {
-    if (xmlStrEqual(alignment, (const xmlChar *) "right")) {
-        ret = xmlUTF8Strndup (padding, padding_l - str_l);
-        ret = xmlStrcat (ret, str);
-    } else if (xmlStrEqual(alignment, (const xmlChar *) "center")) {
-        int left = (padding_l - str_l) / 2;
-        int right_start;
-
-        ret = xmlUTF8Strndup (padding, left);
-        ret = xmlStrcat (ret, str);
-
-        right_start = xmlUTF8Strsize (padding, left + str_l);
-        ret = xmlStrcat (ret, padding + right_start);
-    } else {
-        int str_s;
-
-        str_s = xmlUTF8Strsize(padding, str_l);
-        ret = xmlStrdup (str);
-        ret = xmlStrcat (ret, padding + str_s);
-    }
-    }
-
-    xmlXPathReturnString (ctxt, ret);
-
-    xmlFree(str);
-    xmlFree(padding);
-    xmlFree(alignment);
-}
-
-/**
- * exsltStrConcatFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Takes a node set and returns the concatenation of the string values
- * of the nodes in that node set.  If the node set is empty, it
- * returns an empty string.
- */
-static void
-exsltStrConcatFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    xmlXPathObjectPtr obj;
-    xmlBufferPtr buf;
-    int i;
-
-    if (nargs  != 1) {
-    xmlXPathSetArityError(ctxt);
-    return;
-    }
-
-    if (!xmlXPathStackIsNodeSet(ctxt)) {
-    xmlXPathSetTypeError(ctxt);
-    return;
-    }
-
-    obj = valuePop (ctxt);
-
-    if (xmlXPathNodeSetIsEmpty(obj->nodesetval)) {
-        xmlXPathFreeObject(obj);
-    xmlXPathReturnEmptyString(ctxt);
-    return;
-    }
-
-    buf = xmlBufferCreate();
-    if (buf == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        xmlXPathFreeObject(obj);
-    return;
-    }
-    xmlBufferSetAllocationScheme(buf, XML_BUFFER_ALLOC_DOUBLEIT);
-
-    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
-    xmlChar *tmp;
-    tmp = xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
-
-        xmlBufferCat(buf, tmp);
-
-    xmlFree(tmp);
-    }
-
-    xmlXPathFreeObject (obj);
-
-    xmlXPathReturnString(ctxt, xmlBufferDetach(buf));
-    xmlBufferFree(buf);
-}
-
-/**
- * exsltStrReturnString:
- * @ctxt: an XPath parser context
- * @str: a string
- * @len: length of string
- *
- * Returns a string as a node set.
- */
-static int
-exsltStrReturnString(xmlXPathParserContextPtr ctxt, const xmlChar *str,
-                     int len)
-{
-    xsltTransformContextPtr tctxt = xsltXPathGetTransformContext(ctxt);
-    xmlDocPtr container;
-    xmlNodePtr text_node;
-    xmlXPathObjectPtr ret;
-
-    container = xsltCreateRVT(tctxt);
-    if (container == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        return(-1);
-    }
-    xsltRegisterLocalRVT(tctxt, container);
-
-    text_node = xmlNewTextLen(str, len);
-    if (text_node == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        return(-1);
-    }
-    xmlAddChild((xmlNodePtr) container, text_node);
-
-    ret = xmlXPathNewNodeSet(text_node);
-    if (ret == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        return(-1);
-    }
-
-    valuePush(ctxt, ret);
-
-    return(0);
-}
-
-/**
- * exsltStrReplaceFunction:
- * @ctxt: an XPath parser context
- * @nargs: the number of arguments
- *
- * Takes a string, and two node sets and returns the string with all strings in
- * the first node set replaced by all strings in the second node set.
- */
-static void
-exsltStrReplaceFunction (xmlXPathParserContextPtr ctxt, int nargs) {
-    int i, i_empty, n, slen0, rlen0, *slen, *rlen;
-    void *mem = NULL;
-    const xmlChar *src, *start;
-    xmlChar *string, *search_str = NULL, *replace_str = NULL;
-    xmlChar **search, **replace;
-    xmlNodeSetPtr search_set = NULL, replace_set = NULL;
-    xmlBufferPtr buf;
-
-    if (nargs  != 3) {
-        xmlXPathSetArityError(ctxt);
-        return;
-    }
-
-    /* get replace argument */
-
-    if (!xmlXPathStackIsNodeSet(ctxt))
-        replace_str = xmlXPathPopString(ctxt);
-    else
-        replace_set = xmlXPathPopNodeSet(ctxt);
-
-    if (xmlXPathCheckError(ctxt))
-        goto fail_replace;
-
-    /* get search argument */
-
-    if (!xmlXPathStackIsNodeSet(ctxt)) {
-        search_str = xmlXPathPopString(ctxt);
-        n = 1;
-    }
-    else {
-        search_set = xmlXPathPopNodeSet(ctxt);
-        n = search_set != NULL ? search_set->nodeNr : 0;
-    }
-
-    if (xmlXPathCheckError(ctxt))
-        goto fail_search;
-
-    /* get string argument */
-
-    string = xmlXPathPopString(ctxt);
-    if (xmlXPathCheckError(ctxt))
-        goto fail_string;
-
-    /* check for empty search node list */
-
-    if (n <= 0) {
-        exsltStrReturnString(ctxt, string, xmlStrlen(string));
-        goto done_empty_search;
-    }
-
-    /* allocate memory for string pointer and length arrays */
-
-    if (n == 1) {
-        search = &search_str;
-        replace = &replace_str;
-        slen = &slen0;
-        rlen = &rlen0;
-    }
-    else {
-        mem = xmlMalloc(2 * n * (sizeof(const xmlChar *) + sizeof(int)));
-        if (mem == NULL) {
-            xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-            goto fail_malloc;
-        }
-        search = (xmlChar **) mem;
-        replace = search + n;
-        slen = (int *) (replace + n);
-        rlen = slen + n;
-    }
-
-    /* process arguments */
-
-    i_empty = -1;
-
-    for (i=0; i<n; ++i) {
-        if (search_set != NULL) {
-            search[i] = xmlXPathCastNodeToString(search_set->nodeTab[i]);
-            if (search[i] == NULL) {
-                n = i;
-                goto fail_process_args;
-            }
-        }
-
-        slen[i] = xmlStrlen(search[i]);
-        if (i_empty < 0 && slen[i] == 0)
-            i_empty = i;
-
-        if (replace_set != NULL) {
-            if (i < replace_set->nodeNr) {
-                replace[i] = xmlXPathCastNodeToString(replace_set->nodeTab[i]);
-                if (replace[i] == NULL) {
-                    n = i + 1;
-                    goto fail_process_args;
-                }
-            }
-            else
-                replace[i] = NULL;
-        }
-        else {
-            if (i == 0)
-                replace[i] = replace_str;
-            else
-                replace[i] = NULL;
-        }
-
-        if (replace[i] == NULL)
-            rlen[i] = 0;
-        else
-            rlen[i] = xmlStrlen(replace[i]);
-    }
-
-    if (i_empty >= 0 && rlen[i_empty] == 0)
-        i_empty = -1;
-
-    /* replace operation */
-
-    buf = xmlBufferCreate();
-    if (buf == NULL) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        goto fail_buffer;
-    }
-    xmlBufferSetAllocationScheme(buf, XML_BUFFER_ALLOC_DOUBLEIT);
-    src = string;
-    start = string;
-
-    while (*src != 0) {
-        int max_len = 0, i_match = 0;
-
-        for (i=0; i<n; ++i) {
-            if (*src == search[i][0] &&
-                slen[i] > max_len &&
-                xmlStrncmp(src, search[i], slen[i]) == 0)
-            {
-                i_match = i;
-                max_len = slen[i];
-            }
-        }
-
-        if (max_len == 0) {
-            if (i_empty >= 0 && start < src) {
-                if (xmlBufferAdd(buf, start, src - start) ||
-                    xmlBufferAdd(buf, replace[i_empty], rlen[i_empty]))
-                {
-                    xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-                    goto fail_buffer_add;
-                }
-                start = src;
-            }
-
-            src += xmlUTF8Strsize(src, 1);
-        }
-        else {
-            if ((start < src &&
-                 xmlBufferAdd(buf, start, src - start)) ||
-                (rlen[i_match] &&
-                 xmlBufferAdd(buf, replace[i_match], rlen[i_match])))
-            {
-                xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-                goto fail_buffer_add;
-            }
-
-            src += slen[i_match];
-            start = src;
-        }
-    }
-
-    if (start < src && xmlBufferAdd(buf, start, src - start)) {
-        xmlXPathSetError(ctxt, XPATH_MEMORY_ERROR);
-        goto fail_buffer_add;
-    }
-
-    /* create result node set */
-
-    exsltStrReturnString(ctxt, xmlBufferContent(buf), xmlBufferLength(buf));
-
-    /* clean up */
-
-fail_buffer_add:
-    xmlBufferFree(buf);
-
-fail_buffer:
-fail_process_args:
-    if (search_set != NULL) {
-        for (i=0; i<n; ++i)
-            xmlFree(search[i]);
-    }
-    if (replace_set != NULL) {
-        for (i=0; i<n; ++i) {
-            if (replace[i] != NULL)
-                xmlFree(replace[i]);
-        }
-    }
-
-    if (mem != NULL)
-        xmlFree(mem);
-
-fail_malloc:
-done_empty_search:
-    xmlFree(string);
-
-fail_string:
-    if (search_set != NULL)
-        xmlXPathFreeNodeSet(search_set);
-    else
-        xmlFree(search_str);
-
-fail_search:
-    if (replace_set != NULL)
-        xmlXPathFreeNodeSet(replace_set);
-    else
-        xmlFree(replace_str);
-
-fail_replace:
-    return;
-}
-
-/**
- * exsltStrRegister:
- *
- * Registers the EXSLT - Strings module
- */
-
-void
-exsltStrRegister (void) {
-    xsltRegisterExtModuleFunction ((const xmlChar *) "tokenize",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrTokenizeFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "split",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrSplitFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "encode-uri",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrEncodeUriFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "decode-uri",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrDecodeUriFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "padding",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrPaddingFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "align",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrAlignFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "concat",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrConcatFunction);
-    xsltRegisterExtModuleFunction ((const xmlChar *) "replace",
-                   EXSLT_STRINGS_NAMESPACE,
-                   exsltStrReplaceFunction);
-}
-
-/**
- * exsltStrXpathCtxtRegister:
- *
- * Registers the EXSLT - Strings module for use outside XSLT
- */
-int
-exsltStrXpathCtxtRegister (xmlXPathContextPtr ctxt, const xmlChar *prefix)
-{
-    if (ctxt
-        && prefix
-        && !xmlXPathRegisterNs(ctxt,
-                               prefix,
-                               (const xmlChar *) EXSLT_STRINGS_NAMESPACE)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "encode-uri",
-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
-                                   exsltStrEncodeUriFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "decode-uri",
-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
-                                   exsltStrDecodeUriFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "padding",
-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
-                                   exsltStrPaddingFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "align",
-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
-                                   exsltStrAlignFunction)
-        && !xmlXPathRegisterFuncNS(ctxt,
-                                   (const xmlChar *) "concat",
-                                   (const xmlChar *) EXSLT_STRINGS_NAMESPACE,
-                                   exsltStrConcatFunction)) {
-        return 0;
-    }
-    return -1;
-}
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt.spec	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt.spec	Tue Apr 02 09:58:07 2019 -0700
@@ -1,6 +1,6 @@
 Summary: Library providing the GNOME XSLT engine
 Name: libxslt
-Version: 1.1.32
+Version: 1.1.33
 Release: 1%{?dist}%{?extra_release}
 License: MIT
 Group: Development/Libraries
@@ -129,5 +129,5 @@
 %doc python/tests/*.xsl
 
 %changelog
-* Thu Apr 19 2018 Daniel Veillard <veillard@redhat.com>
-- upstream release 1.1.32 see http://xmlsoft.org/XSLT/news.html
+* Thu Mar 21 2019 Daniel Veillard <veillard@redhat.com>
+- upstream release 1.1.33 see http://xmlsoft.org/XSLT/news.html
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/attributes.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/attributes.c	Tue Apr 02 09:58:07 2019 -0700
@@ -674,9 +674,11 @@
  * resolve the references in an attribute set.
  */
 static void
-xsltResolveSASCallback(xsltAttrSetPtr set, xsltAttrSetContextPtr asctx,
+xsltResolveSASCallback(void *payload, void *data,
                    const xmlChar *name, const xmlChar *ns,
                ATTRIBUTE_UNUSED const xmlChar *ignored) {
+    xsltAttrSetPtr set = (xsltAttrSetPtr) payload;
+    xsltAttrSetContextPtr asctx = (xsltAttrSetContextPtr) data;
     xsltStylesheetPtr topStyle = asctx->topStyle;
     xsltStylesheetPtr style = asctx->style;
 
@@ -723,8 +725,8 @@
         style->attributeSets = xmlHashCreate(10);
         }
             asctx.style = cur;
-        xmlHashScanFull(cur->attributeSets,
-        (xmlHashScannerFull) xsltResolveSASCallback, &asctx);
+        xmlHashScanFull(cur->attributeSets, xsltResolveSASCallback,
+                            &asctx);
 
             if (cur != style) {
                 /*
@@ -752,13 +754,13 @@
 xsltAttribute(xsltTransformContextPtr ctxt,
           xmlNodePtr contextNode,
               xmlNodePtr inst,
-          xsltStylePreCompPtr castedComp)
+          xsltElemPreCompPtr castedComp)
 {
 #ifdef XSLT_REFACTORED
     xsltStyleItemAttributePtr comp =
     (xsltStyleItemAttributePtr) castedComp;
 #else
-    xsltStylePreCompPtr comp = castedComp;
+    xsltStylePreCompPtr comp = (xsltStylePreCompPtr) castedComp;
 #endif
     xmlNodePtr targetElem;
     xmlChar *prop = NULL;
@@ -1225,6 +1227,12 @@
     }
 }
 
+static void
+xsltFreeAttributeSetsEntry(void *payload,
+                           const xmlChar *name ATTRIBUTE_UNUSED) {
+    xsltFreeAttrSet((xsltAttrSetPtr) payload);
+}
+
 /**
  * xsltFreeAttributeSetsHashes:
  * @style: an XSLT stylesheet
@@ -1235,6 +1243,6 @@
 xsltFreeAttributeSetsHashes(xsltStylesheetPtr style) {
     if (style->attributeSets != NULL)
     xmlHashFree((xmlHashTablePtr) style->attributeSets,
-            (xmlHashDeallocator) xsltFreeAttrSet);
+            xsltFreeAttributeSetsEntry);
     style->attributeSets = NULL;
 }
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extensions.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extensions.c	Tue Apr 02 09:58:07 2019 -0700
@@ -204,6 +204,11 @@
     xmlFree(ext);
 }
 
+static void
+xsltFreeExtModuleEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
+    xsltFreeExtModule((xsltExtModulePtr) payload);
+}
+
 /**
  * xsltNewExtData:
  * @extModule:  the module
@@ -245,6 +250,11 @@
     xmlFree(ext);
 }
 
+static void
+xsltFreeExtDataEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
+    xsltFreeExtData((xsltExtDataPtr) payload);
+}
+
 /**
  * xsltNewExtElement:
  * @precomp:  the pre-computation function
@@ -289,6 +299,11 @@
     xmlFree(ext);
 }
 
+static void
+xsltFreeExtElementEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
+    xsltFreeExtElement((xsltExtElementPtr) payload);
+}
+
 
 #ifdef WITH_MODULES
 typedef void (*exsltRegisterFunction) (void);
@@ -936,9 +951,10 @@
  * Initializes an extension module
  */
 static void
-xsltInitCtxtExt(xsltExtDataPtr styleData, xsltInitExtCtxt * ctxt,
-                const xmlChar * URI)
+xsltInitCtxtExt(void *payload, void *data, const xmlChar * URI)
 {
+    xsltExtDataPtr styleData = (xsltExtDataPtr) payload;
+    xsltInitExtCtxt *ctxt = (xsltInitExtCtxt *) data;
     xsltExtModulePtr module;
     xsltExtDataPtr ctxtData;
     void *extData;
@@ -1031,8 +1047,7 @@
 
     while (style != NULL) {
         if (style->extInfos != NULL) {
-            xmlHashScan(style->extInfos,
-                        (xmlHashScanner) xsltInitCtxtExt, &ctx);
+            xmlHashScan(style->extInfos, xsltInitCtxtExt, &ctx);
             if (ctx.ret == -1)
                 return (-1);
         }
@@ -1054,9 +1069,10 @@
  * Shutdown an extension module loaded
  */
 static void
-xsltShutdownCtxtExt(xsltExtDataPtr data, xsltTransformContextPtr ctxt,
-                    const xmlChar * URI)
+xsltShutdownCtxtExt(void *payload, void *vctxt, const xmlChar * URI)
 {
+    xsltExtDataPtr data = (xsltExtDataPtr) payload;
+    xsltTransformContextPtr ctxt = (xsltTransformContextPtr) vctxt;
     xsltExtModulePtr module;
 
     if ((data == NULL) || (ctxt == NULL) || (URI == NULL))
@@ -1085,9 +1101,8 @@
         return;
     if (ctxt->extInfos == NULL)
         return;
-    xmlHashScan(ctxt->extInfos, (xmlHashScanner) xsltShutdownCtxtExt,
-                ctxt);
-    xmlHashFree(ctxt->extInfos, (xmlHashDeallocator) xsltFreeExtData);
+    xmlHashScan(ctxt->extInfos, xsltShutdownCtxtExt, ctxt);
+    xmlHashFree(ctxt->extInfos, xsltFreeExtDataEntry);
     ctxt->extInfos = NULL;
 }
 
@@ -1100,9 +1115,10 @@
  * Shutdown an extension module loaded
  */
 static void
-xsltShutdownExt(xsltExtDataPtr data, xsltStylesheetPtr style,
-                const xmlChar * URI)
+xsltShutdownExt(void *payload, void *vctxt, const xmlChar * URI)
 {
+    xsltExtDataPtr data = (xsltExtDataPtr) payload;
+    xsltStylesheetPtr style = (xsltStylesheetPtr) vctxt;
     xsltExtModulePtr module;
 
     if ((data == NULL) || (style == NULL) || (URI == NULL))
@@ -1120,8 +1136,7 @@
     * Don't remove the entry from the hash table here, since
     * this will produce segfaults - this fixes bug #340624.
     *
-    * xmlHashRemoveEntry(style->extInfos, URI,
-    *   (xmlHashDeallocator) xsltFreeExtData);
+    * xmlHashRemoveEntry(style->extInfos, URI, xsltFreeExtDataEntry);
     */
 }
 
@@ -1138,8 +1153,8 @@
         return;
     if (style->extInfos == NULL)
         return;
-    xmlHashScan(style->extInfos, (xmlHashScanner) xsltShutdownExt, style);
-    xmlHashFree(style->extInfos, (xmlHashDeallocator) xsltFreeExtData);
+    xmlHashScan(style->extInfos, xsltShutdownExt, style);
+    xmlHashFree(style->extInfos, xsltFreeExtDataEntry);
     style->extInfos = NULL;
 }
 
@@ -1327,8 +1342,7 @@
 
     xmlMutexLock(xsltExtMutex);
 
-    ret = xmlHashRemoveEntry(xsltExtensionsHash, URI,
-                             (xmlHashDeallocator) xsltFreeExtModule);
+    ret = xmlHashRemoveEntry(xsltExtensionsHash, URI, xsltFreeExtModuleEntry);
 
     xmlMutexUnlock(xsltExtMutex);
 
@@ -1348,8 +1362,7 @@
 
     xmlMutexLock(xsltExtMutex);
 
-    xmlHashFree(xsltExtensionsHash,
-                (xmlHashDeallocator) xsltFreeExtModule);
+    xmlHashFree(xsltExtensionsHash, xsltFreeExtModuleEntry);
     xsltExtensionsHash = NULL;
 
     xmlMutexUnlock(xsltExtMutex);
@@ -1488,6 +1501,11 @@
 }
 
 
+static void
+xsltFreeElemPreComp(xsltElemPreCompPtr comp) {
+    xmlFree(comp);
+}
+
 /**
  * xsltNewElemPreComp:
  * @style:  the XSLT stylesheet
@@ -1512,8 +1530,7 @@
     }
     memset(cur, 0, sizeof(xsltElemPreComp));
 
-    xsltInitElemPreComp(cur, style, inst, function,
-                        (xsltElemPreCompDeallocator) xmlFree);
+    xsltInitElemPreComp(cur, style, inst, function, xsltFreeElemPreComp);
 
     return (cur);
 }
@@ -1645,7 +1662,7 @@
     }
 
     xmlHashUpdateEntry2(xsltElementsHash, name, URI, (void *) ext,
-                        (xmlHashDeallocator) xsltFreeExtElement);
+                        xsltFreeExtElementEntry);
 
 done:
     xmlMutexUnlock(xsltExtMutex);
@@ -1788,7 +1805,7 @@
     xmlMutexLock(xsltExtMutex);
 
     ret = xmlHashRemoveEntry2(xsltElementsHash, name, URI,
-                              (xmlHashDeallocator) xsltFreeExtElement);
+                              xsltFreeExtElementEntry);
 
     xmlMutexUnlock(xsltExtMutex);
 
@@ -1805,7 +1822,7 @@
 {
     xmlMutexLock(xsltExtMutex);
 
-    xmlHashFree(xsltElementsHash, (xmlHashDeallocator) xsltFreeExtElement);
+    xmlHashFree(xsltElementsHash, xsltFreeExtElementEntry);
     xsltElementsHash = NULL;
 
     xmlMutexUnlock(xsltExtMutex);
@@ -2063,7 +2080,7 @@
  * @ctxt:  an XSLT processing context
  * @node:  The current node
  * @inst:  the instruction in the stylesheet
- * @comp:  precomputed informations
+ * @comp:  precomputed information
  *
  * Process a libxslt:test node
  */
@@ -2247,7 +2264,7 @@
 static void
 xsltHashScannerModuleFree(void *payload ATTRIBUTE_UNUSED,
                           void *data ATTRIBUTE_UNUSED,
-                          xmlChar * name ATTRIBUTE_UNUSED)
+                          const xmlChar *name ATTRIBUTE_UNUSED)
 {
 #ifdef WITH_MODULES
     xmlModuleClose(payload);
@@ -2297,10 +2314,11 @@
 
 static void
 xsltDebugDumpExtensionsCallback(void *function ATTRIBUTE_UNUSED,
-                                FILE * output, const xmlChar * name,
+                                void *data, const xmlChar * name,
                                 const xmlChar * URI,
                                 const xmlChar * not_used ATTRIBUTE_UNUSED)
 {
+    FILE *output = (FILE *) data;
     if (!name || !URI)
         return;
     fprintf(output, "{%s}%s\n", URI, name);
@@ -2308,10 +2326,11 @@
 
 static void
 xsltDebugDumpExtModulesCallback(void *function ATTRIBUTE_UNUSED,
-                                FILE * output, const xmlChar * URI,
+                                void *data, const xmlChar * URI,
                                 const xmlChar * not_used ATTRIBUTE_UNUSED,
                                 const xmlChar * not_used2 ATTRIBUTE_UNUSED)
 {
+    FILE *output = (FILE *) data;
     if (!URI)
         return;
     fprintf(output, "%s\n", URI);
@@ -2335,9 +2354,8 @@
     else {
         fprintf(output, "Registered Extension Functions:\n");
         xmlMutexLock(xsltExtMutex);
-        xmlHashScanFull(xsltFunctionsHash,
-                        (xmlHashScannerFull)
-                        xsltDebugDumpExtensionsCallback, output);
+        xmlHashScanFull(xsltFunctionsHash, xsltDebugDumpExtensionsCallback,
+                        output);
         xmlMutexUnlock(xsltExtMutex);
     }
     if (!xsltElementsHash)
@@ -2345,9 +2363,8 @@
     else {
         fprintf(output, "\nRegistered Extension Elements:\n");
         xmlMutexLock(xsltExtMutex);
-        xmlHashScanFull(xsltElementsHash,
-                        (xmlHashScannerFull)
-                        xsltDebugDumpExtensionsCallback, output);
+        xmlHashScanFull(xsltElementsHash, xsltDebugDumpExtensionsCallback,
+                        output);
         xmlMutexUnlock(xsltExtMutex);
     }
     if (!xsltExtensionsHash)
@@ -2355,9 +2372,8 @@
     else {
         fprintf(output, "\nRegistered Extension Modules:\n");
         xmlMutexLock(xsltExtMutex);
-        xmlHashScanFull(xsltExtensionsHash,
-                        (xmlHashScannerFull)
-                        xsltDebugDumpExtModulesCallback, output);
+        xmlHashScanFull(xsltExtensionsHash, xsltDebugDumpExtModulesCallback,
+                        output);
         xmlMutexUnlock(xsltExtMutex);
     }
 
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extra.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extra.c	Tue Apr 02 09:58:07 2019 -0700
@@ -47,14 +47,14 @@
  * @ctxt:  an XSLT processing context
  * @node:  The current node
  * @inst:  the instruction in the stylesheet
- * @comp:  precomputed informations
+ * @comp:  precomputed information
  *
  * Process an debug node
  */
 void
 xsltDebug(xsltTransformContextPtr ctxt, xmlNodePtr node ATTRIBUTE_UNUSED,
           xmlNodePtr inst ATTRIBUTE_UNUSED,
-          xsltStylePreCompPtr comp ATTRIBUTE_UNUSED)
+          xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
 {
     int i, j;
 
@@ -179,21 +179,21 @@
     xsltRegisterExtModuleElement((const xmlChar *) "debug",
                  XSLT_LIBXSLT_NAMESPACE,
                  NULL,
-                 (xsltTransformFunction) xsltDebug);
+                 xsltDebug);
     xsltRegisterExtModuleElement((const xmlChar *) "output",
                  XSLT_SAXON_NAMESPACE,
                  xsltDocumentComp,
-                 (xsltTransformFunction) xsltDocumentElem);
+                 xsltDocumentElem);
     xsltRegisterExtModuleElement((const xmlChar *) "write",
                  XSLT_XALAN_NAMESPACE,
                  xsltDocumentComp,
-                 (xsltTransformFunction) xsltDocumentElem);
+                 xsltDocumentElem);
     xsltRegisterExtModuleElement((const xmlChar *) "document",
                  XSLT_XT_NAMESPACE,
                  xsltDocumentComp,
-                 (xsltTransformFunction) xsltDocumentElem);
+                 xsltDocumentElem);
     xsltRegisterExtModuleElement((const xmlChar *) "document",
                  XSLT_NAMESPACE,
                  xsltDocumentComp,
-                 (xsltTransformFunction) xsltDocumentElem);
+                 xsltDocumentElem);
 }
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extra.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/extra.h	Tue Apr 02 09:58:07 2019 -0700
@@ -56,7 +56,7 @@
         xsltDebug       (xsltTransformContextPtr ctxt,
                      xmlNodePtr node,
                      xmlNodePtr inst,
-                     xsltStylePreCompPtr comp);
+                     xsltElemPreCompPtr comp);
 
 
 XSLTPUBFUN void XSLTCALL
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/functions.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/functions.c	Tue Apr 02 09:58:07 2019 -0700
@@ -65,8 +65,9 @@
  * Returns the callback function or NULL if not found
  */
 xmlXPathFunction
-xsltXPathFunctionLookup (xmlXPathContextPtr ctxt,
+xsltXPathFunctionLookup (void *vctxt,
              const xmlChar *name, const xmlChar *ns_uri) {
+    xmlXPathContextPtr ctxt = (xmlXPathContextPtr) vctxt;
     xmlXPathFunction ret;
 
     if ((ctxt == NULL) || (name == NULL) || (ns_uri == NULL))
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/functions.h	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/functions.h	Tue Apr 02 09:58:07 2019 -0700
@@ -26,11 +26,11 @@
  */
 #define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt)         \
     xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt,       \
-    (xmlXPathFuncLookupFunc) xsltXPathFunctionLookup,   \
+    xsltXPathFunctionLookup,                \
     (void *)(ctxt->xpathCtxt));
 
 XSLTPUBFUN xmlXPathFunction XSLTCALL
-    xsltXPathFunctionLookup     (xmlXPathContextPtr ctxt,
+    xsltXPathFunctionLookup     (void *vctxt,
                      const xmlChar *name,
                      const xmlChar *ns_uri);
 
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/imports.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/imports.c	Tue Apr 02 09:58:07 2019 -0700
@@ -65,8 +65,7 @@
 static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
             xsltStylesheetPtr style) {
     xsltStylesheetPtr res;
-    xmlHashScan(style->templatesHash,
-                (xmlHashScanner) xsltNormalizeCompSteps, master);
+    xmlHashScan(style->templatesHash, xsltNormalizeCompSteps, master);
     master->extrasNr += style->extrasNr;
     for (res = style->imports; res != NULL; res = res->next) {
         xsltFixImportedCompSteps(master, res);
@@ -329,7 +328,7 @@
  * @ctxt:  an XSLT transformation context
  * @node:  an XML node
  *
- * Find strip-space or preserve-space informations for an element
+ * Find strip-space or preserve-space information for an element
  * respect the import precedence or the wildcards
  *
  * Returns 1 if space should be stripped, 0 if not, and 2 if everything
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/keys.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/keys.c	Tue Apr 02 09:58:07 2019 -0700
@@ -144,6 +144,11 @@
     return(cur);
 }
 
+static void
+xsltFreeNodeSetEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
+    xmlXPathFreeNodeSet((xmlNodeSetPtr) payload);
+}
+
 /**
  * xsltFreeKeyTable:
  * @keyt:  an XSLT key table
@@ -159,8 +164,7 @@
     if (keyt->nameURI != NULL)
     xmlFree(keyt->nameURI);
     if (keyt->keys != NULL)
-    xmlHashFree(keyt->keys,
-            (xmlHashDeallocator) xmlXPathFreeNodeSet);
+    xmlHashFree(keyt->keys, xsltFreeNodeSetEntry);
     memset(keyt, -1, sizeof(xsltKeyTable));
     xmlFree(keyt);
 }
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/numbers.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/numbers.c	Tue Apr 02 09:58:07 2019 -0700
@@ -716,7 +716,7 @@
 /**
  * xsltNumberFormat:
  * @ctxt: the XSLT transformation context
- * @data: the formatting informations
+ * @data: the formatting information
  * @node: the data to format
  *
  * Convert one number.
@@ -886,7 +886,7 @@
  * @self: the decimal format
  * @format: the format requested
  * @number: the value to format
- * @result: the place to ouput the result
+ * @result: the place to output the result
  *
  * format-number() uses the JDK 1.1 DecimalFormat class:
  *
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/pattern.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/pattern.c	Tue Apr 02 09:58:07 2019 -0700
@@ -113,6 +113,7 @@
     xmlNsPtr *nsList;       /* the namespaces in scope */
     int nsNr;           /* the number of namespaces in scope */
     xsltStepOpPtr steps;        /* ops for computation */
+    int novar;                  /* doesn't contain variables */
 };
 
 typedef struct _xsltParserContext xsltParserContext;
@@ -218,6 +219,12 @@
     }
 }
 
+static void
+xsltFreeCompMatchListEntry(void *payload,
+                           const xmlChar *name ATTRIBUTE_UNUSED) {
+    xsltFreeCompMatchList((xsltCompMatchPtr) payload);
+}
+
 /**
  * xsltNormalizeCompSteps:
  * @payload: pointer to template hash table entry
@@ -513,6 +520,11 @@
     return(0);
 }
 
+static void
+xmlXPathFreeObjectWrapper(void *obj) {
+    xmlXPathFreeObject((xmlXPathObjectPtr) obj);
+}
+
 /**
  * xsltTestCompMatchDirect:
  * @ctxt:  a XSLT process context
@@ -583,7 +595,8 @@
     }
     ix = 0;
 
-    if ((parent == NULL) || (node->doc == NULL) || isRVT)
+    if ((parent == NULL) || (node->doc == NULL) || isRVT ||
+            (comp->novar == 0))
         nocache = 1;
 
     if (nocache == 0) {
@@ -598,7 +611,7 @@
         XSLT_RUNTIME_EXTRA(ctxt, sel->indexExtra, ival) =
         0;
         XSLT_RUNTIME_EXTRA_FREE(ctxt, sel->lenExtra) =
-        (xmlFreeFunc) xmlXPathFreeObject;
+        xmlXPathFreeObjectWrapper;
     } else
         list = newlist;
     }
@@ -1959,6 +1972,7 @@
         j++;
     }
     element->nsNr = j;
+        element->novar = novar;
 
 
 #ifdef WITH_XSLT_DEBUG_PATTERN
@@ -2578,7 +2592,7 @@
 xsltFreeTemplateHashes(xsltStylesheetPtr style) {
     if (style->templatesHash != NULL)
     xmlHashFree((xmlHashTablePtr) style->templatesHash,
-            (xmlHashDeallocator) xsltFreeCompMatchList);
+            xsltFreeCompMatchListEntry);
     if (style->rootMatch != NULL)
         xsltFreeCompMatchList(style->rootMatch);
     if (style->keyMatch != NULL)
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/preproc.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/preproc.c	Tue Apr 02 09:58:07 2019 -0700
@@ -319,40 +319,40 @@
     cur->type = type;
     switch (cur->type) {
         case XSLT_FUNC_COPY:
-            cur->func = (xsltTransformFunction) xsltCopy;break;
+            cur->func = xsltCopy;break;
         case XSLT_FUNC_SORT:
-            cur->func = (xsltTransformFunction) xsltSort;break;
+            cur->func = xsltSort;break;
         case XSLT_FUNC_TEXT:
-            cur->func = (xsltTransformFunction) xsltText;break;
+            cur->func = xsltText;break;
         case XSLT_FUNC_ELEMENT:
-            cur->func = (xsltTransformFunction) xsltElement;break;
+            cur->func = xsltElement;break;
         case XSLT_FUNC_ATTRIBUTE:
-            cur->func = (xsltTransformFunction) xsltAttribute;break;
+            cur->func = xsltAttribute;break;
         case XSLT_FUNC_COMMENT:
-            cur->func = (xsltTransformFunction) xsltComment;break;
+            cur->func = xsltComment;break;
         case XSLT_FUNC_PI:
-            cur->func = (xsltTransformFunction) xsltProcessingInstruction;
+            cur->func = xsltProcessingInstruction;
         break;
         case XSLT_FUNC_COPYOF:
-            cur->func = (xsltTransformFunction) xsltCopyOf;break;
+            cur->func = xsltCopyOf;break;
         case XSLT_FUNC_VALUEOF:
-            cur->func = (xsltTransformFunction) xsltValueOf;break;
+            cur->func = xsltValueOf;break;
         case XSLT_FUNC_NUMBER:
-            cur->func = (xsltTransformFunction) xsltNumber;break;
+            cur->func = xsltNumber;break;
         case XSLT_FUNC_APPLYIMPORTS:
-            cur->func = (xsltTransformFunction) xsltApplyImports;break;
+            cur->func = xsltApplyImports;break;
         case XSLT_FUNC_CALLTEMPLATE:
-            cur->func = (xsltTransformFunction) xsltCallTemplate;break;
+            cur->func = xsltCallTemplate;break;
         case XSLT_FUNC_APPLYTEMPLATES:
-            cur->func = (xsltTransformFunction) xsltApplyTemplates;break;
+            cur->func = xsltApplyTemplates;break;
         case XSLT_FUNC_CHOOSE:
-            cur->func = (xsltTransformFunction) xsltChoose;break;
+            cur->func = xsltChoose;break;
         case XSLT_FUNC_IF:
-            cur->func = (xsltTransformFunction) xsltIf;break;
+            cur->func = xsltIf;break;
         case XSLT_FUNC_FOREACH:
-            cur->func = (xsltTransformFunction) xsltForEach;break;
+            cur->func = xsltForEach;break;
         case XSLT_FUNC_DOCUMENT:
-            cur->func = (xsltTransformFunction) xsltDocumentElem;break;
+            cur->func = xsltDocumentElem;break;
     case XSLT_FUNC_WITHPARAM:
     case XSLT_FUNC_PARAM:
     case XSLT_FUNC_VARIABLE:
@@ -2069,7 +2069,7 @@
         case XSLT_FUNC_DOCUMENT:
         /* The extra one */
         node->psvi = (void *) xsltDocumentComp(style, node,
-            (xsltTransformFunction) xsltDocumentElem);
+            xsltDocumentElem);
         break;
         case XSLT_FUNC_MESSAGE:
         /* NOP yet */
@@ -2137,7 +2137,7 @@
     } else if (IS_XSLT_NAME(node, "document")) {
         /* The extra one */
         node->psvi = (void *) xsltDocumentComp(style, node,
-        (xsltTransformFunction) xsltDocumentElem);
+        xsltDocumentElem);
     } else if (IS_XSLT_NAME(node, "output")) {
         /* Top-level */
         return;
@@ -2339,7 +2339,7 @@
     } else if (IS_XSLT_NAME(inst, "document")) {
         xsltCheckInstructionElement(style, inst);
         inst->psvi = (void *) xsltDocumentComp(style, inst,
-                (xsltTransformFunction) xsltDocumentElem);
+                xsltDocumentElem);
     } else if ((style == NULL) || (style->forwards_compatible == 0)) {
         xsltTransformError(NULL, style, inst,
          "xsltStylePreCompute: unknown xsl:%s\n", inst->name);
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/transform.c	Fri Mar 22 08:11:38 2019 -0700
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/libxslt/src/libxslt/transform.c	Tue Apr 02 09:58:07 2019 -0700
@@ -2301,6 +2301,11 @@
     if (cur->prev != NULL)
         xsltTransformError(ctxt, NULL, NULL, "localRVT not head of list\n");
 
+    /* Reset localRVT early because some RVTs might be registered again. */
+    ctxt->localRVT = base;
+    if (base != NULL)
+        base->prev = NULL;
+
     do {
         tmp = cur;
         cur = (xmlDocPtr) cur->next;
@@ -2308,16 +2313,19 @@
             xsltReleaseRVT(ctxt, tmp);
         } else if (tmp->psvi == XSLT_RVT_GLOBAL) {
             xsltRegisterPersistRVT(ctxt, tmp);
-        } else if (tmp->psvi != XSLT_RVT_FUNC_RESULT) {
+        } else if (tmp->psvi == XSLT_RVT_FUNC_RESULT) {
+            /*
+             * This will either register the RVT again or move it to the
+             * context variable.
+             */
+            xsltRegisterLocalRVT(ctxt, tmp);
+            tmp->psvi = XSLT_RVT_FUNC_RESULT;
+        } else {
             xmlGenericError(xmlGenericErrorContext,
                     "xsltReleaseLocalRVTs: Unexpected RVT flag %p\n",
                     tmp->psvi);
         }
     } while (cur != base);
-
-    if (base != NULL)
-        base->prev = NULL;
-    ctxt->localRVT = base;
 }
 
 /**
@@ -2656,8 +2664,8 @@
             * Libxslt will now lookup if a handler is
             * registered in the context of this transformation.
             */
-            func = (xsltTransformFunction)
-            xsltExtElementLookup(ctxt, cur->name, cur->ns->href);
+            func = xsltExtElementLookup(ctxt, cur->name,
+                                                cur->ns->href);
         } else
             func = ((xsltElemPreCompPtr) cur->psvi)->func;
 
@@ -2842,8 +2850,8 @@
              * Flagged as an extension element
              */
             if (cur->psvi == xsltExtMarker)
-                function = (xsltTransformFunction)
-                    xsltExtElementLookup(ctxt, cur->name, cur->ns->href);
+                function = xsltExtElementLookup(ctxt, cur->name,
+                                                cur->ns->href);
             else
                 function = ((xsltElemPreCompPtr) cur->psvi)->func;
 
@@ -3360,12 +3368,12 @@
  */
 void
 xsltDocumentElem(xsltTransformContextPtr ctxt, xmlNodePtr node,