Let\'s say I have this XML node:
- ...
-
- ...
-
- ...
-
-
That's my working solution.
As you didn't provide a desired output, this particular one may be uncomplete for your needs.
Test input:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Do note: you can pass columns number dynamically.
Additional requirements and edit.
It can be applied to the previous sample or to this concise XML:
- 1
Result will be:
1
Do note:
item
elements than number of columns is.If there won't ever be less elements than number of columns, you can just apply to the item
elements with the same predicate and a different mode
.
And last edit. With a counted loop.