Re: [xsl] having a template remember not to call itself again

Subject: Re: [xsl] having a template remember not to call itself again
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 5 Mar 2023 17:05:47 -0000
On Sun, Mar 05, 2023 at 04:56:56PM -0000, Martin Honnen martin.honnen@xxxxxx scripsit:
> 
> Am 3/5/2023 um 5:40 PM schrieb Graydon graydon@xxxxxxxxx:
> > The XSLT 3 approach is the transform function, where you write
> > individual stylesheets for each step and call them:
> > 
> > <xsl:variable name="pass1" as="document-node()">
> >          <xsl:sequence select="
> >              transform(map {
> >                'stylesheet-location': 'pass1.xsl',
> >                'source-node': /*
> >              }
> >              )?output" />
> > </xsl:variable>
> > 
> > <xsl:variable name="pass2" as="document-node()">
> >          <xsl:sequence select="
> >              transform(map {
> >                'stylesheet-location': 'pass2.xsl',
> >                'source-node': $pass1
> >              }
> >              )?output" />
> > </xsl:variable>
> > 
> > And so on.
> 
> 
> Doesn't "And so on" translate into using fold-left e.g.
> 
>   fold-left(('pass1.xsl', 'pass2.xsl', 'pass3.xsl'), /, function($n,
> $x) { transform(map{'stylesheet-location': $x, 'source-node' : $n
> })?output })

If all the transforms have the same options map AND if I'm not worried
about presenting the simple basic version of the concept, it certainly
could!

In practice I've done this with a constructed map of options maps, but
that didn't result in a model of clarity. (Different content types used
different pre-processing regularization steps, but all from the same
list of steps, so the outer transform gets passed step names and builds
the map of options maps.)

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread