John Gentilin wrote:
Joe,
Are you trying to write an extension element or an extension function.

I figured out the function, not the element.

Extension Elements:
If you look at the source code for the Redirect extension, it is short and to the point
piece of code to see how extensions work. With Extension Functions, I don't think you
can pass in objects although that may be incorrect.

You can, though it is a bit non-intuitive.

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

... then

<xsl:param name="myparam"  />

... then <xsl:value-of select="java:methodname($myparam, $othervar)" />

Go to http://xml.apache.org/xalan-j/extensions.html#java-namespace and scroll down to the example.

<xsl:value-of select="java:format($formatter, $date)"/> does the same thing, where format is the method name and $formatter is the stf that format() is called on.

But what I really want to figure out is how do have the extention element operate on a passed in java object.

Reply via email to