Page 1 of 1

Error when trying to access Java class from XSL stylesheet

Posted: Thu Mar 13, 2008 5:53 pm
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.

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

Posted: Thu Mar 13, 2008 6:29 pm
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

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

Posted: Thu Mar 13, 2008 8:09 pm
by MendezK
Thanks, that was it.