summaryrefslogtreecommitdiff
path: root/libexslt/common.c
diff options
context:
space:
mode:
authorThomas Broyer <tbroyer@src.gnome.org>2001-07-26 17:27:38 +0000
committerThomas Broyer <tbroyer@src.gnome.org>2001-07-26 17:27:38 +0000
commit3a16b45ef141de88ab28039ff8cb868be4751f35 (patch)
tree39871212227e31e8df5f5fce51e4af80a394f2e0 /libexslt/common.c
parent93a9ef80f276ad2676d129e83f6992736a0a17ce (diff)
downloadlibxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.tar.gz
libxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.tar.bz2
libxslt-3a16b45ef141de88ab28039ff8cb868be4751f35.zip
new extension framework. Added stylesheet module data, top-level and
* libxslt/extensions.[ch] libxslt/functions.[ch] libxslt/preproc.c libxslt/transform.[ch] libxslt/variables.c libxslt/xslt.c libxslt/xsltInternals.h: new extension framework. Added stylesheet module data, top-level and extension elements precomputing, global registration of top-level elements and extension elements and functions. Extensions are no longer initialized from extension-element-prefixes declarations but when modules need the data. init/shutdown functions registered with xsltRegisterExtModule{,Full} only allocate and free module data, they shouldn't register the elements and functions any more. * libxslt/xsltutils.c: fixed a bug in xsltPrintErrorContext when @node wasn't NULL. * libxslt/xslt.c: fixed xsltPrecomputeStylesheetTop which allowed non-XSLT top-level elements before any xsl:import element. * libexslt/common.c libexslt/functions.c libexslt/math.c libexslt/sets.c: adapted to use the new extension framework. * libxslt/functions.c libxslt/extensions[ch] xsltproc/xsltproc.c: moved the test module from functions.c to extensions.[ch], modified it to use the new extension framework. Updated xsltproc to register the test module.
Diffstat (limited to 'libexslt/common.c')
-rw-r--r--libexslt/common.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/libexslt/common.c b/libexslt/common.c
index 07614796..1b2e474b 100644
--- a/libexslt/common.c
+++ b/libexslt/common.c
@@ -52,19 +52,6 @@ exsltObjectTypeFunction (xmlXPathParserContextPtr ctxt, int nargs) {
}
-static void *
-exsltCommonInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "node-set",
- URI, xsltFunctionNodeSet);
- xsltRegisterExtFunction (ctxt, (const xmlChar *) "object-type",
- URI, exsltObjectTypeFunction);
-
- xsltRegisterExtElement (ctxt, (const xmlChar *) "document",
- URI, xsltDocumentElem);
-
- return(NULL);
-}
-
/**
* exsltCommonRegister:
*
@@ -73,6 +60,13 @@ exsltCommonInit (xsltTransformContextPtr ctxt, const xmlChar *URI) {
void
exsltCommonRegister (void) {
- xsltRegisterExtModule (EXSLT_COMMON_NAMESPACE,
- exsltCommonInit, NULL);
+ xsltRegisterExtModuleFunction((const xmlChar *) "node-set",
+ EXSLT_COMMON_NAMESPACE,
+ xsltFunctionNodeSet);
+ xsltRegisterExtModuleFunction((const xmlChar *) "object-type",
+ EXSLT_COMMON_NAMESPACE,
+ exsltObjectTypeFunction);
+ xsltRegisterExtModuleElement((const xmlChar *) "document",
+ EXSLT_COMMON_NAMESPACE,
+ NULL, xsltDocumentElem);
}