ReactOS 0.4.16-dev-2208-g6350669
extensions.h File Reference
#include <libxml/xpath.h>
#include "xsltexports.h"
#include "xsltInternals.h"
Include dependency graph for extensions.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void *(* xsltStyleExtInitFunction) (xsltStylesheetPtr style, const xmlChar *URI)
 
typedef void(* xsltStyleExtShutdownFunction) (xsltStylesheetPtr style, const xmlChar *URI, void *data)
 
typedef void *(* xsltExtInitFunction) (xsltTransformContextPtr ctxt, const xmlChar *URI)
 
typedef void(* xsltExtShutdownFunction) (xsltTransformContextPtr ctxt, const xmlChar *URI, void *data)
 
typedef xsltElemPreCompPtr(* xsltPreComputeFunction) (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
 
typedef void(* xsltTopLevelFunction) (xsltStylesheetPtr style, xmlNodePtr inst)
 

Functions

XSLTPUBFUN void XSLTCALL xsltInitGlobals (void)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtModule (const xmlChar *URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFull (const xmlChar *URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc)
 
XSLTPUBFUN int XSLTCALL xsltUnregisterExtModule (const xmlChar *URI)
 
XSLTPUBFUN void *XSLTCALL xsltGetExtData (xsltTransformContextPtr ctxt, const xmlChar *URI)
 
XSLTPUBFUN void *XSLTCALL xsltStyleGetExtData (xsltStylesheetPtr style, const xmlChar *URI)
 
XSLTPUBFUN void XSLTCALL xsltShutdownCtxtExts (xsltTransformContextPtr ctxt)
 
XSLTPUBFUN void XSLTCALL xsltShutdownExts (xsltStylesheetPtr style)
 
XSLTPUBFUN xsltTransformContextPtr XSLTCALL xsltXPathGetTransformContext (xmlXPathParserContextPtr ctxt)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFunction (const xmlChar *name, const xmlChar *URI, xmlXPathFunction function)
 
XSLTPUBFUN xmlXPathFunction XSLTCALL xsltExtModuleFunctionLookup (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleFunction (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltNewElemPreComp (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
 
XSLTPUBFUN void XSLTCALL xsltInitElemPreComp (xsltElemPreCompPtr comp, xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function, xsltElemPreCompDeallocator freeFunc)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleElement (const xmlChar *name, const xmlChar *URI, xsltPreComputeFunction precomp, xsltTransformFunction transform)
 
XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtElementLookup (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtModuleElementLookup (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN xsltPreComputeFunction XSLTCALL xsltExtModuleElementPreComputeLookup (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleElement (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleTopLevel (const xmlChar *name, const xmlChar *URI, xsltTopLevelFunction function)
 
XSLTPUBFUN xsltTopLevelFunction XSLTCALL xsltExtModuleTopLevelLookup (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleTopLevel (const xmlChar *name, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtFunction (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI, xmlXPathFunction function)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtElement (xsltTransformContextPtr ctxt, const xmlChar *name, const xmlChar *URI, xsltTransformFunction function)
 
XSLTPUBFUN int XSLTCALL xsltRegisterExtPrefix (xsltStylesheetPtr style, const xmlChar *prefix, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltCheckExtPrefix (xsltStylesheetPtr style, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltCheckExtURI (xsltStylesheetPtr style, const xmlChar *URI)
 
XSLTPUBFUN int XSLTCALL xsltInitCtxtExts (xsltTransformContextPtr ctxt)
 
XSLTPUBFUN void XSLTCALL xsltFreeCtxtExts (xsltTransformContextPtr ctxt)
 
XSLTPUBFUN void XSLTCALL xsltFreeExts (xsltStylesheetPtr style)
 
XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltPreComputeExtModuleElement (xsltStylesheetPtr style, xmlNodePtr inst)
 
XSLTPUBFUN xmlHashTablePtr XSLTCALL xsltGetExtInfo (xsltStylesheetPtr style, const xmlChar *URI)
 
XSLTPUBFUN void XSLTCALL xsltRegisterTestModule (void)
 
XSLTPUBFUN void XSLTCALL xsltDebugDumpExtensions (FILE *output)
 

Typedef Documentation

◆ xsltExtInitFunction

typedef void *(* xsltExtInitFunction) (xsltTransformContextPtr ctxt, const xmlChar *URI)

xsltExtInitFunction: @ctxt: an XSLT transformation context @URI: the namespace URI for the extension

A function called at initialization time of an XSLT extension module.

Returns a pointer to the module specific data for this transformation.

Definition at line 69 of file extensions.h.

◆ xsltExtShutdownFunction

typedef void(* xsltExtShutdownFunction) (xsltTransformContextPtr ctxt, const xmlChar *URI, void *data)

xsltExtShutdownFunction: @ctxt: an XSLT transformation context @URI: the namespace URI for the extension @data: the data associated to this module

A function called at shutdown time of an XSLT extension module.

Definition at line 80 of file extensions.h.

◆ xsltPreComputeFunction

typedef xsltElemPreCompPtr(* xsltPreComputeFunction) (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)

Definition at line 141 of file extensions.h.

◆ xsltStyleExtInitFunction

typedef void *(* xsltStyleExtInitFunction) (xsltStylesheetPtr style, const xmlChar *URI)

xsltStyleExtInitFunction: @ctxt: an XSLT stylesheet @URI: the namespace URI for the extension

A function called at initialization time of an XSLT extension module.

Returns a pointer to the module specific data for this transformation.

Definition at line 45 of file extensions.h.

◆ xsltStyleExtShutdownFunction

typedef void(* xsltStyleExtShutdownFunction) (xsltStylesheetPtr style, const xmlChar *URI, void *data)

xsltStyleExtShutdownFunction: @ctxt: an XSLT stylesheet @URI: the namespace URI for the extension @data: the data associated to this module

A function called at shutdown time of an XSLT extension module.

Definition at line 56 of file extensions.h.

◆ xsltTopLevelFunction

typedef void(* xsltTopLevelFunction) (xsltStylesheetPtr style, xmlNodePtr inst)

Definition at line 183 of file extensions.h.

Function Documentation

◆ xsltCheckExtPrefix()

XSLTPUBFUN int XSLTCALL xsltCheckExtPrefix ( xsltStylesheetPtr  style,
const xmlChar URI 
)

xsltCheckExtPrefix: @style: the stylesheet @URI: the namespace prefix (possibly NULL)

Check if the given prefix is one of the declared extensions. This is intended to be called only at compile-time. Called by: xsltGetInheritedNsList() (xslt.c) xsltParseTemplateContent (xslt.c)

Returns 1 if this is an extension, 0 otherwise

Definition at line 1183 of file extensions.c.

1184{
1185#ifdef XSLT_REFACTORED
1186 if ((style == NULL) || (style->compCtxt == NULL) ||
1187 (XSLT_CCTXT(style)->inode == NULL) ||
1188 (XSLT_CCTXT(style)->inode->extElemNs == NULL))
1189 return (0);
1190 /*
1191 * Lookup the extension namespaces registered
1192 * at the current node in the stylesheet's tree.
1193 */
1194 if (XSLT_CCTXT(style)->inode->extElemNs != NULL) {
1195 int i;
1196 xsltPointerListPtr list = XSLT_CCTXT(style)->inode->extElemNs;
1197
1198 for (i = 0; i < list->number; i++) {
1199 if (xmlStrEqual((const xmlChar *) list->items[i],
1200 URI))
1201 {
1202 return(1);
1203 }
1204 }
1205 }
1206#else
1208
1209 if ((style == NULL) || (style->nsDefs == NULL))
1210 return (0);
1211 if (URI == NULL)
1212 URI = BAD_CAST "#default";
1213 cur = (xsltExtDefPtr) style->nsDefs;
1214 while (cur != NULL) {
1215 /*
1216 * NOTE: This was change to work on namespace names rather
1217 * than namespace prefixes. This fixes bug #339583.
1218 * TODO: Consider renaming the field "prefix" of xsltExtDef
1219 * to "href".
1220 */
1221 if (xmlStrEqual(URI, cur->prefix))
1222 return (1);
1223 cur = cur->next;
1224 }
1225#endif
1226 return (0);
1227}
xsltExtDef * xsltExtDefPtr
Definition: extensions.c:56
Arabic default style
Definition: afstyles.h:94
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
Definition: list.h:37
#define NULL
Definition: types.h:112
FxCollectionEntry * cur
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: fs.h:78
#define BAD_CAST
Definition: xmlstring.h:35
XMLPUBFUN int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:162
unsigned char xmlChar
Definition: xmlstring.h:28

Referenced by xsltGetInheritedNsList(), and xsltParseTemplateContent().

◆ xsltCheckExtURI()

XSLTPUBFUN int XSLTCALL xsltCheckExtURI ( xsltStylesheetPtr  style,
const xmlChar URI 
)

xsltCheckExtURI: @style: the stylesheet @URI: the namespace URI (possibly NULL)

Check if the given prefix is one of the declared extensions. This is intended to be called only at compile-time. Called by: xsltPrecomputeStylesheet() (xslt.c) xsltParseTemplateContent (xslt.c)

Returns 1 if this is an extension, 0 otherwise

Definition at line 1243 of file extensions.c.

1244{
1246
1247 if ((style == NULL) || (style->nsDefs == NULL))
1248 return (0);
1249 if (URI == NULL)
1250 return (0);
1251 cur = (xsltExtDefPtr) style->nsDefs;
1252 while (cur != NULL) {
1253 if (xmlStrEqual(URI, cur->URI))
1254 return (1);
1255 cur = cur->next;
1256 }
1257 return (0);
1258}

Referenced by xsltPreprocessStylesheet().

◆ xsltDebugDumpExtensions()

XSLTPUBFUN void XSLTCALL xsltDebugDumpExtensions ( FILE output)

xsltDebugDumpExtensions: @output: the FILE * for the output, if NULL stdout is used

Dumps a list of the registered XSLT extension functions and elements

Definition at line 2348 of file extensions.c.

2349{
2350 if (output == NULL)
2351 output = stdout;
2352 fprintf(output,
2353 "Registered XSLT Extensions\n--------------------------\n");
2355 if (!xsltFunctionsHash) {
2356 fprintf(output, "No registered extension functions\n");
2357 } else {
2358 fprintf(output, "Registered extension functions:\n");
2360 output);
2361 }
2362 if (!xsltTopLevelsHash) {
2363 fprintf(output, "\nNo registered top-level extension elements\n");
2364 } else {
2365 fprintf(output, "\nRegistered top-level extension elements:\n");
2367 output);
2368 }
2369 if (!xsltElementsHash) {
2370 fprintf(output, "\nNo registered instruction extension elements\n");
2371 } else {
2372 fprintf(output, "\nRegistered instruction extension elements:\n");
2374 output);
2375 }
2376 if (!xsltExtensionsHash) {
2377 fprintf(output, "\nNo registered extension modules\n");
2378 } else {
2379 fprintf(output, "\nRegistered extension modules:\n");
2381 output);
2382 }
2384}
static xmlMutexPtr xsltExtMutex
Definition: extensions.c:92
static void xsltDebugDumpExtModulesCallback(void *function ATTRIBUTE_UNUSED, void *data, const xmlChar *URI, const xmlChar *not_used ATTRIBUTE_UNUSED, const xmlChar *not_used2 ATTRIBUTE_UNUSED)
Definition: extensions.c:2330
static xmlHashTablePtr xsltTopLevelsHash
Definition: extensions.c:90
static xmlHashTablePtr xsltFunctionsHash
Definition: extensions.c:88
static xmlHashTablePtr xsltElementsHash
Definition: extensions.c:89
static xmlHashTablePtr xsltExtensionsHash
Definition: extensions.c:87
static void xsltDebugDumpExtensionsCallback(void *function ATTRIBUTE_UNUSED, void *data, const xmlChar *name, const xmlChar *URI, const xmlChar *not_used ATTRIBUTE_UNUSED)
Definition: extensions.c:2318
int WINAPIV fprintf(FILE *file, const char *format,...)
Definition: file.c:5549
#define stdout
XMLPUBFUN void xmlMutexLock(xmlMutexPtr tok)
Definition: threads.c:201
XMLPUBFUN void xmlMutexUnlock(xmlMutexPtr tok)
Definition: threads.c:225
void xmlHashScanFull(xmlHashTablePtr hash, xmlHashScannerFull scan, void *data)
Definition: hash.c:914

◆ xsltExtElementLookup()

XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtElementLookup ( xsltTransformContextPtr  ctxt,
const xmlChar name,
const xmlChar URI 
)

Definition at line 1693 of file extensions.c.

1695{
1697
1698 if ((name == NULL) || (URI == NULL))
1699 return (NULL);
1700
1701 if ((ctxt != NULL) && (ctxt->extElements != NULL)) {
1703 if (ret != NULL) {
1704 return(ret);
1705 }
1706 }
1707
1709
1710 return (ret);
1711}
xsltTransformFunction xsltExtModuleElementLookup(const xmlChar *name, const xmlChar *URI)
Definition: extensions.c:1723
return ret
Definition: mutex.c:146
void * xmlHashLookup2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2)
Definition: hash.c:754
xmlHashTablePtr extElements
Definition: name.c:39
#define XML_CAST_FPTR(fptr)
void(* xsltTransformFunction)(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltElemPreCompPtr comp)

Referenced by xsltApplySequenceConstructor(), and xsltElementAvailableFunction().

◆ xsltExtModuleElementLookup()

XSLTPUBFUN xsltTransformFunction XSLTCALL xsltExtModuleElementLookup ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1723 of file extensions.c.

1724{
1726
1727 if ((xsltElementsHash == NULL) || (name == NULL) || (URI == NULL))
1728 return (NULL);
1729
1731
1733
1735
1736 /*
1737 * if function lookup fails, attempt a dynamic load on
1738 * supported platforms
1739 */
1740 if (NULL == ext) {
1741 if (!xsltExtModuleRegisterDynamic(URI)) {
1743
1746
1748 }
1749 }
1750
1751 if (ext == NULL)
1752 return (NULL);
1753 return (ext->transform);
1754}
static int xsltExtModuleRegisterDynamic(const xmlChar *URI ATTRIBUTE_UNUSED)
Definition: extensions.c:481
xsltExtElement * xsltExtElementPtr
Definition: extensions.c:81
static const WCHAR *const ext[]
Definition: module.c:53

Referenced by xsltExtElementLookup().

◆ xsltExtModuleElementPreComputeLookup()

XSLTPUBFUN xsltPreComputeFunction XSLTCALL xsltExtModuleElementPreComputeLookup ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1766 of file extensions.c.

1768{
1770
1771 if ((xsltElementsHash == NULL) || (name == NULL) || (URI == NULL))
1772 return (NULL);
1773
1775
1777
1779
1780 if (ext == NULL) {
1781 if (!xsltExtModuleRegisterDynamic(URI)) {
1783
1786
1788 }
1789 }
1790
1791 if (ext == NULL)
1792 return (NULL);
1793 return (ext->precomp);
1794}

◆ xsltExtModuleFunctionLookup()

XSLTPUBFUN xmlXPathFunction XSLTCALL xsltExtModuleFunctionLookup ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1441 of file extensions.c.

1442{
1443 xmlXPathFunction ret;
1444
1445 if ((xsltFunctionsHash == NULL) || (name == NULL) || (URI == NULL))
1446 return (NULL);
1447
1449
1451
1453
1454 /* if lookup fails, attempt a dynamic load on supported platforms */
1455 if (NULL == ret) {
1456 if (!xsltExtModuleRegisterDynamic(URI)) {
1458
1461
1463 }
1464 }
1465
1466 return ret;
1467}

Referenced by xsltXPathFunctionLookup().

◆ xsltExtModuleTopLevelLookup()

XSLTPUBFUN xsltTopLevelFunction XSLTCALL xsltExtModuleTopLevelLookup ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1881 of file extensions.c.

1882{
1884
1885 if ((xsltTopLevelsHash == NULL) || (name == NULL) || (URI == NULL))
1886 return (NULL);
1887
1889
1891
1893
1894 /* if lookup fails, attempt a dynamic load on supported platforms */
1895 if (NULL == ret) {
1896 if (!xsltExtModuleRegisterDynamic(URI)) {
1898
1900
1902 }
1903 }
1904
1905 return (ret);
1906}
void(* xsltTopLevelFunction)(xsltStylesheetPtr style, xmlNodePtr inst)
Definition: extensions.h:183

Referenced by xsltParseStylesheetTop().

◆ xsltFreeCtxtExts()

XSLTPUBFUN void XSLTCALL xsltFreeCtxtExts ( xsltTransformContextPtr  ctxt)

xsltFreeCtxtExts: @ctxt: an XSLT transformation context

Free the XSLT extension data

Definition at line 664 of file extensions.c.

665{
666 if (ctxt->extElements != NULL)
668 if (ctxt->extFunctions != NULL)
670}
void xmlHashFree(xmlHashTablePtr hash, xmlHashDeallocator dealloc)
Definition: hash.c:229
xmlHashTablePtr extFunctions

Referenced by xsltFreeTransformContext().

◆ xsltFreeExts()

XSLTPUBFUN void XSLTCALL xsltFreeExts ( xsltStylesheetPtr  style)

xsltFreeExts: @style: an XSLT stylesheet

Free up the memory used by XSLT extensions in a stylesheet

Definition at line 501 of file extensions.c.

502{
503 if (style->nsDefs != NULL)
505}
static void xsltFreeExtDefList(xsltExtDefPtr extensiond)
Definition: extensions.c:153

Referenced by xsltFreeStylesheet().

◆ xsltGetExtData()

XSLTPUBFUN void *XSLTCALL xsltGetExtData ( xsltTransformContextPtr  ctxt,
const xmlChar URI 
)

xsltGetExtData: @ctxt: an XSLT transformation context @URI: the URI associated to the exension module

Retrieve the data associated to the extension module in this given transformation.

Returns the pointer or NULL if not present

Definition at line 883 of file extensions.c.

884{
886
887 if ((ctxt == NULL) || (URI == NULL))
888 return (NULL);
889 if (ctxt->extInfos == NULL) {
890 ctxt->extInfos = xmlHashCreate(10);
891 if (ctxt->extInfos == NULL)
892 return (NULL);
893 data = NULL;
894 } else {
896 }
897 if (data == NULL) {
898 void *extData;
900
902
904
906
907 if (module == NULL) {
908#ifdef WITH_XSLT_DEBUG_EXTENSIONS
910 "Not registered extension module: %s\n", URI);
911#endif
912 return (NULL);
913 } else {
914 if (module->initFunc == NULL)
915 return (NULL);
916
917#ifdef WITH_XSLT_DEBUG_EXTENSIONS
919 "Initializing module: %s\n", URI);
920#endif
921
922 extData = module->initFunc(ctxt, URI);
923 if (extData == NULL)
924 return (NULL);
925
926 data = xsltNewExtData(module, extData);
927 if ((data == NULL) ||
928 (xmlHashAddEntry(ctxt->extInfos, URI, (void *) data) < 0)) {
930 "Failed to register module data: %s\n",
931 URI);
932 if (module->shutdownFunc)
933 module->shutdownFunc(ctxt, URI, extData);
935 return (NULL);
936 }
937 }
938 }
939 return (data->extData);
940}
static void xsltFreeExtData(xsltExtDataPtr ext)
Definition: extensions.c:249
static xsltExtDataPtr xsltNewExtData(xsltExtModulePtr extModule, void *extData)
Definition: extensions.c:225
xsltExtData * xsltExtDataPtr
Definition: extensions.c:74
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * xmlHashLookup(xmlHashTablePtr hash, const xmlChar *key)
Definition: hash.c:739
int xmlHashAddEntry(xmlHashTablePtr hash, const xmlChar *key, void *payload)
Definition: hash.c:621
xmlHashTablePtr xmlHashCreate(int size)
Definition: hash.c:160
xmlHashTablePtr extInfos
void xsltTransformError(xsltTransformContextPtr ctxt, xsltStylesheetPtr style, xmlNodePtr node, const char *msg,...)
Definition: xsltutils.c:762
xmlGenericErrorFunc xsltGenericDebug
Definition: xsltutils.c:632
void * xsltGenericDebugContext
Definition: xsltutils.c:633

Referenced by xsltExtElementTest(), and xsltExtFunctionTest().

◆ xsltGetExtInfo()

XSLTPUBFUN xmlHashTablePtr XSLTCALL xsltGetExtInfo ( xsltStylesheetPtr  style,
const xmlChar URI 
)

xsltGetExtInfo: @style: pointer to a stylesheet @URI: the namespace URI desired

looks up URI in extInfos of the stylesheet

returns a pointer to the hash table if found, else NULL

Definition at line 1960 of file extensions.c.

1961{
1963
1964 /*
1965 * TODO: Why do we have a return type of xmlHashTablePtr?
1966 * Is the user-allocated data for extension modules expected
1967 * to be a xmlHashTablePtr only? Or is this intended for
1968 * the EXSLT module only?
1969 */
1970
1971 if (style != NULL && style->extInfos != NULL) {
1972 data = xmlHashLookup(style->extInfos, URI);
1973 if (data != NULL && data->extData != NULL)
1974 return data->extData;
1975 }
1976 return NULL;
1977}

◆ xsltInitCtxtExts()

XSLTPUBFUN int XSLTCALL xsltInitCtxtExts ( xsltTransformContextPtr  ctxt)

xsltInitCtxtExts: @ctxt: an XSLT transformation context

Initialize the set of modules with registered stylesheet data

Returns the number of modules initialized or -1 in case of error

Definition at line 1041 of file extensions.c.

1042{
1045
1046 if (ctxt == NULL)
1047 return (-1);
1048
1049 style = ctxt->style;
1050 if (style == NULL)
1051 return (-1);
1052
1053 ctx.ctxt = ctxt;
1054 ctx.ret = 0;
1055
1056 while (style != NULL) {
1057 if (style->extInfos != NULL) {
1058 xmlHashScan(style->extInfos, xsltInitCtxtExt, &ctx);
1059 if (ctx.ret == -1)
1060 return (-1);
1061 }
1063 }
1064#ifdef WITH_XSLT_DEBUG_EXTENSIONS
1065 xsltGenericDebug(xsltGenericDebugContext, "Registered %d modules\n",
1066 ctx.ret);
1067#endif
1068 return (ctx.ret);
1069}
static void xsltInitCtxtExt(void *payload, void *data, const xmlChar *URI)
Definition: extensions.c:957
xsltStylesheetPtr xsltNextImport(xsltStylesheetPtr cur)
Definition: imports.c:297
void xmlHashScan(xmlHashTablePtr hash, xmlHashScanner scan, void *data)
Definition: hash.c:898
xsltStylesheetPtr style

Referenced by xsltNewTransformContext().

◆ xsltInitElemPreComp()

XSLTPUBFUN void XSLTCALL xsltInitElemPreComp ( xsltElemPreCompPtr  comp,
xsltStylesheetPtr  style,
xmlNodePtr  inst,
xsltTransformFunction  function,
xsltElemPreCompDeallocator  freeFunc 
)

xsltInitElemPreComp: @comp: an xsltElemPreComp (or generally a derived structure) @style: the XSLT stylesheet @inst: the element node @function: the transform function @freeFunc: the @comp deallocator

Initializes an existing xsltElemPreComp structure. This is usefull when extending an xsltElemPreComp to store precomputed data. This function MUST be called on any extension element precomputed data struct.

Definition at line 1560 of file extensions.c.

1563{
1564 comp->type = XSLT_FUNC_EXTENSION;
1565 comp->func = function;
1566 comp->inst = inst;
1567 comp->free = freeFunc;
1568
1569 comp->next = style->preComps;
1570 style->preComps = comp;
1571}
xsltElemPreCompDeallocator free
xsltElemPreCompPtr next
xsltStyleType type
xsltTransformFunction func
@ XSLT_FUNC_EXTENSION

Referenced by xsltNewElemPreComp().

◆ xsltInitGlobals()

XSLTPUBFUN void XSLTCALL xsltInitGlobals ( void  )

Extension Modules API. xsltInitGlobals:

Initialize the global variables for extensions

xsltInitGlobals:

Initialize the global variables for extensions

Definition at line 2282 of file extensions.c.

2283{
2284 if (xsltExtMutex == NULL) {
2286 }
2287}
XMLPUBFUN xmlMutexPtr xmlNewMutex(void)
Definition: threads.c:149

Referenced by xsltApplyStylesheetInternal(), xsltLoadStylesheetPI(), xsltNewSecurityPrefs(), xsltNewTransformContext(), xsltParseStylesheetDoc(), xsltParseStylesheetFile(), xsltParseStylesheetProcess(), xsltRegisterTestModule(), and xsltSetSecurityPrefs().

◆ xsltNewElemPreComp()

XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltNewElemPreComp ( xsltStylesheetPtr  style,
xmlNodePtr  inst,
xsltTransformFunction  function 
)

xsltNewElemPreComp: @style: the XSLT stylesheet @inst: the element node @function: the transform function

Creates and initializes an xsltElemPreComp

Returns the new and initialized xsltElemPreComp

Definition at line 1528 of file extensions.c.

1530{
1532
1534 if (cur == NULL) {
1536 "xsltNewExtElement : malloc failed\n");
1537 return (NULL);
1538 }
1539 memset(cur, 0, sizeof(xsltElemPreComp));
1540
1542
1543 return (cur);
1544}
static void xsltFreeElemPreComp(xsltElemPreCompPtr comp)
Definition: extensions.c:1513
void xsltInitElemPreComp(xsltElemPreCompPtr comp, xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function, xsltElemPreCompDeallocator freeFunc)
Definition: extensions.c:1560
xmlMallocFunc xmlMalloc
Definition: globals.c:193
#define memset(x, y, z)
Definition: compat.h:39
xsltElemPreComp * xsltElemPreCompPtr

Referenced by xsltExtElementPreCompTest(), and xsltPreComputeExtModuleElement().

◆ xsltPreComputeExtModuleElement()

XSLTPUBFUN xsltElemPreCompPtr XSLTCALL xsltPreComputeExtModuleElement ( xsltStylesheetPtr  style,
xmlNodePtr  inst 
)

xsltPreComputeExtModuleElement: @style: the stylesheet @inst: the element node

Precomputes an extension module element

Returns the precomputed data

Definition at line 1583 of file extensions.c.

1584{
1586 xsltElemPreCompPtr comp = NULL;
1587
1588 if ((style == NULL) || (inst == NULL) ||
1589 (inst->type != XML_ELEMENT_NODE) || (inst->ns == NULL))
1590 return (NULL);
1591
1593
1595 xmlHashLookup2(xsltElementsHash, inst->name, inst->ns->href);
1596
1598
1599 /*
1600 * EXT TODO: Now what?
1601 */
1602 if (ext == NULL)
1603 return (NULL);
1604
1605 if (ext->precomp != NULL) {
1606 /*
1607 * REVISIT TODO: Check if the text below is correct.
1608 * This will return a xsltElemPreComp structure or NULL.
1609 * 1) If the the author of the extension needs a
1610 * custom structure to hold the specific values of
1611 * this extension, he will derive a structure based on
1612 * xsltElemPreComp; thus we obviously *cannot* refactor
1613 * the xsltElemPreComp structure, since all already derived
1614 * user-defined strucures will break.
1615 * Example: For the extension xsl:document,
1616 * in xsltDocumentComp() (preproc.c), the structure
1617 * xsltStyleItemDocument is allocated, filled with
1618 * specific values and returned.
1619 * 2) If the author needs no values to be stored in
1620 * this structure, then he'll return NULL;
1621 */
1622 comp = ext->precomp(style, inst, ext->transform);
1623 }
1624 if (comp == NULL) {
1625 /*
1626 * Default creation of a xsltElemPreComp structure, if
1627 * the author of this extension did not create a custom
1628 * structure.
1629 */
1630 comp = xsltNewElemPreComp(style, inst, ext->transform);
1631 }
1632
1633 return (comp);
1634}
xsltElemPreCompPtr xsltNewElemPreComp(xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
Definition: extensions.c:1528

Referenced by xsltStylePreCompute().

◆ xsltRegisterExtElement()

XSLTPUBFUN int XSLTCALL xsltRegisterExtElement ( xsltTransformContextPtr  ctxt,
const xmlChar name,
const xmlChar URI,
xsltTransformFunction  function 
)

Definition at line 643 of file extensions.c.

645{
646 if ((ctxt == NULL) || (name == NULL) ||
647 (URI == NULL) || (function == NULL))
648 return (-1);
649 if (ctxt->extElements == NULL)
650 ctxt->extElements = xmlHashCreate(10);
651 if (ctxt->extElements == NULL)
652 return (-1);
653 return (xmlHashAddEntry2
654 (ctxt->extElements, name, URI, XML_CAST_FPTR(function)));
655}
int xmlHashAddEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, void *payload)
Definition: hash.c:639

Referenced by xsltRegisterAllElement().

◆ xsltRegisterExtFunction()

XSLTPUBFUN int XSLTCALL xsltRegisterExtFunction ( xsltTransformContextPtr  ctxt,
const xmlChar name,
const xmlChar URI,
xmlXPathFunction  function 
)

Definition at line 609 of file extensions.c.

611{
612 int ret;
613
614 if ((ctxt == NULL) || (name == NULL) ||
615 (URI == NULL) || (function == NULL))
616 return (-1);
617 if (ctxt->xpathCtxt != NULL) {
618 xmlXPathRegisterFuncNS(ctxt->xpathCtxt, name, URI, function);
619 }
620 if (ctxt->extFunctions == NULL)
621 ctxt->extFunctions = xmlHashCreate(10);
622 if (ctxt->extFunctions == NULL)
623 return (-1);
624
626 XML_CAST_FPTR(function));
627
628 return(ret);
629}
xmlXPathContextPtr xpathCtxt

◆ xsltRegisterExtModule()

XSLTPUBFUN int XSLTCALL xsltRegisterExtModule ( const xmlChar URI,
xsltExtInitFunction  initFunc,
xsltExtShutdownFunction  shutdownFunc 
)

xsltRegisterExtModule: @URI: URI associated to this module @initFunc: the module initialization function @shutdownFunc: the module shutdown function

Register an XSLT extension module to the library.

Returns 0 if sucessful, -1 in case of error

Definition at line 1325 of file extensions.c.

1328{
1329 return xsltRegisterExtModuleFull(URI, initFunc, shutdownFunc,
1330 NULL, NULL);
1331}
int xsltRegisterExtModuleFull(const xmlChar *URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc)
Definition: extensions.c:1273

◆ xsltRegisterExtModuleElement()

XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleElement ( const xmlChar name,
const xmlChar URI,
xsltPreComputeFunction  precomp,
xsltTransformFunction  transform 
)

Definition at line 1648 of file extensions.c.

1651{
1652 int ret = 0;
1653
1655
1656 if ((name == NULL) || (URI == NULL) || (transform == NULL))
1657 return (-1);
1658
1659 if (xsltElementsHash == NULL)
1661 if (xsltElementsHash == NULL)
1662 return (-1);
1663
1665
1666 ext = xsltNewExtElement(precomp, transform);
1667 if (ext == NULL) {
1668 ret = -1;
1669 goto done;
1670 }
1671
1674
1675done:
1677
1678 return (ret);
1679}
static xsltExtElementPtr xsltNewExtElement(xsltPreComputeFunction precomp, xsltTransformFunction transform)
Definition: extensions.c:272
static void xsltFreeExtElementEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
Definition: extensions.c:306
GLuint GLenum GLenum transform
Definition: glext.h:9407
int xmlHashUpdateEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, void *payload, xmlHashDeallocator dealloc)
Definition: hash.c:699

Referenced by xsltRegisterAllExtras(), and xsltRegisterTestModule().

◆ xsltRegisterExtModuleFull()

XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFull ( const xmlChar URI,
xsltExtInitFunction  initFunc,
xsltExtShutdownFunction  shutdownFunc,
xsltStyleExtInitFunction  styleInitFunc,
xsltStyleExtShutdownFunction  styleShutdownFunc 
)

xsltRegisterExtModuleFull: @URI: URI associated to this module @initFunc: the module initialization function @shutdownFunc: the module shutdown function @styleInitFunc: the module initialization function @styleShutdownFunc: the module shutdown function

Register an XSLT extension module to the library.

Returns 0 if sucessful, -1 in case of error

Definition at line 1273 of file extensions.c.

1278{
1279 int ret;
1281
1282 if ((URI == NULL) || (initFunc == NULL))
1283 return (-1);
1284 if (xsltExtensionsHash == NULL)
1286
1287 if (xsltExtensionsHash == NULL)
1288 return (-1);
1289
1291
1293 if (module != NULL) {
1294 if ((module->initFunc == initFunc) &&
1295 (module->shutdownFunc == shutdownFunc))
1296 ret = 0;
1297 else
1298 ret = -1;
1299 goto done;
1300 }
1301 module = xsltNewExtModule(initFunc, shutdownFunc,
1302 styleInitFunc, styleShutdownFunc);
1303 if (module == NULL) {
1304 ret = -1;
1305 goto done;
1306 }
1307 ret = xmlHashAddEntry(xsltExtensionsHash, URI, (void *) module);
1308
1309done:
1311 return (ret);
1312}
static xsltExtModulePtr xsltNewExtModule(xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc)
Definition: extensions.c:176

Referenced by xsltRegisterExtModule(), and xsltRegisterTestModule().

◆ xsltRegisterExtModuleFunction()

XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleFunction ( const xmlChar name,
const xmlChar URI,
xmlXPathFunction  function 
)

Definition at line 1410 of file extensions.c.

1412{
1413 if ((name == NULL) || (URI == NULL) || (function == NULL))
1414 return (-1);
1415
1416 if (xsltFunctionsHash == NULL)
1418 if (xsltFunctionsHash == NULL)
1419 return (-1);
1420
1422
1424 XML_CAST_FPTR(function), NULL);
1425
1427
1428 return (0);
1429}

Referenced by init_libxslt(), xsltRegisterAllExtras(), and xsltRegisterTestModule().

◆ xsltRegisterExtModuleTopLevel()

XSLTPUBFUN int XSLTCALL xsltRegisterExtModuleTopLevel ( const xmlChar name,
const xmlChar URI,
xsltTopLevelFunction  function 
)

Definition at line 1850 of file extensions.c.

1852{
1853 if ((name == NULL) || (URI == NULL) || (function == NULL))
1854 return (-1);
1855
1856 if (xsltTopLevelsHash == NULL)
1858 if (xsltTopLevelsHash == NULL)
1859 return (-1);
1860
1862
1864 XML_CAST_FPTR(function), NULL);
1865
1867
1868 return (0);
1869}

◆ xsltRegisterExtPrefix()

XSLTPUBFUN int XSLTCALL xsltRegisterExtPrefix ( xsltStylesheetPtr  style,
const xmlChar prefix,
const xmlChar URI 
)

xsltRegisterExtPrefix: @style: an XSLT stylesheet @prefix: the prefix used (optional) @URI: the URI associated to the extension

Registers an extension namespace This is called from xslt.c during compile-time. The given prefix is not needed. Called by: xsltParseExtElemPrefixes() (new function) xsltRegisterExtPrefix() (old function)

Returns 0 in case of success, 1 if the @URI was already registered as an extension namespace and -1 in case of failure

Definition at line 525 of file extensions.c.

527{
528 xsltExtDefPtr def, ret;
529
530 if ((style == NULL) || (URI == NULL))
531 return (-1);
532
533#ifdef WITH_XSLT_DEBUG_EXTENSIONS
535 "Registering extension namespace '%s'.\n", URI);
536#endif
537 def = (xsltExtDefPtr) style->nsDefs;
538#ifdef XSLT_REFACTORED
539 /*
540 * The extension is associated with a namespace name.
541 */
542 while (def != NULL) {
543 if (xmlStrEqual(URI, def->URI))
544 return (1);
545 def = def->next;
546 }
547#else
548 while (def != NULL) {
549 if (xmlStrEqual(prefix, def->prefix))
550 return (-1);
551 def = def->next;
552 }
553#endif
554 ret = xsltNewExtDef(prefix, URI);
555 if (ret == NULL)
556 return (-1);
557 ret->next = (xsltExtDefPtr) style->nsDefs;
558 style->nsDefs = ret;
559
560 /*
561 * check whether there is an extension module with a stylesheet
562 * initialization function.
563 */
564#ifdef XSLT_REFACTORED
565 /*
566 * Don't initialize modules based on specified namespaces via
567 * the attribute "[xsl:]extension-element-prefixes".
568 */
569#else
572
576 if (NULL == module) {
581 }
582 }
583 if (module != NULL) {
585 }
586 }
587#endif
588 return (0);
589}
static xsltExtDefPtr xsltNewExtDef(const xmlChar *prefix, const xmlChar *URI)
Definition: extensions.c:110
void * xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar *URI)
Definition: extensions.c:781
if(dx< 0)
Definition: linetemp.h:194
xmlChar * URI
Definition: extensions.c:60
struct _xsltExtDef * next
Definition: extensions.c:58
xmlChar * prefix
Definition: extensions.c:59
Character const *const prefix
Definition: tempnam.cpp:195

Referenced by xsltParseStylesheetExtPrefix().

◆ xsltRegisterTestModule()

XSLTPUBFUN void XSLTCALL xsltRegisterTestModule ( void  )

Test of the extension module API

xsltRegisterTestModule:

Registers the test module

Definition at line 2250 of file extensions.c.

2251{
2257 xsltRegisterExtModuleFunction((const xmlChar *) "test",
2258 (const xmlChar *) XSLT_DEFAULT_URL,
2260 xsltRegisterExtModuleElement((const xmlChar *) "test",
2261 (const xmlChar *) XSLT_DEFAULT_URL,
2264}
static void xsltExtStyleShutdownTest(xsltStylesheetPtr style ATTRIBUTE_UNUSED, const xmlChar *URI, void *data)
Definition: extensions.c:2227
static void xsltExtFunctionTest(xmlXPathParserContextPtr ctxt, int nargs ATTRIBUTE_UNUSED)
Definition: extensions.c:1996
static void * xsltExtInitTest(xsltTransformContextPtr ctxt, const xmlChar *URI)
Definition: extensions.c:2142
static void * xsltExtStyleInitTest(xsltStylesheetPtr style ATTRIBUTE_UNUSED, const xmlChar *URI)
Definition: extensions.c:2203
int xsltRegisterExtModuleElement(const xmlChar *name, const xmlChar *URI, xsltPreComputeFunction precomp, xsltTransformFunction transform)
Definition: extensions.c:1648
static xsltElemPreCompPtr xsltExtElementPreCompTest(xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
Definition: extensions.c:2046
static void xsltExtElementTest(xsltTransformContextPtr ctxt, xmlNodePtr node, xmlNodePtr inst, xsltElemPreCompPtr comp ATTRIBUTE_UNUSED)
Definition: extensions.c:2090
static void xsltExtShutdownTest(xsltTransformContextPtr ctxt, const xmlChar *URI, void *data)
Definition: extensions.c:2176
void xsltInitGlobals(void)
Definition: extensions.c:2282
int xsltRegisterExtModuleFunction(const xmlChar *name, const xmlChar *URI, xmlXPathFunction function)
Definition: extensions.c:1410
#define XSLT_DEFAULT_URL
Definition: xslt.h:39

◆ xsltShutdownCtxtExts()

XSLTPUBFUN void XSLTCALL xsltShutdownCtxtExts ( xsltTransformContextPtr  ctxt)

xsltShutdownCtxtExts: @ctxt: an XSLT transformation context

Shutdown the set of modules loaded

Definition at line 1106 of file extensions.c.

1107{
1108 if (ctxt == NULL)
1109 return;
1110 if (ctxt->extInfos == NULL)
1111 return;
1114 ctxt->extInfos = NULL;
1115}
static void xsltShutdownCtxtExt(void *payload, void *vctxt, const xmlChar *URI)
Definition: extensions.c:1080
static void xsltFreeExtDataEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
Definition: extensions.c:257

Referenced by xsltApplyStylesheetInternal(), and xsltFreeTransformContext().

◆ xsltShutdownExts()

XSLTPUBFUN void XSLTCALL xsltShutdownExts ( xsltStylesheetPtr  style)

xsltShutdownExts: @style: an XSLT stylesheet

Shutdown the set of modules loaded

Definition at line 1158 of file extensions.c.

1159{
1160 if (style == NULL)
1161 return;
1162 if (style->extInfos == NULL)
1163 return;
1166 style->extInfos = NULL;
1167}
static void xsltShutdownExt(void *payload, void *vctxt, const xmlChar *URI)
Definition: extensions.c:1126

Referenced by xsltFreeStylesheet().

◆ xsltStyleGetExtData()

XSLTPUBFUN void *XSLTCALL xsltStyleGetExtData ( xsltStylesheetPtr  style,
const xmlChar URI 
)

xsltStyleGetExtData: @style: an XSLT stylesheet @URI: the URI associated to the exension module

Retrieve the data associated to the extension module in this given stylesheet. Called by: xsltRegisterExtPrefix(), ( xsltExtElementPreCompTest(), xsltExtInitTest )

Returns the pointer or NULL if not present

Definition at line 781 of file extensions.c.

782{
783 xsltExtDataPtr dataContainer = NULL;
784 xsltStylesheetPtr tmpStyle;
785
786 if ((style == NULL) || (URI == NULL) ||
788 return (NULL);
789
790
791#ifdef XSLT_REFACTORED
792 /*
793 * This is intended for global storage, so only the main
794 * stylesheet will hold the data.
795 */
796 tmpStyle = style;
797 while (tmpStyle->parent != NULL)
798 tmpStyle = tmpStyle->parent;
799 if (tmpStyle->extInfos != NULL) {
800 dataContainer =
801 (xsltExtDataPtr) xmlHashLookup(tmpStyle->extInfos, URI);
802 if (dataContainer != NULL) {
803 /*
804 * The module was already initialized in the context
805 * of this stylesheet; just return the user-data that
806 * comes with it.
807 */
808 return(dataContainer->extData);
809 }
810 }
811#else
812 /*
813 * Old behaviour.
814 */
815 tmpStyle = style;
816 if (tmpStyle->extInfos != NULL) {
817 dataContainer =
818 (xsltExtDataPtr) xmlHashLookup(tmpStyle->extInfos, URI);
819 if (dataContainer != NULL) {
820 return(dataContainer->extData);
821 }
822 }
823#endif
824
825 dataContainer =
827 if (dataContainer != NULL)
828 return (dataContainer->extData);
829 return(NULL);
830}
static xsltExtDataPtr xsltStyleInitializeStylesheetModule(xsltStylesheetPtr style, const xmlChar *URI)
Definition: extensions.c:685
void * extData
Definition: extensions.c:77
struct _xsltStylesheet * parent
xmlHashTablePtr extInfos

Referenced by xsltExtElementPreCompTest(), xsltExtInitTest(), and xsltRegisterExtPrefix().

◆ xsltUnregisterExtModule()

XSLTPUBFUN int XSLTCALL xsltUnregisterExtModule ( const xmlChar URI)

xsltUnregisterExtModule: @URI: URI associated to this module

Unregister an XSLT extension module from the library.

Returns 0 if sucessful, -1 in case of error

Definition at line 1342 of file extensions.c.

1343{
1344 int ret;
1345
1346 if (URI == NULL)
1347 return (-1);
1348 if (xsltExtensionsHash == NULL)
1349 return (-1);
1350
1352
1354
1356
1357 return (ret);
1358}
static void xsltFreeExtModuleEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
Definition: extensions.c:211
int xmlHashRemoveEntry(xmlHashTablePtr hash, const xmlChar *key, xmlHashDeallocator dealloc)
Definition: hash.c:1102

◆ xsltUnregisterExtModuleElement()

XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleElement ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1806 of file extensions.c.

1807{
1808 int ret;
1809
1810 if ((xsltElementsHash == NULL) || (name == NULL) || (URI == NULL))
1811 return (-1);
1812
1814
1817
1819
1820 return(ret);
1821}
int xmlHashRemoveEntry2(xmlHashTablePtr hash, const xmlChar *key, const xmlChar *key2, xmlHashDeallocator dealloc)
Definition: hash.c:1121

◆ xsltUnregisterExtModuleFunction()

XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleFunction ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1479 of file extensions.c.

1480{
1481 int ret;
1482
1483 if ((xsltFunctionsHash == NULL) || (name == NULL) || (URI == NULL))
1484 return (-1);
1485
1487
1489
1491
1492 return(ret);
1493}

◆ xsltUnregisterExtModuleTopLevel()

XSLTPUBFUN int XSLTCALL xsltUnregisterExtModuleTopLevel ( const xmlChar name,
const xmlChar URI 
)

Definition at line 1918 of file extensions.c.

1919{
1920 int ret;
1921
1922 if ((xsltTopLevelsHash == NULL) || (name == NULL) || (URI == NULL))
1923 return (-1);
1924
1926
1928
1930
1931 return(ret);
1932}

◆ xsltXPathGetTransformContext()

XSLTPUBFUN xsltTransformContextPtr XSLTCALL xsltXPathGetTransformContext ( xmlXPathParserContextPtr  ctxt)

xsltXPathGetTransformContext: @ctxt: an XPath transformation context

Provides the XSLT transformation context from the XPath transformation context. This is useful when an XPath function in the extension module is called by the XPath interpreter and that the XSLT context is needed for example to retrieve the associated data pertaining to this XSLT transformation.

Returns the XSLT transformation context or NULL in case of error.

Definition at line 1392 of file extensions.c.

1393{
1394 if ((ctxt == NULL) || (ctxt->context == NULL))
1395 return (NULL);
1396 return (ctxt->context->extra);
1397}

Referenced by xsltCurrentFunction(), xsltDocumentFunction(), xsltDocumentFunctionLoadDocument(), xsltElementAvailableFunction(), xsltExtFunctionTest(), xsltFormatNumberFunction(), xsltFunctionAvailableFunction(), xsltFunctionNodeSet(), xsltGenerateIdFunction(), xsltKeyFunction(), and xsltSystemPropertyFunction().