[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

looking for a visually clean way to enable/disable te

Subject: looking for a visually clean way to enable/disable templates
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 19 Dec 2022 18:25:51 -0000
 looking for a visually clean way to enable/disable  te
Hi everyone,

Given a template with a predicate structure:

<xsl:template match="element[blah blah[blah]
                         [blah blah]]
                       [blah blah[blah]
                         [blah blah]]
                       [blah blah blah]">

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]
                       [blah blah[blah]
                         [blah blah]]
                       [blah blah[blah]
                         [blah blah]]
                       [blah blah blah]">

<xsl:template match="element[blah blah[blah]
                         [blah blah]]
                       [blah blah[blah]
                         [blah blah]]
                       [blah blah blah]
                       [$do.this.thing]">

I also tried adding the enabling-variable predicate to the root element, which
visually separates it a bit better:

<xsl:template match="/*[$do.this.thing]//
                       element[blah blah[blah]
                           [blah blah]]
                         [blah blah[blah]
                           [blah blah]]
                         [blah blah blah]">

My actual stylesheet has multiple features, each feature enabled by its own
parameter, each parameter enabling its own set of templates. Does anyone have
a favorite way of enabling/disabling templates in a way that does not get lost
in the match expression?

Thank you!

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.