> The simplest answer may be to write a Java extension that encapsulates
> fully preparing the object, rather than spreading it across several
> extension calls. The fact that you can access Java objects directly in
> Xalan doesn't mean that's the best solution for complex operations.

Yes, there are many ways to address a problem, and the code used at the
start of this thread is not the way to do it (and is a misunderstanding
of the way xslt works).

XSLT is best used with values passed into it, not it reaching out for
them.  The fact that you can use extension functions has led you try to
use your java knowledge to address your problem, and not your xslt
knowledge.

I would recommend not using a custom extension function at all, just
pass in the date values you need.  If the date values are based on the
xml, use an xml filter on the way into the transform to extract the
data, pass it to your java function, then pass it in to the transform.

If you don't want to use an xml filter, you could build an xml fragment
out of the calander object, and pass that in.  Then within your
stylesheet write a template that extracts the information you need from
that fragment.

I hope this helps, 

cheers
andrew

Reply via email to