2 * Summary: interface for the extension support
3 * Description: This provide the API needed for simple and module
6 * Copy: See Copyright for the status of this software.
8 * Author: Daniel Veillard
11 #ifndef __XML_XSLT_EXTENSION_H__
12 #define __XML_XSLT_EXTENSION_H__
14 #include <libxml/xpath.h>
15 #include "xsltexports.h"
16 #include "xsltInternals.h"
23 * Extension Modules API.
27 * xsltStyleExtInitFunction:
28 * @ctxt: an XSLT stylesheet
29 * @URI: the namespace URI for the extension
31 * A function called at initialization time of an XSLT extension module.
33 * Returns a pointer to the module specific data for this transformation.
35 typedef void * (*xsltStyleExtInitFunction) (xsltStylesheetPtr style,
39 * xsltStyleExtShutdownFunction:
40 * @ctxt: an XSLT stylesheet
41 * @URI: the namespace URI for the extension
42 * @data: the data associated to this module
44 * A function called at shutdown time of an XSLT extension module.
46 typedef void (*xsltStyleExtShutdownFunction) (xsltStylesheetPtr style,
51 * xsltExtInitFunction:
52 * @ctxt: an XSLT transformation context
53 * @URI: the namespace URI for the extension
55 * A function called at initialization time of an XSLT extension module.
57 * Returns a pointer to the module specific data for this transformation.
59 typedef void * (*xsltExtInitFunction) (xsltTransformContextPtr ctxt,
63 * xsltExtShutdownFunction:
64 * @ctxt: an XSLT transformation context
65 * @URI: the namespace URI for the extension
66 * @data: the data associated to this module
68 * A function called at shutdown time of an XSLT extension module.
70 typedef void (*xsltExtShutdownFunction) (xsltTransformContextPtr ctxt,
74 XSLTPUBFUN int XSLTCALL
75 xsltRegisterExtModule (const xmlChar *URI,
76 xsltExtInitFunction initFunc,
77 xsltExtShutdownFunction shutdownFunc);
78 XSLTPUBFUN int XSLTCALL
79 xsltRegisterExtModuleFull
81 xsltExtInitFunction initFunc,
82 xsltExtShutdownFunction shutdownFunc,
83 xsltStyleExtInitFunction styleInitFunc,
84 xsltStyleExtShutdownFunction styleShutdownFunc);
86 XSLTPUBFUN int XSLTCALL
87 xsltUnregisterExtModule (const xmlChar * URI);
89 XSLTPUBFUN void * XSLTCALL
90 xsltGetExtData (xsltTransformContextPtr ctxt,
93 XSLTPUBFUN void * XSLTCALL
94 xsltStyleGetExtData (xsltStylesheetPtr style,
96 #ifdef XSLT_REFACTORED
97 XSLTPUBFUN void * XSLTCALL
98 xsltStyleStylesheetLevelGetExtData(
99 xsltStylesheetPtr style,
100 const xmlChar * URI);
102 XSLTPUBFUN void XSLTCALL
103 xsltShutdownCtxtExts (xsltTransformContextPtr ctxt);
105 XSLTPUBFUN void XSLTCALL
106 xsltShutdownExts (xsltStylesheetPtr style);
108 XSLTPUBFUN xsltTransformContextPtr XSLTCALL
109 xsltXPathGetTransformContext
110 (xmlXPathParserContextPtr ctxt);
113 * extension functions
115 XSLTPUBFUN int XSLTCALL
116 xsltRegisterExtModuleFunction
117 (const xmlChar *name,
119 xmlXPathFunction function);
120 XSLTPUBFUN xmlXPathFunction XSLTCALL
121 xsltExtModuleFunctionLookup (const xmlChar *name,
123 XSLTPUBFUN int XSLTCALL
124 xsltUnregisterExtModuleFunction
125 (const xmlChar *name,
131 typedef xsltElemPreCompPtr (*xsltPreComputeFunction)
132 (xsltStylesheetPtr style,
134 xsltTransformFunction function);
136 XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
137 xsltNewElemPreComp (xsltStylesheetPtr style,
139 xsltTransformFunction function);
140 XSLTPUBFUN void XSLTCALL
141 xsltInitElemPreComp (xsltElemPreCompPtr comp,
142 xsltStylesheetPtr style,
144 xsltTransformFunction function,
145 xsltElemPreCompDeallocator freeFunc);
147 XSLTPUBFUN int XSLTCALL
148 xsltRegisterExtModuleElement
149 (const xmlChar *name,
151 xsltPreComputeFunction precomp,
152 xsltTransformFunction transform);
153 XSLTPUBFUN xsltTransformFunction XSLTCALL
154 xsltExtElementLookup (xsltTransformContextPtr ctxt,
157 XSLTPUBFUN xsltTransformFunction XSLTCALL
158 xsltExtModuleElementLookup
159 (const xmlChar *name,
161 XSLTPUBFUN xsltPreComputeFunction XSLTCALL
162 xsltExtModuleElementPreComputeLookup
163 (const xmlChar *name,
165 XSLTPUBFUN int XSLTCALL
166 xsltUnregisterExtModuleElement
167 (const xmlChar *name,
173 typedef void (*xsltTopLevelFunction) (xsltStylesheetPtr style,
176 XSLTPUBFUN int XSLTCALL
177 xsltRegisterExtModuleTopLevel
178 (const xmlChar *name,
180 xsltTopLevelFunction function);
181 XSLTPUBFUN xsltTopLevelFunction XSLTCALL
182 xsltExtModuleTopLevelLookup
183 (const xmlChar *name,
185 XSLTPUBFUN int XSLTCALL
186 xsltUnregisterExtModuleTopLevel
187 (const xmlChar *name,
191 /* These 2 functions are deprecated for use within modules. */
192 XSLTPUBFUN int XSLTCALL
193 xsltRegisterExtFunction (xsltTransformContextPtr ctxt,
196 xmlXPathFunction function);
197 XSLTPUBFUN int XSLTCALL
198 xsltRegisterExtElement (xsltTransformContextPtr ctxt,
201 xsltTransformFunction function);
204 * Extension Prefix handling API.
205 * Those are used by the XSLT (pre)processor.
208 XSLTPUBFUN int XSLTCALL
209 xsltRegisterExtPrefix (xsltStylesheetPtr style,
210 const xmlChar *prefix,
212 XSLTPUBFUN int XSLTCALL
213 xsltCheckExtPrefix (xsltStylesheetPtr style,
215 XSLTPUBFUN int XSLTCALL
216 xsltCheckExtURI (xsltStylesheetPtr style,
218 XSLTPUBFUN int XSLTCALL
219 xsltInitCtxtExts (xsltTransformContextPtr ctxt);
220 XSLTPUBFUN void XSLTCALL
221 xsltFreeCtxtExts (xsltTransformContextPtr ctxt);
222 XSLTPUBFUN void XSLTCALL
223 xsltFreeExts (xsltStylesheetPtr style);
225 XSLTPUBFUN xsltElemPreCompPtr XSLTCALL
226 xsltPreComputeExtModuleElement
227 (xsltStylesheetPtr style,
230 * Extension Infos access.
231 * Used by exslt initialisation
234 XSLTPUBFUN xmlHashTablePtr XSLTCALL
235 xsltGetExtInfo (xsltStylesheetPtr style,
239 * Test module http://xmlsoft.org/XSLT/
241 XSLTPUBFUN void XSLTCALL
242 xsltRegisterTestModule (void);
243 XSLTPUBFUN void XSLTCALL
244 xsltDebugDumpExtensions (FILE * output);
251 #endif /* __XML_XSLT_EXTENSION_H__ */