Re: [xsl] I love programs that output programs

Subject: Re: [xsl] I love programs that output programs
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 19 Jan 2025 21:51:10 -0000
On Sun, Jan 19, 2025 at 08:43:50PM -0000, Michael Kay mike@xxxxxxxxxxxx scripsit:
> 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.

The use case I've had for one template rule in multiple modes is the
identity template, which was used for multiple modes. In the plain case
it wouldn't matter (since the identity template is in xsl:mode) but in
the case where a namespace is being removed for some modes but not
others (so there are two identity templates explicitly written, one that
drops namespaces and one which does not) it would. (Or, a few times,
where these text nodes get special treatment and those do not.)

I am fairly sure 4 has a way to just say "drop all the source
namespaces" so the pattern would be achievable other ways, but I have
found myself using template rules in multiple modes fairly often.

-- 
Graydon Saunders  | graydonish@xxxxxxxxxxxx
\xDE\xE6s ofer\xE9ode, \xF0isses sw\xE1 m\xE6g.
-- Deor  ("That passed, so may this.")

Current Thread