title: calling java function from xslt not working
body: <p>I know that there are so many responses about it, but I'he tried with many of them with no success, so, here am I:</p>
  
  <p>I have an XSL and I'm calling to a java method inside. After a couple of attempts (cannot find mypackage.MyClass) I'm getting 'Instance method new needs one object as a first parameter' (roughly translated, I'm sorry).
  BUT MyClass doesn't have a Constructor defined, not even a default constructor. I tried by defining a void constructor, but with no effect.</p>
  
  <p>When I try to call to any function, I get a NullPointerException, cause my instance variable is null. If I take my method and add as static, I get 'Instance method MyMethod needs one object as a first parameter'.</p>
  
  <p>AND, the best. If I use any default java class (java.util.Date, java.lang.XXXX, and so on), my tests works!</p>
  
  <p>I'm going crazy...</p>
  
  <p>Here is my last test.xsl</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:date="http://xml.apache.org/xalan/java/java.util.Date"
      xmlns:java="http://xml.apache.org/xalan/java"
      xmlns:test="mypackage.MyClass"
      exclude-result-prefixes="date java test"&gt;
  
    &lt;xsl:template match="/"&gt;
  
     &lt;!-- WORKING EXAMPLE --&gt;
     &lt;xsl:variable name="dateObject"
       select="date:new(java_lang:Math.max(1027695561000,1038695561000))"/&gt;
     Date of object: &lt;xsl:value-of select="$dateObject"/&gt;
     Time of object: &lt;xsl:value-of select="date:getTime($dateObject)"/&gt;
  
    &lt;!-- ERRORS... --&gt;
    &lt;xsl:variable name="testObject1" select="test:new()"/&gt;
    &lt;xsl:variable name="result" select="test:myMethod($testObject1)"/&gt;
    &lt;xsl:variable name="testObject2" select="test:go()"/&gt;
  
  
    &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>And my class:</p>
  
  <pre><code>package mypackage;
  
  public class MyClass{
  
      public String myMethod(){
          return "YESSSS!!!";
      }
  
      public static String go(){
          return "GOOOO!!!";
      }
  }
  </code></pre>
  
  <p>I'm using eclipse Luna for debugging purposes and Xalan 2.7.1.
  My class is under {project}/src/dsig folder and my xsl is under {project}/resources folder.</p>
  
  <p>I've tested with xalan:extension tag, with abbreviate (as in the official xalan page) and many examples (including some taken from this forum) and all it's the same...</p>
  
  <p>Can you give me a hand?</p>
  
  <p>Thanks a lot in advance.</p>
  
  <p>Regards.</p>
  
  <p>Tistklehoff</p>