I need to get the value of each data after the last colon. For example, I have this file:
:20:PmtReferenceID000012
:21:Not used
:25: PHMNLBICXXX/Acc
Is there an easy way on will I get the value after each last colon because there's so many keys[...]
Yes. You can use RegEx matching.
In the following template regex-group(2)
contains the string after the second/(last) colon. And regex-group(1)
contains the key.
( --- )
Partial output:
(20 --- PmtReferenceID000012)
(21 --- Not used)
(25 --- PHMNLBICXXX/Account00010203)
(28c --- 00001/0001 (The 'c' in :28 can be either in upper or lower case))
With that you can create a key/value Dictionary that creates the tags around the text.
Like this:
For example: you can create a variable inside the XSL file to store the mapping:
Full output:
PmtReferenceID000012
Not used
PHMNLBICXXX/Account00010203
00001/0001 (The 'c' in :28 can be either in upper or lower case)
Or you could literally outsource the mapping and create a separate file for them...