diff --git a/ChangeLog b/ChangeLog
index 0e6f3c0e5fc4584e6866a6a0c1b838cfb0af7fa5_Q2hhbmdlTG9n..fd33194f2755e710db9dc80d50d39c5871bf336a_Q2hhbmdlTG9n 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Jan 24 05:33:54 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* libxslt/functions.[ch] Makefile.am: added new module functions
+	  with templates for the XSLT functions.
+	* libxslt/variables.h templates.c: added registrations of new
+	  functions when an XPath context is created
+
 Tue Jan 23 17:24:26 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 	* tests/Makefile.am: cleanup
diff --git a/libxslt/Makefile.am b/libxslt/Makefile.am
index 0e6f3c0e5fc4584e6866a6a0c1b838cfb0af7fa5_bGlieHNsdC9NYWtlZmlsZS5hbQ==..fd33194f2755e710db9dc80d50d39c5871bf336a_bGlieHNsdC9NYWtlZmlsZS5hbQ== 100644
--- a/libxslt/Makefile.am
+++ b/libxslt/Makefile.am
@@ -11,6 +11,7 @@
 	pattern.h			\
 	templates.h			\
 	variables.h			\
+	functions.h			\
 	transform.h			\
 	xsltInternals.h
 
@@ -20,6 +21,7 @@
 	pattern.c			\
 	templates.c			\
 	variables.c			\
+	functions.c			\
 	transform.c
 
 
diff --git a/libxslt/functions.c b/libxslt/functions.c
new file mode 100644
index 0000000000000000000000000000000000000000..fd33194f2755e710db9dc80d50d39c5871bf336a_bGlieHNsdC9mdW5jdGlvbnMuYw==
--- /dev/null
+++ b/libxslt/functions.c
@@ -0,0 +1,181 @@
+/*
+ * functions.c: Implementation of the XSLT extra functions
+ *
+ * Reference:
+ *   http://www.w3.org/TR/1999/REC-xslt-19991116
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#include "xsltconfig.h"
+
+#include <string.h>
+
+#include <libxml/xmlmemory.h>
+#include <libxml/tree.h>
+#include <libxml/valid.h>
+#include <libxml/hash.h>
+#include <libxml/xmlerror.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+#include <libxml/parserInternals.h>
+#include "xslt.h"
+#include "xsltInternals.h"
+#include "xsltutils.h"
+#include "functions.h"
+
+#define DEBUG_FUNCTION
+
+
+/************************************************************************
+ *									*
+ *			Module interfaces				*
+ *									*
+ ************************************************************************/
+
+/**
+ * xsltDocumentFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the document() XSLT function
+ *   node-set document(object, node-set?)
+ */
+void
+xsltDocumentFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltKeyFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the key() XSLT function
+ *   node-set key(string, object)
+ */
+void
+xsltKeyFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltUnparsedEntityURIFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the unparsed-entity-uri() XSLT function
+ *   string unparsed-entity-uri(string)
+ */
+void
+xsltUnparsedEntityURIFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltFormatNumberFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the format-number() XSLT function
+ *   string format-number(number, string, string?)
+ */
+void
+xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltGenerateIdFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the generate-id() XSLT function
+ *   string generate-id(node-set?)
+ */
+void
+xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltSystemPropertyFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the system-property() XSLT function
+ *   object system-property(string)
+ */
+void
+xsltSystemPropertyFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltElementAvailableFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the element-available() XSLT function
+ *   boolean element-available(string)
+ */
+void
+xsltElementAvailableFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltFunctionAvailableFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the function-available() XSLT function
+ *   boolean function-available(string)
+ */
+void
+xsltFunctionAvailableFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltCurrentFunction:
+ * @ctxt:  the XPath Parser context
+ * @nargs:  the number of arguments
+ *
+ * Implement the current() XSLT function
+ *   node-set current()
+ */
+void
+xsltCurrentFunction(xmlXPathParserContextPtr ctxt, int nargs){
+    TODO /* function */
+}
+
+/**
+ * xsltRegisterAllFunctions:
+ * @ctxt:  the XPath context
+ *
+ * Registers all default XSLT functions in this context
+ */
+void
+xsltRegisterAllFunctions(xmlXPathContextPtr ctxt) {
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"current",
+                         xsltCurrentFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"document",
+                         xsltDocumentFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"key",
+                         xsltKeyFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"unparsed-entity-uri",
+                         xsltUnparsedEntityURIFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"format-number",
+                         xsltFormatNumberFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"generate-id",
+                         xsltGenerateIdFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"system-property",
+                         xsltSystemPropertyFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"element-available",
+                         xsltElementAvailableFunction);
+    xmlXPathRegisterFunc(ctxt, (const xmlChar *)"function-available",
+                         xsltFunctionAvailableFunction);
+}
diff --git a/libxslt/functions.h b/libxslt/functions.h
new file mode 100644
index 0000000000000000000000000000000000000000..fd33194f2755e710db9dc80d50d39c5871bf336a_bGlieHNsdC9mdW5jdGlvbnMuaA==
--- /dev/null
+++ b/libxslt/functions.h
@@ -0,0 +1,54 @@
+/*
+ * functions.h: interface for the XSLT extra functions
+ *
+ * See Copyright for the status of this software.
+ *
+ * Daniel.Veillard@imag.fr
+ */
+
+#ifndef __XML_XSLT_FUNCTIONS_H__
+#define __XML_XSLT_FUNCTIONS_H__
+
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+#include "xsltInternals.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Interfaces for the functions implementations
+ */
+
+void	xsltDocumentFunction		(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltKeyFunction			(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltUnparsedEntityURIFunction	(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltFormatNumberFunction	(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltGenerateIdFunction		(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltSystemPropertyFunction	(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltElementAvailableFunction	(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltFunctionAvailableFunction	(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+void	xsltXXXFunction			(xmlXPathParserContextPtr ctxt,
+					 int nargs);
+
+/*
+ * And the registration
+ */
+
+void	xsltRegisterAllFunctions	(xmlXPathContextPtr ctxt);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_XSLT_FUNCTIONS_H__ */
+
diff --git a/libxslt/templates.c b/libxslt/templates.c
index 0e6f3c0e5fc4584e6866a6a0c1b838cfb0af7fa5_bGlieHNsdC90ZW1wbGF0ZXMuYw==..fd33194f2755e710db9dc80d50d39c5871bf336a_bGlieHNsdC90ZW1wbGF0ZXMuYw== 100644
--- a/libxslt/templates.c
+++ b/libxslt/templates.c
@@ -22,6 +22,7 @@
 #include "xsltInternals.h"
 #include "xsltutils.h"
 #include "variables.h"
+#include "functions.h"
 #include "templates.h"
 
 #define DEBUG_TEMPLATES
diff --git a/libxslt/variables.h b/libxslt/variables.h
index 0e6f3c0e5fc4584e6866a6a0c1b838cfb0af7fa5_bGlieHNsdC92YXJpYWJsZXMuaA==..fd33194f2755e710db9dc80d50d39c5871bf336a_bGlieHNsdC92YXJpYWJsZXMuaA== 100644
--- a/libxslt/variables.h
+++ b/libxslt/variables.h
@@ -12,6 +12,7 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 #include "xsltInternals.h"
+#include "functions.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -19,7 +20,8 @@
 
 #define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt)			\
     xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt,		\
-	       xsltXPathVariableLookup,	(void *)(ctxt)) 
+	       xsltXPathVariableLookup,	(void *)(ctxt));	\
+    xsltRegisterAllFunctions((ctxt)->xpathCtxt)
 
 /*
  * Interfaces for the variable module.