From 0f879dd4f2c764171adf0ee75277f51226971585 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Thu, 16 May 2002 17:33:29 +0000 Subject: [PATCH] Applied Mark Vakoc patch to show registered extensions in xsltproc rebuilt * libxslt/extensions.[ch] xsltproc/xsltproc.c win32/libxslt.def.src: Applied Mark Vakoc patch to show registered extensions in xsltproc * doc/*: rebuilt the API, docs and website * python/libxsltclass.txt: this added an entry point Daniel --- ChangeLog | 7 +++++++ doc/APIchunk0.html | 2 ++ doc/APIchunk1.html | 4 ++++ doc/APIchunk2.html | 6 ++++++ doc/APIchunk3.html | 2 ++ doc/APIchunk4.html | 1 - doc/APIchunk5.html | 1 + doc/APIchunk6.html | 14 +++++++++++++- doc/APIfiles.html | 1 + doc/APIfunctions.html | 1 + doc/libxslt-api.xml | 15 ++++++++++----- doc/libxslt-decl.txt | 9 +++++++-- doc/libxslt-refs.xml | 37 +++++++++++++++++++++++++++++++++++-- doc/xsltproc.xml | 12 ++++++++++++ libxslt/extensions.c | 34 ++++++++++++++++++++++++++++++++++ libxslt/extensions.h | 2 ++ python/libxsltclass.txt | 1 + win32/libxslt.def.src | 1 + xsltproc/xsltproc.c | 12 +++++++++++- 19 files changed, 150 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62b740f2..32102e72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu May 16 19:31:35 CEST 2002 Daniel Veillard + + * libxslt/extensions.[ch] xsltproc/xsltproc.c win32/libxslt.def.src: + Applied Mark Vakoc patch to show registered extensions in xsltproc + * doc/*: rebuilt the API, docs and website + * python/libxsltclass.txt: this added an entry point + Wed May 15 00:20:10 CEST 2002 Igor Zlatkovic * libxslt/xslt.c: xsl:include crash fix diff --git a/doc/APIchunk0.html b/doc/APIchunk0.html index 13648164..7a78eb24 100644 --- a/doc/APIchunk0.html +++ b/doc/APIchunk0.html @@ -499,6 +499,8 @@ A:link, A:visited, A:active { text-decoration: underline }
Returns
xsltNeedElemSpaceHandling +xsltParseStylesheetImport +xsltParseStylesheetInclude xsltXPathGetTransformContext
diff --git a/doc/APIchunk1.html b/doc/APIchunk1.html index ea12f190..61cbb0cf 100644 --- a/doc/APIchunk1.html +++ b/doc/APIchunk1.html @@ -292,6 +292,10 @@ A:link, A:visited, A:active { text-decoration: underline }
xsltGetQNameURI
+
amiss
+
+xsltParseStylesheetProcess +
analyzes
xsltGetQNameURI diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html index c9cc4265..dad48353 100644 --- a/doc/APIchunk2.html +++ b/doc/APIchunk2.html @@ -546,6 +546,11 @@ A:link, A:visited, A:active { text-decoration: underline } xsltRegisterAllElement xsltTransformFunction
+
else
+
+xsltParseStylesheetImport +xsltParseStylesheetInclude +
emitted
xsltSetGenericDebugFunc @@ -575,6 +580,7 @@ A:link, A:visited, A:active { text-decoration: underline }
everything
xsltFindElemSpaceHandling +xsltParseStylesheetProcess
example
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html index f485c4ad..ea5694d1 100644 --- a/doc/APIchunk3.html +++ b/doc/APIchunk3.html @@ -96,6 +96,8 @@ A:link, A:visited, A:active { text-decoration: underline } xsltAddKey xsltAddStackElemList xsltCompilePattern +xsltParseStylesheetImport +xsltParseStylesheetInclude xsltRegisterExtElement xsltRegisterExtFunction xsltRegisterExtPrefix diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html index f9057ff2..d84bba26 100644 --- a/doc/APIchunk4.html +++ b/doc/APIchunk4.html @@ -393,7 +393,6 @@ A:link, A:visited, A:active { text-decoration: underline } xsltNewTransformContext xsltParseStylesheetDoc xsltParseStylesheetFile -xsltParseStylesheetProcess xsltSetGenericDebugFunc xsltSetGenericErrorFunc xsltTemplateProcess diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html index fbca2bd3..c4fdf562 100644 --- a/doc/APIchunk5.html +++ b/doc/APIchunk5.html @@ -201,6 +201,7 @@ A:link, A:visited, A:active { text-decoration: underline }
parameter
xsltEvalOneUserParam +xsltParseStylesheetProcess xsltQuoteOneUserParam
parameters
diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html index 54e669af..2fdc639f 100644 --- a/doc/APIchunk6.html +++ b/doc/APIchunk6.html @@ -219,6 +219,10 @@ A:link, A:visited, A:active { text-decoration: underline }
xsltParseTemplateContent
+
ret
+
+xsltParseStylesheetProcess +
retrieve
xsltXPathGetTransformContext @@ -246,6 +250,7 @@ A:link, A:visited, A:active { text-decoration: underline }
xsltGetNamespace xsltGetSpecialNamespace +xsltParseStylesheetProcess
rule
@@ -367,6 +372,12 @@ A:link, A:visited, A:active { text-decoration: underline } xsltAllocateExtra xsltAllocateExtraCtxt
+
something
+
+xsltParseStylesheetImport +xsltParseStylesheetInclude +xsltParseStylesheetProcess +
sort
xsltDoSortFunction @@ -485,7 +496,6 @@ A:link, A:visited, A:active { text-decoration: underline } xsltLoadStylesheetPI xsltParseStylesheetDoc xsltParseStylesheetFile -xsltParseStylesheetProcess xsltStylePreComp xsltTemplate
@@ -533,6 +543,8 @@ A:link, A:visited, A:active { text-decoration: underline } xsltEvalGlobalVariables xsltEvalOneUserParam xsltEvalUserParams +xsltParseStylesheetImport +xsltParseStylesheetInclude xsltQuoteOneUserParam xsltQuoteUserParams xsltRegisterExtElement diff --git a/doc/APIfiles.html b/doc/APIfiles.html index 65dd02a1..8cfdd031 100644 --- a/doc/APIfiles.html +++ b/doc/APIfiles.html @@ -130,6 +130,7 @@ A:link, A:visited, A:active { text-decoration: underline } xsltFreeExts xsltPreComputeExtModuleElement xsltRegisterTestModule +xsltDebugDumpExtensions

Module extra:

diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html index 6782cf48..10bb252a 100644 --- a/doc/APIfunctions.html +++ b/doc/APIfunctions.html @@ -77,6 +77,7 @@ A:link, A:visited, A:active { text-decoration: underline }

Type FILE *:

+xsltDebugDumpExtensions xsltApplyStylesheetUser xsltProfileStylesheet xsltRunStylesheetUser diff --git a/doc/libxslt-api.xml b/doc/libxslt-api.xml index fa259338..fbdabe3c 100644 --- a/doc/libxslt-api.xml +++ b/doc/libxslt-api.xml @@ -91,6 +91,7 @@ + @@ -666,6 +667,10 @@ + + + + @@ -1204,14 +1209,14 @@ - parse an XSLT stylesheet strip-space element and record elements needing stripping - + parse an XSLT stylesheet strip-space element and record elements needing stripping. Returns zero on success and something else on failure. + - parse an XSLT stylesheet strip-space element and record elements needing stripping - + parse an XSLT stylesheet strip-space element and record elements needing stripping. Returns zero on success, something else on failure. + @@ -1229,7 +1234,7 @@ parse an XSLT stylesheet adding the associated structures - + diff --git a/doc/libxslt-decl.txt b/doc/libxslt-decl.txt index 2650259a..3375b912 100644 --- a/doc/libxslt-decl.txt +++ b/doc/libxslt-decl.txt @@ -326,6 +326,11 @@ xsltStylesheetPtr style,xmlNodePtr inst void void + +xsltDebugDumpExtensions +void +FILE * output + XSLT_REGISTER_FUNCTION_LOOKUP #define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \ @@ -405,12 +410,12 @@ xmlXPathContextPtr ctxt xsltParseStylesheetImport -void +int xsltStylesheetPtr style,xmlNodePtr cur xsltParseStylesheetInclude -void +int xsltStylesheetPtr style,xmlNodePtr cur diff --git a/doc/libxslt-refs.xml b/doc/libxslt-refs.xml index b563630f..2448e00c 100644 --- a/doc/libxslt-refs.xml +++ b/doc/libxslt-refs.xml @@ -607,6 +607,7 @@ + @@ -1173,6 +1174,7 @@ + @@ -1748,6 +1750,8 @@ + + @@ -2015,6 +2019,9 @@ + + + @@ -2610,6 +2617,10 @@ + + + + @@ -2632,6 +2643,7 @@ + @@ -2703,6 +2715,8 @@ + + @@ -3298,7 +3312,6 @@ - @@ -3501,6 +3514,7 @@ + @@ -3879,6 +3893,9 @@ + + + @@ -3901,6 +3918,7 @@ + @@ -4000,6 +4018,11 @@ + + + + + @@ -4095,7 +4118,6 @@ - @@ -4135,6 +4157,8 @@ + + @@ -4468,6 +4492,9 @@ + + + @@ -4643,6 +4670,12 @@ + + + + + + diff --git a/doc/xsltproc.xml b/doc/xsltproc.xml index 04a6a0f3..6807aa6c 100644 --- a/doc/xsltproc.xml +++ b/doc/xsltproc.xml @@ -50,6 +50,7 @@ --catalogs --xinclude --profile + --dumpextensions file1 @@ -300,6 +301,17 @@ + + + + + + Dumps the list of all registered extensions on stdout. + + + + + diff --git a/libxslt/extensions.c b/libxslt/extensions.c index cfd9d760..befd8aff 100644 --- a/libxslt/extensions.c +++ b/libxslt/extensions.c @@ -1587,3 +1587,37 @@ xsltCleanupGlobals(void) xsltUnregisterAllExtModuleTopLevel(); } +static void +xsltDebugDumpExtensionsCallback(void* function, FILE *output, const xmlChar* name, const xmlChar* URI, const xmlChar* not_used) { + if (!name||!URI) + return; + fprintf(output,"{%s}%s\n",URI,name); +} + +/** + * xsltDebugDumpExtensions: + * @output: the FILE * for the output, if NULL stdout is used + * + * Dumps a list of the registered XSLT extension functions and elements + */ +void +xsltDebugDumpExtensions(FILE * output) +{ + if (output == NULL) + output = stdout; + fprintf(output,"Registered XSLT Extensions\n--------------------------\n"); + if (!xsltFunctionsHash) + fprintf(output,"No registered extension functions\n"); + else { + fprintf(output,"Registered Extension Functions:\n"); + xmlHashScanFull(xsltFunctionsHash,(xmlHashScannerFull)xsltDebugDumpExtensionsCallback,output); + } + if (!xsltElementsHash) + fprintf(output,"\nNo registered extension elements\n"); + else { + fprintf(output,"\nRegistered Extension Elements:\n"); + xmlHashScanFull(xsltElementsHash,(xmlHashScannerFull)xsltDebugDumpExtensionsCallback,output); + } + +} + diff --git a/libxslt/extensions.h b/libxslt/extensions.h index bad3bff7..01f04733 100644 --- a/libxslt/extensions.h +++ b/libxslt/extensions.h @@ -186,6 +186,8 @@ xsltElemPreCompPtr xsltPreComputeExtModuleElement(xsltStylesheetPtr style, * Test module http://xmlsoft.org/XSLT/ */ void xsltRegisterTestModule (void); +void xsltDebugDumpExtensions(FILE * output); + #ifdef __cplusplus } diff --git a/python/libxsltclass.txt b/python/libxsltclass.txt index fb320166..ec10e7f7 100644 --- a/python/libxsltclass.txt +++ b/python/libxsltclass.txt @@ -6,6 +6,7 @@ # functions from module extensions +debugDumpExtensions() registerTestModule() unregisterExtModule() unregisterExtModuleElement() diff --git a/win32/libxslt.def.src b/win32/libxslt.def.src index 5687cc53..42298b5f 100644 --- a/win32/libxslt.def.src +++ b/win32/libxslt.def.src @@ -83,6 +83,7 @@ EXPORTS /* Test module http://xmlsoft.org/XSLT/ */ xsltRegisterTestModule + xsltDebugDumpExtensions /* extra.h diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c index 69a6702a..3fff5a87 100644 --- a/xsltproc/xsltproc.c +++ b/xsltproc/xsltproc.c @@ -88,6 +88,7 @@ xmlParserInputPtr xmlNoNetExternalEntityLoader(const char *URL, static int debug = 0; static int repeat = 0; static int timing = 0; +static int dumpextensions = 0; static int novalid = 0; static int noout = 0; #ifdef LIBXML_DOCB_ENABLED @@ -236,6 +237,7 @@ static void xsltProcess(xmlDocPtr doc, xsltStylesheetPtr cur, const char *filename) { xmlDocPtr res; xsltTransformContextPtr ctxt; + #ifdef LIBXML_XINCLUDE_ENABLED if (xinclude) { @@ -363,6 +365,7 @@ static void usage(const char *name) { printf("\t--timing: display the time used\n"); printf("\t--repeat: run the transformation 20 times\n"); printf("\t--debug: dump the tree of the result instead\n"); + printf("\t--dumpextensions: dump the registered extension elements and functions to stdout\n"); printf("\t--novalid skip the Dtd loading phase\n"); printf("\t--noout: do not dump the result\n"); printf("\t--maxdepth val : increase the maximum depth\n"); @@ -542,7 +545,11 @@ main(int argc, char **argv) if (value > 0) xsltMaxDepth = value; } - } else { + } else if ((!strcmp(argv[i],"-dumpextensions"))|| + (!strcmp(argv[i],"--dumpextensions"))) { + dumpextensions++; + + } else { fprintf(stderr, "Unknown option %s\n", argv[i]); usage(argv[0]); return (3); @@ -587,6 +594,9 @@ main(int argc, char **argv) i += 2; continue; } + if (dumpextensions) + xsltDebugDumpExtensions(NULL); + if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) { if (timing) startTimer();