[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: avoiding assignment statements
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@xxxxxxxxx [mailto:scarleton@xxxxxxxxx] On > Behalf Of Sam Carleton > Sent: 08 December 2006 14:03 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|