View Single Post
  #3 (permalink)  
Old January 9th, 2009, 11:28 AM
joefawcett's Avatar
joefawcett joefawcett is offline
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

XSLT cannot loop, for-each processes each node found by the select attribute. It's also a functional language so what you want can't be done ina non-functional way such as repeated adding to a variable. The common way to carry out the task you require, especially using XSLT version 1.0, is to use recursion. Pass the nodes to a template that processes the first, and passes the rest on to itself. When there are no more nodes it returns.

If you're using version 2.0 you can probably use the xls:value-of element with the separator attribute set to '_' or the XPath string-join() function.
__________________
Joe
http://joe.fawcett.name/
Reply With Quote