Project

Profile

Help

Extension functions with preset state

Added by Anonymous almost 17 years ago

Legacy ID: #4389633 Legacy Poster: Jeff (jeff-s)

I'd like to see if there's a way to 'pass' an object to a template that could be called from within the template. The current extension mechanism allows for new objects to be created or static ones to be called but I'd like to pass an already initialized object which I'm going to call its methods in my XSLT. thanks jeff


Replies (2)

RE: Extension functions with preset state - Added by Anonymous almost 17 years ago

Legacy ID: #4389636 Legacy Poster: Jeff (jeff-s)

I think the following post also needed something like this; however, the response provided did not mention a way directly: http://sourceforge.net/forum/message.php?msg_id=4062804

RE: Extension functions with preset state - Added by Anonymous almost 17 years ago

Legacy ID: #4390767 Legacy Poster: Michael Kay (mhkay)

You can wrap a Java object inside an XPath value held in an XSLT variable, and you can pass this around in the same way as any other XPath value, e.g. in xsl:with-param. Such a value can originate either (a) as the return value from an extension function call, or (b) from the calling Java application - create it using new ExternalObject(obj).

    (1-2/2)

    Please register to reply