## extensions

extensions —

## Synopsis

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

## Description

## Details

### 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

### 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

### 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

### 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

### xsltRegisterExtModule ()

    int         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

### xsltRegisterExtModuleFull ()

    int         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

### xsltUnregisterExtModule ()

    int         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

### xsltGetExtData ()

    void*       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

### xsltStyleGetExtData ()

    void*       xsltStyleGetExtData             (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

### xsltShutdownCtxtExts ()

    void        xsltShutdownCtxtExts            (xsltTransformContextPtr ctxt);

Shutdown the set of modules loaded

`ctxt` : | an XSLT transformation context

### xsltShutdownExts ()

    void        xsltShutdownExts                (xsltStylesheetPtr style);

Shutdown the set of modules loaded

`style` : | an XSLT stylesheet

### xsltXPathGetTransformContext ()

    xsltTransformContextPtr 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.

### xsltRegisterExtModuleFunction ()

    int         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.

### xsltExtFunctionLookup ()

    xmlXPathFunction xsltExtFunctionLookup      (xsltTransformContextPtr ctxt,
                                                 const xmlChar *name,
                                                 const xmlChar *URI);

`ctxt` : |
`name` : |
`URI` : |
Returns : |

### xsltExtModuleFunctionLookup ()

    xmlXPathFunction 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.

### xsltUnregisterExtModuleFunction ()

    int         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.

### xsltNewElemPreComp ()

    xsltElemPreCompPtr 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

### xsltInitElemPreComp ()

    void        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

### xsltRegisterExtModuleElement ()

    int         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.

### xsltExtElementLookup ()

    xsltTransformFunction 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

### xsltExtModuleElementLookup ()

    xsltTransformFunction 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.

### xsltExtModuleElementPreComputeLookup ()

    xsltPreComputeFunction 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.

### xsltUnregisterExtModuleElement ()

    int         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.

### xsltTopLevelFunction ()

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

`style` : |
`inst` : |

### xsltRegisterExtModuleTopLevel ()

    int         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.

### xsltExtModuleTopLevelLookup ()

    xsltTopLevelFunction 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.

### xsltUnregisterExtModuleTopLevel ()

    int         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.

### xsltRegisterExtFunction ()

    int         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

### xsltRegisterExtElement ()

    int         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

### xsltRegisterExtPrefix ()

    int         xsltRegisterExtPrefix           (xsltStylesheetPtr style,
                                                 const xmlChar *prefix,
                                                 const xmlChar *URI);

Registers an extension namespace

`style` : | an XSLT stylesheet
`prefix` : | the prefix used
`URI` : | the URI associated to the extension
Returns : | 0 in case of success, -1 in case of failure

### xsltCheckExtPrefix ()

    int         xsltCheckExtPrefix              (xsltStylesheetPtr style,
                                                 const xmlChar *prefix);

Check if the given prefix is one of the declared extensions

`style` : | the stylesheet
`prefix` : | the namespace prefix (possibly NULL)
Returns : | 1 if this is an extension, 0 otherwise

### xsltInitCtxtExts ()

    int         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

### xsltFreeCtxtExts ()

    void        xsltFreeCtxtExts                (xsltTransformContextPtr ctxt);

Free the XSLT extension data

`ctxt` : | an XSLT transformation context

### xsltFreeExts ()

    void        xsltFreeExts                    (xsltStylesheetPtr style);

Free up the memory used by XSLT extensions in a stylesheet

`style` : | an XSLT stylesheet

### xsltPreComputeExtModuleElement ()

    xsltElemPreCompPtr xsltPreComputeExtModuleElement
                                                (xsltStylesheetPtr style,
                                                 xmlNodePtr inst);

Precomputes an extension module element

`style` : | the stylesheet
`inst` : | the element node
Returns : | the precomputed data

### xsltGetExtInfo ()

    xmlHashTablePtr 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

### xsltRegisterTestModule ()

    void        xsltRegisterTestModule          (void);

Registers the test module

### xsltDebugDumpExtensions ()

    void        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