Forums » Saxon/C Help and Discussions »
Unable to find method using C code
Added by Steve Ball over 6 years ago
I'm developing a package to be able to use Saxon/C with Tcl.
The supplied C interface is working, but the function xsltApplyStylesheet only accepts filenames for the source and stylesheet documents. I'd like the Tcl environment to orchestrate the handling of data; i.e. be able to read XML data into a jobject and pass them directly to the xsltProcessor class' transformToString method.
I'm working on rewriting the SaxonProcessor::parseXmlFromString method in SaxonProcessor.cpp in straight C so that it can interface with the Tcl interpreter.
To achieve this I'm adding a function to SaxonCProcessor.c called 'parseXmlToString'. It is failing trying to find the 'parseXmlString' method. My code looks like this:
jclass cppClass; jmethodID mID;
cppClass = lookForClass(environ.env, "net/sf/saxon/option/cpp/SaxonCAPI");
mID = (*(environ.env))->GetMethodID(environ.env, cppClass, "parseXmlString", "(Lnet/sf/saxon/s9api/Processor;Lnet/sf/saxon/s9api/SchemaValidator;Ljava/lang/String;)Lnet/sf/saxon/s9api/XdmNode;");
After these function calls the cppClass is OK but the mID is NULL.
Any ideas what might be going wrong?
Cheers, Steve Ball
Replies (2)
RE: Unable to find method using C code - Added by Steve Ball over 6 years ago
Posted too soon!
Problem solved: I was using 'GetMethodID' instead of 'GetStaticMethodID'.
Cheers, Steve Ball
RE: Unable to find method using C code - Added by O'Neil Delpratt over 6 years ago
Great. Interesting project please let us know how it goes.
Please register to reply