title: xslt call java instance method
body: <p>my xsl looks like below : </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
  xmlns:SimpleDateFormat="java.text.SimpleDateFormat"
  xmlns:Date="java.util.Date" exclude-result-prefixes="SimpleDateFormat Date"&gt;
  
  &lt;xsl:variable name="s" select="SimpleDateFormat:new(MMM/dd/yyyy-HH/mm/ss/SSS)"/&gt;
  &lt;xsl:variable name="date" select="Date:new(number($beginTime))"/&gt;
  </code></pre>
  
  <p>So now how to call the method format(Date date) of instance 's'?  </p>
  
  <p>If I use <code>&lt;xsl:value-of select="s:format($date)" /&gt;</code>, then the error is : prefix must resolve to a namespace : s.</p>
  
  <p>But if I add the namespace like this : <code>xmlns:s="java.text.SimpleDateFormat"</code>, the <code>&lt;xsl:value-of select="s:format($date)" /&gt;</code> will return default format, not the specified format.</p>
  
  <p>So how can I get the specified format, like MM/dd/yyyy-HH/mm/ss/SSS ?</p>