File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Xalan Extensions call in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Xalan Extensions call in servlet" Watch "Xalan Extensions call in servlet" New topic

Xalan Extensions call in servlet

Holger Prause
Ranch Hand

Joined: Oct 09, 2000
Posts: 47
During Xslt processing i want Xalan to call a Extension Class auf me.When i do it "local" that means i process the XML-File and Xslt with a Programm with a main mathod.Everything works fine.
But if i copy the code into a Servlet nothing works anymore.
I have all necessary jar in Classpath

Following xml-Code

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl=""
<xsl:template match="/">
<xsl:value-of select="formatter:format($text)"/>
I think u dont want to c the java code ,its too simple ...
when i run this with servlets i get the following message :
Call to extension function failed: unable to load class 'XalanExtension'
mybe it depends on the directory where the program is started , Servlet runs in a different Enviroment than my program,so it has different pathes to my Extension-Class.That would be an explination.I dont know how to hardcode the path to the Extension-Class so this also dont works.
I tried to jar my Extension-Class and to put it in my Classpath , i had the hope that Xalan looks in the Classpath for this jar, but this also didnt work :-(

P.S(the xml-mail archive from apache is down,so i have to post my question here)
Has anyone of u a solution / suggestion ?
I agree. Here's the link:
subject: Xalan Extensions call in servlet
It's not a secret anymore!