hi Dave, i solved the problem with first compilation error, an include was absent!
now its giving me more errors, hope you can help me! this is original error message, in spanish: WraperXalanC.h:41: error: tipo abstracto de devolución inválido para la función miembro ‘XalanCompiledStylesheet WraperXalanC::crearTranslet(char*)’ translation : invalid abstract return /usr/local/include/xalanc/XalanTransformer/XalanCompiledStylesheet.hpp:39: nota: porque las siguientes funciones virtual son puras en ‘XalanCompiledStylesheet’: translation: Because the following virtual functions are pure /usr/local/include/xalanc/XalanTransformer/XalanCompiledStylesheet.hpp:46: nota: virtual const xalanc_1_10::StylesheetRoot* xalanc_1_10::XalanCompiledStylesheet::getStylesheetRoot() const WraperXalanC.h:43: error: no se puede declarar que el parámetro ‘plantillaXsl’ sea del tipo abstracto ‘XalanCompiledStylesheet’ /usr/local/include/xalanc/XalanTransformer/XalanCompiledStylesheet.hpp:39: nota: ya que el tipo ‘XalanCompiledStylesheet’ tiene funciones virtuales puras make[1]: *** [build/Debug/GNU-Linux-x86/newmain.o] Error 1 make[1]: se sale del directorio `/home/alonso/curro/pruebaXalanC' make: *** [.build-impl] Error 2 Build failed. Exit value 2. I need that method XalanCompiledStylesheet WraperXalanC::crearTranslet(char *cadena) returns the compiled stylesheet in order that the method could be invoked from my java program across jni, that is to say, I need a method that given a chain of characters returns me the precompiled object in order that I could save it in a hashmap java object and could be invoked at any time. I dont know if its possible I hope to have explained well, as you can see, i have some doubts! logancillo wrote: > > hi again Dave, i solved last compilation error and now it gives me new > errors: > > > netbeans output console > > Running "/usr/bin/make -f Makefile CONF=Debug clean" in > /home/alonso/curro/pruebaXalanC > > /usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .clean-conf > make[1]: se ingresa al directorio `/home/alonso/curro/pruebaXalanC' > rm -f -r build/Debug > rm -f dist/Debug/GNU-Linux-x86/libpruebaXalanC.so > make[1]: se sale del directorio `/home/alonso/curro/pruebaXalanC' > > Clean successful. Exit value 0. > > Running "/usr/bin/make -f Makefile CONF=Debug" in > /home/alonso/curro/pruebaXalanC > > /usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf > make[1]: se ingresa al directorio `/home/alonso/curro/pruebaXalanC' > mkdir -p build/Debug/GNU-Linux-x86 > g++ -m32 -c -g -I/usr/include -I/usr/include/c++/4.1.2 > -I/usr/local/include -I/usr/include/c++/4.1.2/backward -fPIC -o > build/Debug/GNU-Linux-x86/newmain.o newmain.c > En el fichero incluído de > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, > de WraperXalanC.h:12, > de newmain.c:10: > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: > aviso: #warning This file includes at least one deprecated or antiquated > header. Please consider using one of the 32 headers found in section > 17.4.1.2 of the C++ standard. Examples include substituting the <X> header > for the <X.h> header for C++ includes, or <iostream> instead of the > deprecated header <iostream.h>. To disable this warning use > -Wno-deprecated. > mkdir -p build/Debug/GNU-Linux-x86 > g++ -m32 -c -g -I/usr/include -I/usr/include/c++/4.1.2 > -I/usr/local/include -I/usr/include/c++/4.1.2/backward -fPIC -o > build/Debug/GNU-Linux-x86/WraperXalanC.o WraperXalanC.cc > En el fichero incluído de > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/strstream:51, > de WraperXalanC.h:12, > de WraperXalanC.cc:1: > /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../include/c++/4.1.2/backward/backward_warning.h:32:2: > aviso: #warning This file includes at least one deprecated or antiquated > header. Please consider using one of the 32 headers found in section > 17.4.1.2 of the C++ standard. Examples include substituting the <X> header > for the <X.h> header for C++ includes, or <iostream> instead of the > deprecated header <iostream.h>. To disable this warning use > -Wno-deprecated. > WraperXalanC.cc: In member function ‘XalanCompiledStylesheet > WraperXalanC::crearTranslet(char*)’: > WraperXalanC.cc:42: error: el tipo de devolución ‘struct > XalanCompiledStylesheet’ es un tipo de dato incompleto > WraperXalanC.cc: In member function ‘XSLTResultTarget > WraperXalanC::renderView(char*, XalanCompiledStylesheet)’: > WraperXalanC.cc:56: error: ‘plantillaXsl’ has incomplete type > /usr/local/include/xalanc/XalanTransformer/XalanTransformer.hpp:70: error: > forward declaration of ‘const struct XalanCompiledStylesheet’ > make[1]: *** [build/Debug/GNU-Linux-x86/WraperXalanC.o] Error 1 > make[1]: se sale del directorio `/home/alonso/curro/pruebaXalanC' > make: *** [.build-impl] Error 2 > > Build failed. Exit value 2. > > > > WraperXalan.cc > > #include "WraperXalanC.h" > > WraperXalanC::WraperXalanC() > { > > inicializado=false; > if (!inicializado){ > inicializar(); > inicializado=true; > } > } > > WraperXalanC::~WraperXalanC(){} > > void WraperXalanC::inicializar() > { > try > { > XALAN_USING_XERCES(XMLPlatformUtils) > XALAN_USING_XALAN(XalanTransformer) > > XALAN_USING_STD(cerr) > XALAN_USING_STD(cout) > XALAN_USING_STD(endl) > XALAN_USING_XALAN(XalanCompiledStylesheet) > XALAN_USING_XALAN(XalanDOMString) > XALAN_USING_XALAN(XalanParsedSource) > XALAN_USING_XALAN(XalanTransformer) > XALAN_USING_XALAN(XSLTInputSource) > XALAN_USING_XALAN(XSLTResultTarget) > // Call the static initializer for Xerces. > XMLPlatformUtils::Initialize(); > // Initialize Xalan. > XalanTransformer::initialize(); > cout<<"XALANC inicializado."; > }catch(...){ > cout<<"Error al inicializar XALANC"; > } > > } > > XalanCompiledStylesheet WraperXalanC::crearTranslet(char *cadena) > { > > //Tiene que ser local al metodo? no podria ser utilizado por > todos? > //va a ser de hilo seguro?? si es local al metodo seguro que si > XalanTransformer theXalanTransformer; > const XalanCompiledStylesheet *compiledStylesheet = NULL; > istrstream str(cadena, strlen(cadena)); > const XSLTInputSource msgToTransform(&str); > int theResult = theXalanTransformer. > > compileStylesheet(msgToTransform,compiledStylesheet); > return compiledStylesheet; > } > > XSLTResultTarget WraperXalanC::renderView(char > *xml,XalanCompiledStylesheet plantillaXsl) > { > > XalanTransformer theXalanTransformer; > XSLTResultTarget theResultTarget; > // hago la transformacion > int theResult = theXalanTransformer.transform(xml, plantillaXsl, > theResultTarget); > //habria que convertir el XSLTResultTarget en un chorro de bytes > o algo asi > if (theResult!=0){ > //la conversion no ha tenido exito! > } > //habria que devolver el objeto resultante, o por lo menos la > informacion > //contenida en el, debe ser algo a bajo nivel > theResultTarget.getCharacterStream(); > return theResultTarget; > } > > > WraperXalan.h > /* > * File: WraperXalanC.h > * Author: alonso > * > * Created on 22 de enero de 2008, 15:47 > */ > #ifndef _WRAPERXALANC_H > #define _WRAPERXALANC_H > > #include <string> > #include <iostream> > #include <strstream> > > #include <xalanc/Include/PlatformDefinitions.hpp> > //#include <xercesc/util/PlatformUtils.hpp> > #include <xalanc/XalanTransformer/XalanTransformer.hpp> > //#include <xalanc/XalanTransformer/XalanCompiledStylesheet.hpp> > #include <xalanc/XSLT/XSLTResultTarget.hpp> > > using namespace std; > > XALAN_USING_XALAN(XalanTransformer) > XALAN_USING_XALAN(XalanCompiledStylesheet) > XALAN_USING_XALAN(XSLTResultTarget) > XALAN_USING_XALAN(XSLTInputSource) > > typedef XalanCompiledStylesheet XalanCompiledStylesheet; > typedef XSLTResultTarget XSLTResultTarget; > > class WraperXalanC > { > bool inicializado; > > public: > WraperXalanC(); > > ~WraperXalanC(); > > void inicializar(); > > XalanCompiledStylesheet crearTranslet(char *cadena); > // void prueba(XSLTResultTarget& ert); > XSLTResultTarget renderView(char *xml, XalanCompiledStylesheet > plantillaXsl); > }; > > #endif /* _WRAPERXALANC_H */ > > > -- View this message in context: http://www.nabble.com/building-a-jni-bridge-between-java-and-xalan-c-tp15039293p15062318.html Sent from the Xalan - C - Users mailing list archive at Nabble.com.