This provide the API needed for simple and module extension support. Table of Contentsint xsltCheckExtPrefix (xsltStylesheetPtr style, const xmlChar * URI)
void xsltDebugDumpExtensions (FILE * output)
xsltTransformFunction xsltExtElementLookup (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI)
xmlXPathFunction xsltExtFunctionLookup (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI)
Function type: xsltExtInitFunction
void * xsltExtInitFunction (xsltTransformContextPtr ctxt, const xmlChar * URI)
xsltTransformFunction xsltExtModuleElementLookup (const xmlChar * name, const xmlChar * URI)
xsltPreComputeFunction xsltExtModuleElementPreComputeLookup (const xmlChar * name, const xmlChar * URI)
xmlXPathFunction xsltExtModuleFunctionLookup (const xmlChar * name, const xmlChar * URI)
xsltTopLevelFunction xsltExtModuleTopLevelLookup (const xmlChar * name, const xmlChar * URI)
Function type: xsltExtShutdownFunction
void xsltExtShutdownFunction (xsltTransformContextPtr ctxt, const xmlChar * URI, void * data)
void xsltFreeCtxtExts (xsltTransformContextPtr ctxt)
void xsltFreeExts (xsltStylesheetPtr style)
void * xsltGetExtData (xsltTransformContextPtr ctxt, const xmlChar * URI)
xmlHashTablePtr xsltGetExtInfo (xsltStylesheetPtr style, const xmlChar * URI)
int xsltInitCtxtExts (xsltTransformContextPtr ctxt)
void xsltInitElemPreComp (xsltElemPreCompPtr comp, xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function, xsltElemPreCompDeallocator freeFunc)
xsltElemPreCompPtr xsltNewElemPreComp (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
xsltElemPreCompPtr xsltPreComputeExtModuleElement (xsltStylesheetPtr style, xmlNodePtr inst)
Function type: xsltPreComputeFunction
xsltElemPreCompPtr xsltPreComputeFunction (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
int xsltRegisterExtElement (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI, xsltTransformFunction function)
int xsltRegisterExtFunction (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI, xmlXPathFunction function)
int xsltRegisterExtModule (const xmlChar * URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc)
int xsltRegisterExtModuleElement (const xmlChar * name, const xmlChar * URI, xsltPreComputeFunction precomp, xsltTransformFunction transform)
int xsltRegisterExtModuleFull (const xmlChar * URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc)
int xsltRegisterExtModuleFunction (const xmlChar * name, const xmlChar * URI, xmlXPathFunction function)
int xsltRegisterExtModuleTopLevel (const xmlChar * name, const xmlChar * URI, xsltTopLevelFunction function)
int xsltRegisterExtPrefix (xsltStylesheetPtr style, const xmlChar * prefix, const xmlChar * URI)
void xsltRegisterTestModule (void)
void xsltShutdownCtxtExts (xsltTransformContextPtr ctxt)
void xsltShutdownExts (xsltStylesheetPtr style)
Function type: xsltStyleExtInitFunction
void * xsltStyleExtInitFunction (xsltStylesheetPtr style, const xmlChar * URI)
Function type: xsltStyleExtShutdownFunction
void xsltStyleExtShutdownFunction (xsltStylesheetPtr style, const xmlChar * URI, void * data)
void * xsltStyleGetExtData (xsltStylesheetPtr style, const xmlChar * URI)
void * xsltStyleStylesheetLevelGetExtData (xsltStylesheetPtr style, const xmlChar * URI)
Function type: xsltTopLevelFunction
void xsltTopLevelFunction (xsltStylesheetPtr style, xmlNodePtr inst)
int xsltUnregisterExtModule (const xmlChar * URI)
int xsltUnregisterExtModuleElement (const xmlChar * name, const xmlChar * URI)
int xsltUnregisterExtModuleFunction (const xmlChar * name, const xmlChar * URI)
int xsltUnregisterExtModuleTopLevel (const xmlChar * name, const xmlChar * URI)
xsltTransformContextPtr xsltXPathGetTransformContext (xmlXPathParserContextPtr ctxt)
Description
Function: xsltCheckExtPrefixint xsltCheckExtPrefix (xsltStylesheetPtr style, const xmlChar * URI)
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)
style: | the stylesheet | URI: | the namespace URI (possibly NULL) | Returns: | 1 if this is an extension, 0 otherwise |
Function: xsltDebugDumpExtensionsvoid xsltDebugDumpExtensions (FILE * output)
Dumps a list of the registered XSLT extension functions and elements
output: | the FILE * for the output, if NULL stdout is used |
Function: xsltExtElementLookupxsltTransformFunction xsltExtElementLookup (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI)
Looks up an extension element. @ctxt can be NULL to search only in module elements.
ctxt: | an XSLT process context | name: | the element name | URI: | the element namespace URI | Returns: | the element callback or NULL if not found |
Function: xsltExtFunctionLookupxmlXPathFunction xsltExtFunctionLookup (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI)
Function type: xsltExtInitFunctionFunction type: xsltExtInitFunction
void * xsltExtInitFunction (xsltTransformContextPtr ctxt, const xmlChar * URI)
A function called at initialization time of an XSLT extension module. ctxt: | an XSLT transformation context | URI: | the namespace URI for the extension | Returns: | a pointer to the module specific data for this transformation. |
Function: xsltExtModuleElementLookupxsltTransformFunction xsltExtModuleElementLookup (const xmlChar * name, const xmlChar * URI)
Looks up an extension module element
name: | the element name | URI: | the element namespace URI | Returns: | the callback function if found, NULL otherwise. |
Function: xsltExtModuleElementPreComputeLookupxsltPreComputeFunction xsltExtModuleElementPreComputeLookup (const xmlChar * name, const xmlChar * URI)
Looks up an extension module element pre-computation function
name: | the element name | URI: | the element namespace URI | Returns: | the callback function if found, NULL otherwise. |
Function: xsltExtModuleFunctionLookupxmlXPathFunction xsltExtModuleFunctionLookup (const xmlChar * name, const xmlChar * URI)
Looks up an extension module function
name: | the function name | URI: | the function namespace URI | Returns: | the function if found, NULL otherwise. |
Function: xsltExtModuleTopLevelLookupxsltTopLevelFunction xsltExtModuleTopLevelLookup (const xmlChar * name, const xmlChar * URI)
Looks up an extension module top-level element
name: | the top-level element name | URI: | the top-level element namespace URI | Returns: | the callback function if found, NULL otherwise. |
Function type: xsltExtShutdownFunctionFunction type: xsltExtShutdownFunction
void xsltExtShutdownFunction (xsltTransformContextPtr ctxt, const xmlChar * URI, void * data)
A function called at shutdown time of an XSLT extension module. ctxt: | an XSLT transformation context | URI: | the namespace URI for the extension | data: | the data associated to this module |
Function: xsltFreeCtxtExtsvoid xsltFreeCtxtExts (xsltTransformContextPtr ctxt)
Free the XSLT extension data
ctxt: | an XSLT transformation context |
Function: xsltFreeExtsvoid xsltFreeExts (xsltStylesheetPtr style)
Free up the memory used by XSLT extensions in a stylesheet
Function: xsltGetExtDatavoid * xsltGetExtData (xsltTransformContextPtr ctxt, const xmlChar * URI)
Retrieve the data associated to the extension module in this given transformation.
ctxt: | an XSLT transformation context | URI: | the URI associated to the exension module | Returns: | the pointer or NULL if not present |
Function: xsltGetExtInfoxmlHashTablePtr xsltGetExtInfo (xsltStylesheetPtr style, const xmlChar * URI)
looks up URI in extInfos of the stylesheet
style: | pointer to a stylesheet | URI: | the namespace URI desired | Returns: | a pointer to the hash table if found, else NULL |
Function: xsltInitCtxtExtsint xsltInitCtxtExts (xsltTransformContextPtr ctxt)
Initialize the set of modules with registered stylesheet data
ctxt: | an XSLT transformation context | Returns: | the number of modules initialized or -1 in case of error |
Function: xsltInitElemPreCompvoid xsltInitElemPreComp (xsltElemPreCompPtr comp, xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function, xsltElemPreCompDeallocator freeFunc)
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.
comp: | an #xsltElemPreComp (or generally a derived structure) | style: | the XSLT stylesheet | inst: | the element node | function: | the transform function | freeFunc: | the @comp deallocator |
Function: xsltNewElemPreCompxsltElemPreCompPtr xsltNewElemPreComp (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
Creates and initializes an #xsltElemPreComp
style: | the XSLT stylesheet | inst: | the element node | function: | the transform function | Returns: | the new and initialized #xsltElemPreComp |
Function: xsltPreComputeExtModuleElementxsltElemPreCompPtr xsltPreComputeExtModuleElement (xsltStylesheetPtr style, xmlNodePtr inst)
Precomputes an extension module element
style: | the stylesheet | inst: | the element node | Returns: | the precomputed data |
Function type: xsltPreComputeFunctionFunction type: xsltPreComputeFunction
xsltElemPreCompPtr xsltPreComputeFunction (xsltStylesheetPtr style, xmlNodePtr inst, xsltTransformFunction function)
style: | | inst: | | function: | | Returns: | |
Function: xsltRegisterExtElementint xsltRegisterExtElement (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI, xsltTransformFunction function)
Registers an extension element
ctxt: | an XSLT transformation context | name: | the name of the element | URI: | the URI associated to the element | function: | the actual implementation which should be called | Returns: | 0 in case of success, -1 in case of failure |
Function: xsltRegisterExtFunctionint xsltRegisterExtFunction (xsltTransformContextPtr ctxt, const xmlChar * name, const xmlChar * URI, xmlXPathFunction function)
Registers an extension function
ctxt: | an XSLT transformation context | name: | the name of the element | URI: | the URI associated to the element | function: | the actual implementation which should be called | Returns: | 0 in case of success, -1 in case of failure |
Function: xsltRegisterExtModuleint xsltRegisterExtModule (const xmlChar * URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc)
Register an XSLT extension module to the library.
URI: | URI associated to this module | initFunc: | the module initialization function | shutdownFunc: | the module shutdown function | Returns: | 0 if sucessful, -1 in case of error |
Function: xsltRegisterExtModuleElementint xsltRegisterExtModuleElement (const xmlChar * name, const xmlChar * URI, xsltPreComputeFunction precomp, xsltTransformFunction transform)
Registers an extension module element.
name: | the element name | URI: | the element namespace URI | precomp: | the pre-computation callback | transform: | the transformation callback | Returns: | 0 if successful, -1 in case of error. |
Function: xsltRegisterExtModuleFullint xsltRegisterExtModuleFull (const xmlChar * URI, xsltExtInitFunction initFunc, xsltExtShutdownFunction shutdownFunc, xsltStyleExtInitFunction styleInitFunc, xsltStyleExtShutdownFunction styleShutdownFunc)
Register an XSLT extension module to the library.
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 | Returns: | 0 if sucessful, -1 in case of error |
Function: xsltRegisterExtModuleFunctionint xsltRegisterExtModuleFunction (const xmlChar * name, const xmlChar * URI, xmlXPathFunction function)
Registers an extension module function.
name: | the function name | URI: | the function namespace URI | function: | the function callback | Returns: | 0 if successful, -1 in case of error. |
Function: xsltRegisterExtModuleTopLevelint xsltRegisterExtModuleTopLevel (const xmlChar * name, const xmlChar * URI, xsltTopLevelFunction function)
Registers an extension module top-level element.
name: | the top-level element name | URI: | the top-level element namespace URI | function: | the top-level element callback | Returns: | 0 if successful, -1 in case of error. |
Function: xsltRegisterExtPrefixint xsltRegisterExtPrefix (xsltStylesheetPtr style, const xmlChar * prefix, const xmlChar * URI)
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)
style: | an XSLT stylesheet | prefix: | the prefix used (optional) | URI: | the URI associated to the extension | Returns: | 0 in case of success, 1 if the @URI was already registered as an extension namespace and -1 in case of failure |
Function: xsltRegisterTestModulevoid xsltRegisterTestModule (void)
Registers the test module
Function: xsltShutdownCtxtExtsvoid xsltShutdownCtxtExts (xsltTransformContextPtr ctxt)
Shutdown the set of modules loaded
ctxt: | an XSLT transformation context |
Function: xsltShutdownExtsvoid xsltShutdownExts (xsltStylesheetPtr style)
Shutdown the set of modules loaded
Function type: xsltStyleExtInitFunctionFunction type: xsltStyleExtInitFunction
void * xsltStyleExtInitFunction (xsltStylesheetPtr style, const xmlChar * URI)
A function called at initialization time of an XSLT extension module. style: | | URI: | the namespace URI for the extension | Returns: | a pointer to the module specific data for this transformation. |
Function type: xsltStyleExtShutdownFunctionFunction type: xsltStyleExtShutdownFunction
void xsltStyleExtShutdownFunction (xsltStylesheetPtr style, const xmlChar * URI, void * data)
A function called at shutdown time of an XSLT extension module. style: | | URI: | the namespace URI for the extension | data: | the data associated to this module |
Function: xsltStyleGetExtDatavoid * xsltStyleGetExtData (xsltStylesheetPtr style, const xmlChar * URI)
Retrieve the data associated to the extension module in this given stylesheet. Called by: xsltRegisterExtPrefix(), ( xsltExtElementPreCompTest(), xsltExtInitTest )
style: | an XSLT stylesheet | URI: | the URI associated to the exension module | Returns: | the pointer or NULL if not present |
Function: xsltStyleStylesheetLevelGetExtDatavoid * xsltStyleStylesheetLevelGetExtData (xsltStylesheetPtr style, const xmlChar * URI)
Retrieve the data associated to the extension module in this given stylesheet.
style: | an XSLT stylesheet | URI: | the URI associated to the exension module | Returns: | the pointer or NULL if not present |
Function type: xsltTopLevelFunctionFunction type: xsltTopLevelFunction
void xsltTopLevelFunction (xsltStylesheetPtr style, xmlNodePtr inst)
Function: xsltUnregisterExtModuleint xsltUnregisterExtModule (const xmlChar * URI)
Unregister an XSLT extension module from the library.
URI: | URI associated to this module | Returns: | 0 if sucessful, -1 in case of error |
Function: xsltUnregisterExtModuleElementint xsltUnregisterExtModuleElement (const xmlChar * name, const xmlChar * URI)
Unregisters an extension module element
name: | the element name | URI: | the element namespace URI | Returns: | 0 if successful, -1 in case of error. |
Function: xsltUnregisterExtModuleFunctionint xsltUnregisterExtModuleFunction (const xmlChar * name, const xmlChar * URI)
Unregisters an extension module function
name: | the function name | URI: | the function namespace URI | Returns: | 0 if successful, -1 in case of error. |
Function: xsltUnregisterExtModuleTopLevelint xsltUnregisterExtModuleTopLevel (const xmlChar * name, const xmlChar * URI)
Unregisters an extension module top-level element
name: | the top-level element name | URI: | the top-level element namespace URI | Returns: | 0 if successful, -1 in case of error. |
Function: xsltXPathGetTransformContextxsltTransformContextPtr xsltXPathGetTransformContext (xmlXPathParserContextPtr ctxt)
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.
ctxt: | an XPath transformation context | Returns: | the XSLT transformation context or NULL in case of error. |
Daniel Veillard |