In the xalan.ext :gen-class the static methods are named "foo" and "bar"
but your xslt template is using the (prefixed) names of the clojure impl
fns. Did you try just "foo" and "bar" instead?

To be sure the class and methods are available in your test, rather than
calling the clojure fns, call the static methods, like (xalan.ext/foo...).

Hope this helps.
On May 15, 2013 7:08 AM, "Gregg Reynolds" <d...@mobileink.com> wrote:

> Hi,
>
> I'm having trouble getting clojure functions to work as xslt extensions.
>  The code is very simple; you can find it at
> https://github.com/greynolds/xslj.  The problem is obviously related to
> how clojure functions get called from java.  I have some idea of how that
> works but can't figure out how to make it work here.  I could always write
> a java wrapper to call the clojure stuff but it would clearly be preferable
> to not have to do that.
>
> Rather than describe the problem in detail here, the above-mentioned code
> is simple and commented so you can see immediately what's happening.  It
> contains code for both saxon and xalan.  (If you're not familiar with xslt,
> the idea is just that you can reference an extension function using a URI
> in a stylesheet.)  If anybody who knows the secrets of calling clojure code
> would care to take a few minutes to look I'd be grateful.
>
> The errors I get involve finding the class.  But calling the functions
> from clojure works just fine.  It's not a classpath problem because the
> same thing happens using command line processing with explicit classpath
> (see the test.sh files in the repo).
>
> Saxon:
> XPath syntax error at char 12 on line 15 in {xj:saxfoo(7)}:
>     Cannot find a matching 1-argument function named
> {java:saxon.ext}saxfoo()
>
> Xalan:
> java.lang.NoSuchMethodException: For extension function, could not find
> method xalan.ext.xalfoo([ExpressionContext,] #NUMBER).
>
> Thanks,
>
> Gregg Reynolds
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to