Re: [xsl] I love programs that output programs

Subject: Re: [xsl] I love programs that output programs
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Jan 2025 19:05:30 -0000
On Sun, 2025-01-19 at 11:16 +0000, Dave Pawson dave.pawson@xxxxxxxxx
wrote:
> Modes:
> B  Now 'enclosing modes'
> Am I the only one thinking xslt4 is miles away (and of less use due
> complexity)B  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,B 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: B http://www.fromoldbooks.org

Current Thread