You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/07/25 15:54:10 UTC

DO NOT REPLY [Bug 1501] - xsltc should support nonstatic external java functions

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1501>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1501

xsltc should support nonstatic external java functions

glenn.miller@sun.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From glenn.miller@sun.com  2002-07-25 13:54 -------
expanded support of external java functions to include non-statics.
Below is an example using java.util.Date:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java">

<xsl:template match="/">
   <!-- create an object --> 
   <xsl:variable name="dateObject" select="java:java.util.Date.new()"/>
   <p>Date: <xsl:value-of select="$dateObject"/></p>

   <!-- call a non-static method on dateObject -->
   <xsl:variable name="result" 
        select="java:getTime($dateObject)"/>
   <p>date.getTime() =  <xsl:value-of select="$result"/></p>
</xsl:template>

</xsl:stylesheet>