cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping issue..

Former Member
0 Kudos

Hi Experts,

I have an issue when doing the xslt mapping as below code, it shows up exception as "XSLT 1.0 Debugging Error: Error in XPath expression (Java execution error : java.lang.NoClassDefFoundError: com/test/Counter)"...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:javamap="java:com.test.Counter">
<xsl:param name="FName">
	<xsl:value-of select="//FirstName"/>
</xsl:param>
<xsl:param name="LName">
	<xsl:value-of select="//LastName"/>
</xsl:param>
<xsl:template match="/">
<ns0:Target_Member_MT xmlns:ns0="http://test.com/xi/testing">
<xsl:for-each select="//Employee">
<CompanyMember>
<SeqID>
<xsl:if test="function-available('javamap:index')">
	<xsl:value-of select="javamap:index()"/>
</xsl:if>
</SeqID>
<Name><xsl:value-of select="concat($FName,$LName)"/></Name>
<EmpNo><xsl:value-of select="EmpID"/></EmpNo>
<ContactInformation><xsl:value-of select="Contact"/></ContactInformation>
</CompanyMember>
</xsl:for-each>
</ns0:Target_Member_MT>
</xsl:template>
</xsl:stylesheet>

any help would be much appreciated !!!

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Rajesh,

disable JAVA functions/ code in XSLT and execute your mapping,it seems problem with JAVA functions.

<xsl:if test="function-available('javamap:index')">
	<xsl:value-of select="javamap:index()"/>
</xsl:if>

test your mapping in XMLP spy first.

Regards,

Raj

Former Member
0 Kudos

yes, i have disabled the java function and i confirm it's cozed by the java function,my java function code as below:

package com.test.Counter;

public class Counter{

	public static int iSeq = 0;
	public static String iCounter()
	{				
		iSeq++;
		return String.valueOf(iSeq);
	}
}

anyone tell me what's the issue?

thanks in advance.

Former Member
0 Kudos

I guess you should call method "iCounter" in XSLT not the index().

Please check.

--Divyesh

Former Member
0 Kudos

yes, that's the old version java code, i have corrected to index(),

but it still pops up same issue.

i want to know why this java enhancement function is not working in xslt mapping

<xsl:value-of select="javamap:index()"/>

Edited by: Rajesh_V2009 on Aug 10, 2011 3:10 PM

Former Member
0 Kudos

Anyone can help me about this issue?

i'm stuck there for almost one day...

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Rajesh,

check below link and follow the same steps.

http://cafeconleche.org/books/xmljava/chapters/ch17s03.html

Regards,

Raj

Answers (0)