Separator for ForEach

May 5, 2010 at 3: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,

Jos

Coordinator
May 6, 2010 at 12: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 4:32 PM

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

Thanks a lot!

Jos

Coordinator
Jul 23, 2013 at 6: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! :-)

http://www.docati.com