Error when trying to access Java class from XSL stylesheet

Having trouble installing Oxygen? Got a bug to report? Post it all here.
MendezK
Posts: 2
Joined: Thu Mar 13, 2008 5:45 pm

Error when trying to access Java class from XSL stylesheet

Post by MendezK »

Hi,

I have a custom Java class declared like this in an XSL stylesheet:

Code: Select all


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"  
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:java="http://xml.apache.org/xslt/java"
xmlns:convertor="QuestionSequenceOrderXSLUtility"
extension-element-prefixes="convertor">
<xalan:component prefix="convertor" functions="generateSequence">
<xalan:script lang="javaclass" src="xalan://tools.upgradehelper.ieg.QuestionSequenceOrderXSLUtility" />
</xalan:component>
I then try to call a static method in that class:

Code: Select all


<xsl:element name="attribute">
<xsl:attribute name="name">iegSequenceOrder</xsl:attribute>
<xsl:value-of select="convertor:generateSequence(../attribute[translate(@name,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')="questionnaireVersionID"]/value)"/>
</xsl:element>
However, when I execute the style sheet, I get this error:
Description: The URI QuestionSequenceOrderXSLUtility does not identify an external Java class
Now, the path above is correct and the class sits where it should be, etc. Is there a way in Oxygen to specify a classpath or something similar?

Thanks,
Padraig.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Error when trying to access Java class from XSL stylesheet

Post by sorin_ristache »

Hello,

Did you add the jar file with your Java class as an XSLT extension to the transformation scenario using the Extensions button of the scenario edit dialog?


Regards,
Sorin
MendezK
Posts: 2
Joined: Thu Mar 13, 2008 5:45 pm

Re: Error when trying to access Java class from XSL stylesheet

Post by MendezK »

Thanks, that was it.
Post Reply