[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Newbie Question: Building Variables Based on Multiple Elements


Subject: Newbie Question: Building Variables Based on Multiple Elements
From: jeffrod@xxxxxxxxxx
Date: Mon, 31 Jan 2000 15:54:49 -0800


Is there a way for me to build upon a variable string based on multiple
elements of the same name?

For example:

foo.xml
<element>word1</element>
<element>word2</element>
<element>word3</element>
...
<element>wordn</element>

I would like to create a variable called {$elements} that would contain
the value of "word1 word2 word3 ... wordn" without having to hard code
a concat() function like:

<xsl:variable name="elements" select="concat(//element[1],' ',
element[2],' ',element[3],' ',...,' ',element[n])"/>

Can this be done?



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread