xsl-list
[Top] [All Lists]

RE: [xsl] avoiding assignment statements

2006-12-08 09:07:43
In 2.0:

<xsl:value-of select="string-join(
    ('Reps'[$showreplicates=1], 'MetaData'[$showMetadata=1],
'Signatures'[$showElectronicSignature=1]),
     ', ')"/> 

Michael Kay
http://www.saxonica.com/


-----Original Message-----
From: scarleton(_at_)gmail(_dot_)com [mailto:scarleton(_at_)gmail(_dot_)com] 
On 
Behalf Of Sam Carleton
Sent: 08 December 2006 14:03
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] avoiding assignment statements

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>