Oh man, am I ever embarassed. I just realized what's wrong with this. I 
mistakenly thought that the select attributes in
the xsl:variable elements in the first xsl:template would invoke the second 
xsl:template. Nope. These select attributes
merely get ile:content and ile:template nodes from the input document and 
assign them to variables. I was confusing them
with the select attribute of an xsl:apply-templates element. Only in that case 
is a template from the stylesheet applied
to the selected nodes from the input document. So your description "compute 
instances of XMLFile in the second template
to be returned to the first template" does not describe the behavior of the 
stylesheet snippet you gave in the example.

Brad Cox wrote:

> Please pardon the newbie questions. Still rather new to this.
>
> This cut down example intends to compute instances of XMLFile in the
> second template to be returned to the first template. However this
> shows they being returned as #NODESETs, not java instances. How do I
> get a plain old java-style return value from a xslt template?
>
> Exception:javax.xml.transform.TransformerException:
> java.lang.NoSuchMethodException: For extension function, could not
> find method
> edu.virtualschool.jile.ctlr.SiteMap.addController([ExpressionContext,]
> #UNKNOWN (java.util.ArrayList), #NODESET, #NODESET).
>
> <xsl:template match="ile:page">
>         <xsl:variable name="content" select="ile:content"/>
>         <xsl:variable name="template" select="ile:template"/>
>         <xsl:variable name="this" select="java:addController(
>                 $sitemap,
>                 $content,
>                 $template
>         )"/>
>         <xsl:apply-templates select="ile:page"/>
> </xsl:template>
>
> <xsl:template match="ile:content|ile:template">
>         <xsl:variable name="xsl" select="ile:xsl"/>
>         <xsl:variable name="xml" select="ile:xml"/>
>         <xsl:value-of select="java:edu.virtualschool.jile.ctlr.XMLFile.new(
>                 string($xsl),
>                 string($xml)
> )"/>
> </xsl:template>
>
> PS: ile is my project's namespace.
> --
> Brad Cox, PhD; [EMAIL PROTECTED] 703 361 4751
> o For industrial age goods there were checks and credit cards.
>     For everything else there is http://virtualschool.edu/mybank
> o Java Interactive Learning Environment http://virtualschool.edu/jile
> o Java Web Application Architecture: http://virtualschool.edu/jwaa

Reply via email to