2 Copyright (C) 2003, 2004 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
38 #include "gnu_xml_libxmlj_transform_GnomeTransformerFactory.h"
39 #include "gnu_xml_libxmlj_transform_GnomeTransformer.h"
43 #include "xmlj_error.h"
44 #include "xmlj_node.h"
46 #include "xmlj_util.h"
53 #include <libxml/xmlmemory.h>
54 #include <libxml/debugXML.h>
55 #include <libxml/xmlIO.h>
56 #include <libxml/xinclude.h>
57 #include <libxml/parser.h>
58 #include <libxml/catalog.h>
59 #include <libxslt/keys.h>
60 #include <libxslt/xslt.h>
61 #include <libxslt/xsltInternals.h>
62 #include <libxslt/transform.h>
63 #include <libxslt/xsltutils.h>
64 #include <libxslt/functions.h>
65 #include <libxslt/extensions.h>
66 #include <libxslt/documents.h>
68 /* Local function prototypes */
71 xmljDocumentFunction (xmlXPathParserContextPtr ctxt
, int nargs
);
74 xmljGetStylesheetID (JNIEnv
* env
, jobject transformer
);
77 xmljGetTransformerProperties (JNIEnv
*env
, jobject transformer
);
80 xmljBooleanToString (int value
);
83 xmljSetOutputProperties (JNIEnv
*env
, jobject transformer
,
84 xsltStylesheetPtr stylesheet
);
87 xmljGetParameterArray (JNIEnv
*env
, jobject transformer
);
90 xmljGetParameters (JNIEnv
*env
, jobjectArray pa
);
93 xmljFreeParameters (JNIEnv
*env
, jobjectArray pa
, const char **parameters
);
96 xmljTransform (JNIEnv
*env
, jobject transformer
, xmlDocPtr source
);
99 xmljTransformToSAX (JNIEnv
*env
, jobject transformer
, xmlDocPtr source
,
103 xmljDocLoader (const xmlChar
*uri
, xmlDictPtr dict
, int options
,
104 void *ctxt
, xsltLoadType type
);
106 /* HACK: store stylesheet URL as context for resolving URIs in xmljDocLoader */
107 static jstring stylesheetURL
= NULL
;
110 * --------------------------------------------------------------------------
112 * Native implementation for class
113 * gnu.xml.libxmlj.transform.GnomeTransformer follows.
117 xmljSetProperty (JNIEnv
* env
, jobject outputProperties
,
118 jmethodID setPropertyMethodID
, const char *name
,
119 const xmlChar
* value
)
123 jstring nameString
= (*env
)->NewStringUTF (env
, name
);
124 jstring valueString
= (*env
)->NewStringUTF (env
, (const char *) value
);
126 jobject prevValue
= (*env
)->CallObjectMethod (env
, outputProperties
,
128 nameString
, valueString
);
129 if (NULL
!= prevValue
)
131 (*env
)->DeleteLocalRef (env
, prevValue
);
134 (*env
)->DeleteLocalRef (env
, nameString
);
135 (*env
)->DeleteLocalRef (env
, valueString
);
139 typedef struct CdataSectionScannerInfo_
142 jobject stringBuffer
;
143 jmethodID appendMethodID
;
145 } CdataSectionScannerInfo
;
148 cdataSectionScanner (void *payload
, void *data
, xmlChar
* name
)
150 CdataSectionScannerInfo
*info
= (CdataSectionScannerInfo
*) data
;
151 JNIEnv
*env
= info
->env
;
152 jstring nameString
= (*env
)->NewStringUTF (env
, (const char *) name
);
153 jstring blankString
= (*env
)->NewStringUTF (env
, " ");
154 jobject stringBuffer
;
158 = (*env
)->CallObjectMethod (env
,
160 info
->appendMethodID
, blankString
);
161 (*env
)->DeleteLocalRef (env
, stringBuffer
);
165 = (*env
)->CallObjectMethod (env
,
167 info
->appendMethodID
, nameString
);
168 (*env
)->DeleteLocalRef (env
, stringBuffer
);
169 (*env
)->DeleteLocalRef (env
, blankString
);
170 (*env
)->DeleteLocalRef (env
, nameString
);
174 xmljDocumentFunction (xmlXPathParserContextPtr ctxt
, int nargs
)
176 xmlXPathObjectPtr obj
, obj2
= NULL
;
178 if ((nargs
< 1) || (nargs
> 2))
180 xsltTransformError (xsltXPathGetTransformContext (ctxt
), NULL
, NULL
,
181 "document() : invalid number of args %d\n", nargs
);
182 ctxt
->error
= XPATH_INVALID_ARITY
;
185 if (ctxt
->value
== NULL
)
187 xsltTransformError (xsltXPathGetTransformContext (ctxt
), NULL
, NULL
,
188 "document() : invalid arg value\n");
189 ctxt
->error
= XPATH_INVALID_TYPE
;
195 if (ctxt
->value
->type
!= XPATH_NODESET
)
197 xsltTransformError (xsltXPathGetTransformContext (ctxt
), NULL
, NULL
,
198 "document() : invalid arg expecting a nodeset\n");
199 ctxt
->error
= XPATH_INVALID_TYPE
;
203 obj2
= valuePop (ctxt
);
206 if (ctxt
->value
->type
== XPATH_NODESET
)
209 xmlXPathObjectPtr newobj
, ret
;
211 obj
= valuePop (ctxt
);
212 ret
= xmlXPathNewNodeSet (NULL
);
216 for (i
= 0; i
< obj
->nodesetval
->nodeNr
; i
++)
219 xmlXPathNewNodeSet (obj
->nodesetval
->nodeTab
[i
]));
220 xmlXPathStringFunction (ctxt
, 1);
223 valuePush (ctxt
, xmlXPathObjectCopy (obj2
));
228 xmlXPathNewNodeSet (obj
->nodesetval
->
231 xsltDocumentFunction (ctxt
, 2);
232 newobj
= valuePop (ctxt
);
233 ret
->nodesetval
= xmlXPathNodeSetMerge (ret
->nodesetval
,
235 xmlXPathFreeObject (newobj
);
239 xmlXPathFreeObject (obj
);
242 xmlXPathFreeObject (obj2
);
244 valuePush (ctxt
, ret
);
248 * Make sure it's converted to a string
250 xmlXPathStringFunction (ctxt
, 1);
251 if (ctxt
->value
->type
!= XPATH_STRING
)
253 xsltTransformError (xsltXPathGetTransformContext (ctxt
), NULL
, NULL
,
254 "document() : invalid arg expecting a string\n");
255 ctxt
->error
= XPATH_INVALID_TYPE
;
257 xmlXPathFreeObject (obj2
);
260 obj
= valuePop (ctxt
);
261 if (obj
->stringval
== NULL
)
263 valuePush (ctxt
, xmlXPathNewNodeSet (NULL
));
268 xsltTransformContextPtr tctxt
;
270 tctxt
= xsltXPathGetTransformContext (ctxt
);
273 SAXParseContext
*saxContext
=
274 (SAXParseContext
*) tctxt
->style
->_private
;
276 xmlDocPtr tree
= xmljResolveURIAndOpen (saxContext
,
277 (const char*)obj
->stringval
,
280 xsltNewDocument (tctxt
, tree
); /* FIXME - free at a later point */
282 valuePush (ctxt
, xmlXPathNewNodeSet ((xmlNodePtr
) tree
));
285 xmlXPathFreeObject (obj
);
287 xmlXPathFreeObject (obj2
);
292 * Returns the stylesheet pointer for the given GnomeTransformer.
295 xmljGetStylesheetID (JNIEnv
* env
, jobject transformer
)
300 xsltStylesheetPtr stylesheet
;
302 if (transformer
== NULL
)
304 xmljThrowException (env
, "javax/xml/transform/TransformerException",
305 "Transformer is null");
308 cls
= (*env
)->GetObjectClass (env
, transformer
);
313 field
= (*env
)->GetFieldID (env
, cls
, "stylesheet", "Ljava/lang/Object;");
318 id
= (*env
)->GetObjectField (env
, transformer
, field
);
319 stylesheet
= (xsltStylesheetPtr
) xmljAsPointer (env
, id
);
320 if (stylesheet
== NULL
)
322 xmljThrowException (env
, "javax/xml/transform/TransformerException",
323 "Stylesheet is null");
330 xmljGetTransformerProperties (JNIEnv
*env
, jobject transformer
)
335 cls
= (*env
)->GetObjectClass (env
, transformer
);
340 field
= (*env
)->GetFieldID (env
, cls
, "outputProperties",
341 "Ljava/util/Properties;");
346 return (*env
)->GetObjectField (env
, transformer
, field
);
350 xmljBooleanToString (int value
)
352 return value
? BAD_CAST
"yes" : BAD_CAST
"no";
356 * Sets the output properties for the given transformer,
357 * based on its stylesheet.
360 xmljSetOutputProperties (JNIEnv
*env
, jobject transformer
,
361 xsltStylesheetPtr stylesheet
)
363 jobject outputProperties
;
364 jclass propertiesClass
;
365 jmethodID setPropertyMethod
;
367 outputProperties
= xmljGetTransformerProperties (env
, transformer
);
368 if (outputProperties
== NULL
)
372 propertiesClass
= (*env
)->FindClass (env
, "java/util/Properties");
373 if (propertiesClass
== NULL
)
378 (*env
)->GetMethodID (env
, propertiesClass
, "setProperty",
379 "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;");
380 if (setPropertyMethod
== NULL
)
385 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
386 "encoding", stylesheet
->encoding
);
388 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
389 "media-type", stylesheet
->mediaType
);
391 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
392 "doctype-public", stylesheet
->doctypePublic
);
394 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
395 "doctype-system", stylesheet
->doctypeSystem
);
397 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
398 "indent", xmljBooleanToString (stylesheet
->indent
));
400 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
401 "method", stylesheet
->method
);
403 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
404 "standalone", xmljBooleanToString (stylesheet
->standalone
));
406 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
407 "version", stylesheet
->version
);
409 xmljSetProperty (env
, outputProperties
, setPropertyMethod
,
410 "omit-xml-declaration",
411 xmljBooleanToString (stylesheet
->omitXmlDeclaration
));
414 CdataSectionScannerInfo info
;
415 jclass stringBufferClass
417 (*env
)->FindClass (env
,
418 "java/lang/StringBuffer");
419 jmethodID stringBufferConstructorID
=
420 (*env
)->GetMethodID (env
, stringBufferClass
,
422 jmethodID toStringMethodID
=
423 (*env
)->GetMethodID (env
, stringBufferClass
,
425 "()Ljava/lang/String;");
429 = (*env
)->AllocObject (env
, stringBufferClass
);
430 (*env
)->CallVoidMethod (env
, info
.stringBuffer
,
431 stringBufferConstructorID
);
432 info
.appendMethodID
=
433 (*env
)->GetMethodID (env
, stringBufferClass
,
435 "(Ljava/lang/String;)Ljava/lang/StringBuffer;");
437 xmlHashScan (stylesheet
->cdataSection
,
438 cdataSectionScanner
, &info
);
441 jstring result
= (jstring
)
442 (*env
)->CallObjectMethod (env
,
447 (*env
)->NewStringUTF (env
,
448 "cdata-section-elements");
452 (*env
)->CallObjectMethod (env
,
456 if (NULL
!= prevValue
)
458 (*env
)->DeleteLocalRef (env
, prevValue
);
460 (*env
)->DeleteLocalRef (env
, nameString
);
463 (*env
)->DeleteLocalRef (env
, info
.stringBuffer
);
468 * Returns the parameter array for the given GnomeTransformer.
471 xmljGetParameterArray (JNIEnv
*env
, jobject transformer
)
476 cls
= (*env
)->GetObjectClass (env
, transformer
);
481 method
= (*env
)->GetMethodID (env
, cls
, "getParameterArray",
482 "()[Ljava/lang/String;");
487 return (jobjectArray
) (*env
)->CallObjectMethod (env
, transformer
, method
);
490 /* Convert parameter array to xmlChar ** */
492 xmljGetParameters (JNIEnv
*env
, jobjectArray pa
)
495 const char **parameters
;
497 len
= (*env
)->GetArrayLength (env
, pa
);
498 parameters
= (const char **) malloc ((len
+ 2) * sizeof (const char *));
499 if (parameters
== NULL
)
504 for (i
= 0; i
< len
; i
++)
506 jstring string
= (jstring
) (*env
)->GetObjectArrayElement (env
, pa
, i
);
510 parameters
[i
] = (*env
)->GetStringUTFChars (env
, string
, NULL
);
514 parameters
[i
] = NULL
;
519 parameters
[len
+ 1] = 0;
523 /* Release parameter strings */
525 xmljFreeParameters (JNIEnv
*env
, jobjectArray pa
, const char **parameters
)
529 len
= (*env
)->GetArrayLength (env
, pa
);
530 for (i
= 0; i
< len
; i
++)
532 jstring string
= (jstring
) (*env
)->GetObjectArrayElement (env
, pa
, i
);
535 (*env
)->ReleaseStringUTFChars (env
, string
, parameters
[i
]);
543 xmljTransform (JNIEnv
*env
, jobject transformer
, xmlDocPtr source
)
545 xsltStylesheetPtr stylesheet
;
548 const char **parameters
;
550 stylesheet
= xmljGetStylesheetID (env
, transformer
);
551 pa
= xmljGetParameterArray (env
, transformer
);
552 parameters
= xmljGetParameters (env
, pa
);
553 if (parameters
== NULL
)
555 xmljThrowException (env
, "javax/xml/transform/TransformerException",
556 "Couldn't allocate memory for parameters");
559 result
= xsltApplyStylesheet (stylesheet
, source
, parameters
);
560 xmljFreeParameters (env
, pa
, parameters
);
563 xmljThrowException (env
, "javax/xml/transform/TransformerException",
564 "XSLT transformation failed");
570 xmljTransformToSAX (JNIEnv
*env
, jobject transformer
, xmlDocPtr source
,
573 xsltStylesheetPtr stylesheet
;
576 const char **parameters
;
577 xmlSAXHandlerPtr sax
;
579 stylesheet
= xmljGetStylesheetID (env
, transformer
);
580 pa
= xmljGetParameterArray (env
, transformer
);
581 parameters
= xmljGetParameters (env
, pa
);
582 if (parameters
== NULL
)
584 xmljThrowException (env
, "javax/xml/transform/TransformerException",
585 "Couldn't allocate memory for parameters");
588 sax
= NULL
; /* TODO link up sax and callback */
589 ret
= xsltRunStylesheet (stylesheet
, source
, parameters
, NULL
, sax
, NULL
);
590 xmljFreeParameters (env
, pa
, parameters
);
593 xmljThrowException (env
, "javax/xml/transform/TransformerException",
594 "XSLT transformation failed");
599 xmljDocLoader (const xmlChar
*uri
, xmlDictPtr dict
, int options
,
600 void *ctxt
, xsltLoadType type
)
604 jclass inputStreamClass
;
605 jmethodID getInputStream
;
606 jmethodID getDetectBuffer
;
609 jbyteArray detectBuffer
;
612 env
= xmljGetJNIEnv ();
617 xmljClass
= (*env
)->FindClass (env
, "gnu/xml/libxmlj/util/XMLJ");
623 (*env
)->GetStaticMethodID (env
, xmljClass
, "xmljGetInputStream",
624 "(Ljava/lang/String;Ljava/lang/String;)Lgnu/xml/libxmlj/util/NamedInputStream;");
629 systemId
= xmljNewString (env
, uri
);
630 inputStream
= (*env
)->CallStaticObjectMethod (env
, xmljClass
, getInputStream
,
631 stylesheetURL
, systemId
);
636 inputStreamClass
= (*env
)->GetObjectClass (env
, inputStream
);
637 if (!inputStreamClass
)
641 getDetectBuffer
= (*env
)->GetMethodID (env
, inputStreamClass
,
642 "getDetectBuffer", "()[B");
643 if (!getDetectBuffer
)
647 detectBuffer
= (*env
)->CallObjectMethod (env
, inputStream
, getDetectBuffer
);
652 return xmljParseDocument (env
, NULL
, inputStream
, detectBuffer
,
653 NULL
, systemId
, stylesheetURL
,
654 0, 0, 0, 0, 0, 0, 0, 0, 0, 2);
657 /* GnomeTransformer.newStylesheet */
658 JNIEXPORT jobject JNICALL
659 Java_gnu_xml_libxmlj_transform_GnomeTransformer_newStylesheet (JNIEnv
*env
,
662 xsltStylesheetPtr stylesheet
;
665 stylesheetURL
= NULL
;
666 xsltSetLoaderFunc (xmljDocLoader
);
667 stylesheet
= xsltNewStylesheet ();
668 xmljSetOutputProperties (env
, self
, stylesheet
);
669 ret
= xmljAsField (env
, stylesheet
);
672 xmljThrowException (env
,
673 "javax/xml/transform/TransformerConfigurationException",
674 "Can't create Java object for stylesheet");
679 /* GnomeTransformer.newStylesheetFromStream */
680 JNIEXPORT jobject JNICALL
681 Java_gnu_xml_libxmlj_transform_GnomeTransformer_newStylesheetFromStream
682 (JNIEnv
*env
, jobject self
, jobject in
, jbyteArray detectBuffer
,
683 jstring publicId
, jstring systemId
, jstring base
,
684 jboolean entityResolver
, jboolean errorHandler
)
687 xsltStylesheetPtr stylesheet
;
690 doc
= xmljParseDocument (env
, self
, in
, detectBuffer
, publicId
, systemId
,
692 entityResolver
, errorHandler
, 0, 0, 2);
697 stylesheetURL
= systemId
;
698 xsltSetLoaderFunc (xmljDocLoader
);
699 stylesheet
= xsltParseStylesheetDoc (doc
);
700 if (stylesheet
== NULL
)
702 xmljThrowException (env
,
703 "javax/xml/transform/TransformerConfigurationException",
704 "Error parsing XSLT stylesheet");
707 xmljSetOutputProperties (env
, self
, stylesheet
);
708 ret
= xmljAsField (env
, stylesheet
);
711 xmljThrowException (env
,
712 "javax/xml/transform/TransformerConfigurationException",
713 "Can't create Java object for stylesheet");
718 /* GnomeTransformer.newStylesheetFromDoc */
719 JNIEXPORT jobject JNICALL
720 Java_gnu_xml_libxmlj_transform_GnomeTransformer_newStylesheetFromDoc
721 (JNIEnv
*env
, jobject self
, jobject in
)
724 xsltStylesheetPtr stylesheet
;
727 doc
= (xmlDocPtr
) xmljGetNodeID (env
, in
);
732 stylesheetURL
= xmljNewString (env
, doc
->URL
);
733 xsltSetLoaderFunc (xmljDocLoader
);
734 stylesheet
= xsltParseStylesheetDoc (doc
);
735 if (stylesheet
== NULL
)
737 xmljThrowException (env
,
738 "javax/xml/transform/TransformerConfigurationException",
739 "Error parsing XSLT stylesheet");
741 xmljSetOutputProperties (env
, self
, stylesheet
);
742 ret
= xmljAsField (env
, stylesheet
);
745 xmljThrowException (env
,
746 "javax/xml/transform/TransformerConfigurationException",
747 "Can't create Java object for stylesheet");
752 /* GnomeTransformer.transformStreamToStream */
753 JNIEXPORT
void JNICALL
754 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformStreamToStream
755 (JNIEnv
*env
, jobject self
, jobject in
, jbyteArray detectBuffer
,
756 jstring publicId
, jstring systemId
, jstring base
,
757 jboolean entityResolver
, jboolean errorHandler
, jobject out
)
762 source
= xmljParseDocument (env
, self
, in
, detectBuffer
, publicId
, systemId
,
764 entityResolver
, errorHandler
, 0, 0, 2);
765 result
= xmljTransform (env
, self
, source
);
766 xmljSaveFileToJavaOutputStream (env
, out
, result
,
767 (const char*) result
->encoding
);
771 /* GnomeTransformer.transformStreamToDoc */
772 JNIEXPORT jobject JNICALL
773 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformStreamToDoc
774 (JNIEnv
*env
, jobject self
, jobject in
, jbyteArray detectBuffer
,
775 jstring publicId
, jstring systemId
, jstring base
,
776 jboolean entityResolver
, jboolean errorHandler
)
781 source
= xmljParseDocument (env
, self
, in
, detectBuffer
, publicId
, systemId
,
783 entityResolver
, errorHandler
, 0, 0, 2);
784 result
= xmljTransform (env
, self
, source
);
785 return xmljGetNodeInstance (env
, (xmlNodePtr
) result
);
788 /* GnomeTransformer.transformStreamToSAX */
789 JNIEXPORT
void JNICALL
790 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformStreamToSAX
791 (JNIEnv
*env
, jobject self
, jobject in
, jbyteArray detectBuffer
,
792 jstring publicId
, jstring systemId
, jstring base
,
793 jboolean entityResolver
, jboolean errorHandler
, jobject callback
)
797 source
= xmljParseDocument (env
, self
, in
, detectBuffer
, publicId
, systemId
,
799 entityResolver
, errorHandler
, 0, 0, 2);
800 xmljTransformToSAX (env
, self
, source
, callback
);
803 /* GnomeTransformer.transformDocToStream */
804 JNIEXPORT
void JNICALL
805 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformDocToStream
806 (JNIEnv
*env
, jobject self
, jobject doc
, jobject out
)
811 source
= (xmlDocPtr
) xmljGetNodeID (env
, doc
);
812 result
= xmljTransform (env
, self
, source
);
813 xmljSaveFileToJavaOutputStream (env
, out
, result
,
814 (const char*) result
->encoding
);
818 /* GnomeTransformer.transformDocToDoc */
819 JNIEXPORT jobject JNICALL
820 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformDocToDoc
821 (JNIEnv
*env
, jobject self
, jobject doc
)
826 source
= (xmlDocPtr
) xmljGetNodeID (env
, doc
);
827 result
= xmljTransform (env
, self
, source
);
828 return xmljGetNodeInstance (env
, (xmlNodePtr
) result
);
831 /* GnomeTransformer.transformDocToSAX */
832 JNIEXPORT
void JNICALL
833 Java_gnu_xml_libxmlj_transform_GnomeTransformer_transformDocToSAX
834 (JNIEnv
*env
, jobject self
, jobject doc
, jobject callback
)
838 source
= (xmlDocPtr
) xmljGetNodeID (env
, doc
);
839 xmljTransformToSAX (env
, self
, source
, callback
);
842 /* GnomeTransformer.free */
843 JNIEXPORT
void JNICALL
844 Java_gnu_xml_libxmlj_transform_GnomeTransformer_free (JNIEnv
*env
,
847 xsltStylesheetPtr stylesheet
;
849 stylesheet
= xmljGetStylesheetID (env
, self
);
850 xsltFreeStylesheet (stylesheet
);
854 * --------------------------------------------------------------------------
855 * Native implementation for class
856 * gnu.xml.libxmlj.transform.GnomeTransformerFactory follows.
859 /* GnomeTransformerFactory.freeLibxsltGlobal */
860 JNIEXPORT
void JNICALL
861 Java_gnu_xml_libxmlj_transform_GnomeTransformerFactory_freeLibxsltGlobal (
862 JNIEnv
*env
__attribute__((__unused__
)),
863 jclass clazz
__attribute__((__unused__
)))
865 xsltCleanupGlobals ();