I'm working on an Apache 2.0 module that performs xslt. I would like to
use Xalan C++ if possible, though I am open to using other libraries if
necessary.
I've gotten Xalan C++ to work under Apache 1.3. Now, when I'm porting the
module to Apache 2.0, it crashes when I call transform().
Does anyone have any simple, bare-bones examples of Apache 2.0 modules
that use Xalan C++?
I also found in the archives a mention that Xalan has a C API. Could
someone give me a reference for it? I only need to do a simple
transformation using xslt parameters. (Preferrably using a Xalan output
handler so that I can send the result to the client). Apache might like
it better if I do the whole project in C instead of C++.
Here is an example function that I can call from my apache handler:
void test() {
XMLPlatformUtils::Initialize();
XalanTransformer::initialize();
XalanTransformer theXalanTransformer;
int theResult = theXalanTransformer.transform("/tmp/foo.xml",
"/tmp/foo.xsl", "/tmp/foo.out");
if(theResult != 0) {
cerr << "UseStylesheetParam Error: \n" <<
theXalanTransformer.getLastError() << endl << endl;
}
XalanTransformer::terminate();
XMLPlatformUtils::Terminate();
XalanTransformer::ICUCleanUp();
}
The apache process will segfault on transform().
David