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
In XSLT 3.0 you could write templates for the different strings e.g.
With Saxon 9.8 or Altova XMLSpy/Raptor that does the job and outputs
PmtReferenceID000012
Not used
PHMNLBICXXX/Account00010203
00001/0001
(for the input
:20:PmtReferenceID000012
:21:Not used
:25: PHMNLBICXXX/Account00010203
:28c:00001/0001
)
As an alternative, instead of tokenizing and processing strings you could use the analyze-string
function and match on the returned fn:match
elements:
Finally, taking up the idea of a map parameter to define the element names the second solution can be shortened to