I am using a mapping node in my messageflow and there is a part where i need to conatenate a string/character n times in xpath function. Is there any way to do this with some xpath expression or xpath build function (or both) ? for example: concatenate '~' 17 times.
Asked
Active
Viewed 452 times
1 Answers
4
Easy in XPath 2.0:
string-join(for $i in 1 to 17 return '~', '')
Easier still in XPath 3.0:
string-join((1 to 17)!'~')
In XPath 1.0 your best bet is probably to initialize a variable $tildes with 100 (or however many) tildes, and then use
substring($tildes, 1, 17)

Michael Kay
- 156,231
- 11
- 92
- 164