Separator for ForEach

May 5, 2010 at 4:05 PM

Would it be an idea to add an optional Separator parameter for a ForEach element that can serve as a separator?
It would allow us to repeat items in a document in the following way:

item1, item2, item3

(but other scenario's could be imagined)
The separator in this case would be ", ".

Another extension would be to have a LastSeparator property to make them show up as:

item1, item2 and item3

but I guess that syntax could be different in other cultures?

These are actual requests we have in our application.

Thanks in advance,


May 6, 2010 at 1:42 PM

Why isn't this possible with current functionality? Is there an issue using a foreach within a paragraph?

You could loop through all but the last item, eg: //rows/row[position() != count(//rows/row)], and then explicitly render the last item, eg: //rows/row[position() = count(//rows/row)].

May 6, 2010 at 5:32 PM

OK, my XPath knowledge was not that good, apparently.

Thanks a lot!


Jul 23, 2013 at 7:48 PM
Come check out the successor of fleXdoc: Docati!
It supports Word 2010 and 2013 as well and runs in the cloud.

I sure hope to welcome you as a Docati user as well! :-)