cancel
Showing results for 
Search instead for 
Did you mean: 

Not in class path - XSLT Mapping using Stylus studio

Former Member
0 Kudos

Hello,

I am using Stylus studio for XSLT mapping. I have written a JAVA function and when I tried to execute, I am getting an error " ...... not inclasspath".

I have put JAVA file in the classpath as expained in the Stylus studio help documentation.

Can anyone help me on how to place the Java class file in the proper class path and how that java file has to be called from main XML program.

Regards and Thanks in Advance

Arvind

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello sabarish,

I have tried already as explained in the link you have mentioned. But still not working. In fact i was thinking to zip xsl, class and java files together and upload to XI. But I want to ensure whether i have called the java extension properly from XSL file.

Request you check this:

-


Java file

package com.eds.ehro.ximapping;

import java.util.Map;

//import com.sap.aii.mapping.api.AbstractTrace;

//import com.sap.aii.mapping.api.StreamTransformationConstants;

import java.util.*;

import java.text.*;

public class Concat_Employee_Sydate_Sytime {

public static String concat(String empno)

{

return empno + "-" + System.currentTimeMillis();

}

}

-


XSL file

<?xml version='1.0' ?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.gemsconsult.com/idoctofile/employee"

xmlns:javamap="com.eds.ehro.ximapping.Concat_Employee_Sydate_Sytime">

<xsl:template match="/">

<ns1:SetEmployeesDemographics_R xmlns:ns1="urn:EmpDemoVi">

<ns1:demographics0>

<ns2:address xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">

<ns2:adressLine>

<xsl:value-of select="concat(ns0:MT_EMPDETAILS/AddressLine1,ns0:MT_EMPDETAILS/AddressLine2)"/>

</ns2:adressLine>

<ns2:countyCode>

<xsl:value-of select="ns0:MT_EMPDETAILS/Country"/>

</ns2:countyCode>

<ns2:postalCode>

<xsl:value-of select="ns0:MT_EMPDETAILS/Zipcode"/>

</ns2:postalCode>

</ns2:address>

<ns2:clientID xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">200</ns2:clientID>

<ns2:employeeID xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">

<xsl:param name="empno">

<xsl:value-of select="ns0:MT_EMPDETAILS/EmployeeNo"/>

</xsl:param><!xsl:value-of select="ns0:MT_EMPDETAILS/EmployeeNo"/>

<xsl:if test="ns0:MT_EMPDETAILS/EmployeeNo">

<xsl:value-of select="javamap:concat($empno)"/>

</xsl:if>

</ns2:employeeID>

<ns2:personName xmlns:ns2="urn:com.sap.eds_ehro.besrv.demographics">

<ns2:firstName>

<xsl:value-of select="ns0:MT_EMPDETAILS/FirstName"/>

</ns2:firstName>

<ns2:middleName>

<xsl:value-of select="ns0:MT_EMPDETAILS/LastName"/>

</ns2:middleName>

</ns2:personName>

</ns1:demographics0>

</ns1:SetEmployeesDemographics_R>

</xsl:template>

</xsl:stylesheet>

Shabarish_Nair
Active Contributor
0 Kudos

Have a look into this weblog - /people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

xmlns:javamap="com.eds.ehro.ximapping.Concat_Employee_Sydate_Sytime" i guess is indeed the correct call

Shabarish_Nair
Active Contributor
0 Kudos

As far as in knw the process is pretty simple - http://www.stylusstudio.com/docs/v2006R3/d_xslt_xmlxml37.html#wp224691

But in case it is not working in stylus (it sud) then just zip the xsl file and the .java + .class file together and use in your interface mapping to test the same.