Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Xalan Extensions call in servlet

 
Holger Prause
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt"
xmlns:formatter="XalanExtension"
extension-element-prefixes="formatter"
version="1.0">
<xsl:template match="/">
<xsl:value-of select="formatter:format($text)"/>
</xsl:template>
</xsl:stylesheet>
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 ?
Thx,
Holger
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic