[xsl] avoiding assignment statements

Subject: [xsl] avoiding assignment statements
From: "Sam Carleton" <scarleton@xxxxxxxxxxxxxxxx>
Date: Fri, 8 Dec 2006 09:03:08 -0500
I have three global xsl:param's which I need to display if any of them
are selected:

 <xsl:param name="showReplicates" select="1"/>
 <xsl:param name="showMetadata" select="1"/>
 <xsl:param name="showElectronicSignature" select="1"/>

if all the flags are turned on, the output would be:

(View - Reps, Meta-Data, Signatures)

Normally I would do something like this:

bool isFirst = true

if(showReplicates == 1) {
  Output("Reps");
  isFirst = false;
}

if(showMetadata == 1) {
  if(isFirst == false) Output(", ");
  Output("Meta-Data");
  isFirst = false;
}

if(showElectronicSignature == 1) {
  if(isFirst == false) Output(", ");
  Output("Signatures");
  isFirst = false;
}

if(isFirst == true) {
  Output("Only Summary");
}

The question is:  How do I do the same thing in the Functional
Programming world?
--
Miltonstreet Photography
http://www.miltonstreet.com

Current Thread