Re: [xsl] I love programs that output programs

Subject: Re: [xsl] I love programs that output programs
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Jan 2025 20:43:43 -0000
> Recently I've started applying multiple modes to one template. This has
simplified my stylesheets where I have several modes going on.  Will that be
supported with this new mode element?

No.

I would be interested in your use case for having a template rule in multiple
modes. It's something I have very rarely seen a need for. I suspect that where
you are using this, I would probably be using tunnel parameters.

Michael Kay
Saxonica

>
> This new element will make it easier to deal with stylesheets with an editor
like oxygen where you can collapse content. Currently I try and group
templates with modes together and maybe a start and end comment but that
doesn't help with minimizing content.
>
> ..dan
>
>
>
> Sent from my Verizon, Samsung Galaxy smartphone
>
>
> -------- Original message --------
> From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
> Date: 1/19/25 11:05 AM (GMT-08:00)
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re: [xsl] I love programs that output programs
>
> On Sun, 2025-01-19 at 11:16 +0000, Dave Pawson dave.pawson@xxxxxxxxx
> wrote:
> > Modes:
> >   Now 'enclosing modes'
> > Am I the only one thinking xslt4 is miles away (and of less use due
> > complexity)  from XSLT?
>
> This change is actually a simplification.
>
> You can now write
>
> <xsl:mode name="xref-insert-titles" on-no-match="shallow-copy">
>
>    <xsl:template match="xref" ...>
>      . . .
>    </xsl:template>
>
>    <xsl:template match="qv" ...>
>     . . .
>    </xsl:template>
> </xsl:mode>
>
> and know there are no other templates with that mode,
> and also know (as with XSLT 3) that the identity template
> is built in to the mode for nodes that arenbt explicitly
> matched.
>
> When using modes to simulate multiple transformations in one XSLT
> execution, itbs common to see lots of templates scattered about that
> have a mode="...." attribute, so this makes it easier to understand and
> maintain stylesheets.
>
> So this can help the fuzzy space between single transformation and XSLT
> that calls transform() and XSLT that creates XSLT on the fly for some
> later XSLT process.
>
> Usage is optional, you can still scatter your templates instead of
> putting them in a mode wrapper.
>
> I've wanted this since XSLT 1 days :)
>
>
> And, thank you Mike for confirming that itbs enforced.  The specs are
> in flux and the meetings are at a difficult time for me.
>
>
> --
> Liam Quin, https://www.delightfulcomputing.com/
> Available for XML/Document/Information Architecture/XSLT/
> XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
> Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email <>)

Current Thread