Re: Passing a "callback" name to ixsl:schedule-action
Martynas Jusevičius <martynas-tyFqBaoSXPC1Z/[email protected]>
| Newsgroups | gmane.text.xml.saxon.help |
|---|---|
| Message-ID | <CAE35Vmz3RKUk3qpvU1JfgqfgQv_-UfVKvgo-jGBeUkRuVZypSg@mail.gmail.com> |
Are we still talking about Saxon-JS here? :) Part of the problem was that <ixsl:schedule-action> only allows <xsl:call-template> as content (with "hardcoded" name), whereas I used to have a JS callback that I could pass by name. http://www.saxonica.com/saxon-js/documentation/index.html#!ixsl-extension/instructions/schedule-action On Sun, Aug 30, 2020 at 11:58 PM Graydon <[email protected]> wrote: > > On Sun, Aug 30, 2020 at 02:35:11PM -0700, Dimitre Novatchev scripsit: > > On Sun, Aug 30, 2020 at 2:03 PM Alan Painter <[email protected]> wrote: > > > You don't need to have a hard-coded template name or even a named template. > > > > > > Instead, you can use xsl:apply-templates and select an element that you > > > have constructed to have the name passed from a parameter. > > > This will select a "match" template on an element with that name (and, > > > optionally, with a given namespace). > > > > > > This gives you the equivalent of calling an arbitrarily named template but > > > via match templates. > > > > FXSL ? :) > > Or modes. > > Where you'd call the function you have: > > <xsl:variable name="this" as="document-node()" > select="namespace:function($params)"/> > <xsl:apply-templates mode="write-file" select="$this"/> > > and somewhere else you've got: > > <xsl:template mode="write-file" match="/"> > <xsl:result-document.... > <xsl:sequence select="."/> > </xsl:result-document> > </xsl:template> > > You can stack modes on the main writing template if they turn out to all > be the same, or mostly the same, so you only need as many file-writing > templates as you've actually got cases. Apply-templates takes parameters > if you need to pass things to the "commit result-document" template from > where the function gets called. > > -- > Graydon Saunders | [email protected] > Þæs oferéode, ðisses swá mæg. > -- Deor ("That passed, so may this.") > > > _______________________________________________ > saxon-help mailing list archived at http://saxon.markmail.org/ > [email protected] > https://lists.sourceforge.net/lists/listinfo/saxon-help _______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [email protected] https://lists.sourceforge.net/lists/listinfo/saxon-help