IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Error encountered in XSLT extension - help needed urgently

  • 1.  Error encountered in XSLT extension - help needed urgently

    Posted Tue October 12, 2004 05:07 AM

    Hi All,

    I have been trying to call my java program from xsl but it seems to give error as depicted below:
    file:///C:/xslt/java/sample.xsl; Line #21; Column #60; XSLT Error (javax.xml.transform.TransformerException): javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: HelloDate
    I have read a lot of article and followed exactly the way but it still throws me this.



    My xslt file:
    <?xml version="1.0"?>
    <xsl:stylesheet
    xmlns:xsl=“XSLT Namespace
    version=“1.0”
    xmlns:java=“http://xml.apache.org/xalan/java"<BR>exclude-result-prefixes="java”>


    <xsl:template match=“/”>
    <xsl:variable name=“date”>2004-12-20 01:01:01</xsl:variable>
    <xsl:variable name=“format”>dd/mm/yyyy</xsl:variable>


    Date: <xsl:value-of select=“java:HelloDate.getDate($date, $format)”/>


    </xsl:template>
    </xsl:stylesheet>



    My java file:
    import java.text.SimpleDateFormat;
    import java.sql.Timestamp;

    public class HelloDate
    {
    public static String getDate(String inputDate, String dateFormat)
    {
    String outPutDate = “”;
    System.out.println("dateFormat " + dateFormat);

    if ( inputDate != null && inputDate != “”)
    {
    SimpleDateFormat patternDateTimeFormat = new
    SimpleDateFormat ( dateFormat );
    outPutDate = patternDateTimeFormat.format
    (Timestamp.valueOf ( inputDate ) );
    System.out.println(outPutDate);
    }
    else
    {
    outPutDate = “”;
    }
    return outPutDate;
    }
    }


    Please help to run it.


    #API-Management
    #Tamino
    #webMethods


  • 2.  RE: Error encountered in XSLT extension - help needed urgently

    Posted Tue October 12, 2004 10:38 AM

    Hello there,

    Try to give your HelloDate a package like :

    test.HelloDate

    Cheers.

    Bertrand Martel
    Software AG France


    #API-Management
    #Tamino
    #webMethods


  • 3.  RE: Error encountered in XSLT extension - help needed urgently

    Posted Thu October 14, 2004 07:29 AM

    Hello Bertrand,

    I have added a package(named sample) and there is error as follows.
    (Location of error unknown)XSLT Error (javax.xml.transform.TransformerException): javax.xml.transform.TransformerException: java.lang.ClassNotFoundException: sample/HelloDate

    It seems like it could not locate my class in my pc. What steps do u foresee that I have missed out.

    Thanks a lot.
    Regards


    #Tamino
    #API-Management
    #webMethods