[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Call Java Objects

Subject: RE: Call Java Objects
From: "Venkateshwar Bommineni" <vbommineni@xxxxxxxxxx>
Date: Tue, 9 Apr 2002 10:16:44 -0400
call java
Like a general Java method call. As,

<xsl:variable name="param" select="FooElement"/>
<xsl:value-of select= "JavaMath:findSum($param)"/>

you can pass even XML nodes also and receive them in your java class
through XSLT extension API. Browse through the samples and API provided
with Xalan releases.


-----Original Message-----
From: Laura Jenkins [mailto:xsl_list@xxxxxxxxxxx]
Sent: Tuesday, April 09, 2002 10:04 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Call Java Objects

Hi venkat .. was helpful.( though dint try as yet :D ) can you also tell
. if i have to pass on parameters to the method how do i do that.
for example

public class MathClass{
public int findSum(int n)
  return n*(n+1)/2;

in this case how do i call the method findSum(int n)..where am i
supposed to 
send the parameter??
.. This is very interesting

thanks very much in advance

>From: "Venkateshwar Bommineni" <vbommineni@xxxxxxxxxx>
>Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
>Subject: RE:  Call Java Objects
>Date: Tue, 9 Apr 2002 09:34:07 -0400
>Yes you can do. Thats XSLT extensions feature. I am not sure about
>processors but you can achieve it through latest Xalan.
>public class DateFormat{
>	public String getTodayDate(){
>		return new Date().toString();
>	}
>All you need to do is, define namespaces as your java classes like:
><xsl:stylesheet version="1.0"
>			    xmlns:DateFormat="JavaDateFormat"
>    			 extension-element-prefixes="DateFormat">
>And in your templates you could use as,
>  <xsl:value-of select= "DateFormat:getTodayDate()" />
>try out.
>-----Original Message-----
>From: Laura Jenkins [mailto:xsl_list@xxxxxxxxxxx]
>Sent: Tuesday, April 09, 2002 9:13 AM
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject:  Call Java Objects
>Dear Gurus of the list( who have never let me down ),
>I have a query..
>can i call java objects in my XSL.. is it possible that i do some cool
>business logic at the Java end and have methods in Java that return
>all i wana do is that do some complex stuff in the java end and return
>result ( thro some method which i will call in XSL )and capture it in a
>variable for me to use.
>is it possible to do such a thing. Forgive me if the question is very
>Chat with friends online, try MSN Messenger: http://messenger.msn.com
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Send and receive Hotmail on your mobile device: http://mobile.msn.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.