This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Call Java Objects


Yes you can do. Thats XSLT extensions feature. I am not sure about other
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:xsl="http://www.w3.org/1999/XSL/Transform";
			    xmlns:DateFormat="JavaDateFormat"
   			 extension-element-prefixes="DateFormat">

And in your templates you could use as,
 <xsl:value-of select= "DateFormat:getTodayDate()" />

try out.
--Venkat



-----Original Message-----
From: Laura Jenkins [mailto:xsl_list@hotmail.com]
Sent: Tuesday, April 09, 2002 9:13 AM
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] 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 some

result.
all i wana do is that do some complex stuff in the java end and return
the 
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
weird.



_________________________________________________________________
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]