Re: [xsl] looking for a visually clean way to enable/disable templates

Subject: Re: [xsl] looking for a visually clean way to enable/disable templates
From: "Liam R. E. Quin liam@xxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Dec 2022 18:39:27 -0000
On Mon, 2022-12-19 at 18:26 +0000, Chris Papademetrious
christopher.papademetrious@xxxxxxxxxxxx wrote:
>
> I would like to enable or disable the template with a parameter:
>
> <xsl:param name="do.this.thing" as="xs:boolean" select="false()"/>
>
> I tried adding an enabling-variable predicate at the beginning or
> end, but it seems to get visually lost:
>
> <xsl:template match="element[$do.this.thing]
> B B B B B B B B B B B B B B B B B B B B B B  [blah blah[blah]
> B B B B B B B B B B B B B B B B B B B B B B B B  [blah blah]]
> B B B B B B B B B B B B B B B B B B B B B B  [blah blah[blah]
> B B B B B B B B B B B B B B B B B B B B B B B B  [blah blah]]
> B B B B B B B B B B B B B B B B B B B B B B  [blah blah blah]">

Try, <xsl:template use-when="$do.this.thing" match="...">

where $do.this.thing is a variable or parameter declared with
static=yes.

liam



--
Liam Quin - delightfulcomputing.com
Cancer gofundme https://www.gofundme.com/f/5u9v7-every-little-helps
Vintage pictures & texts https://www.fromoldbooks.org/
Full-time "slave" in voluntary servitude.

Current Thread