I've spent the last couple of working days getting nowhere with this so I hope someone can help. I'm trying to extract data from a delimited string i.e.
Code:
<FreeText>U2..123-Y/MAN-0900/STN-1200/TKT-1/GBP/A1-..50.00/T-.20.00/CF-ROSSTEST</FreeText>
I've used recursive calls to output the whole string element by element, but in this particular case I want just the 5th item (GBP). I've done the following which works, but is a little long winded.
Code:
<Fare Currency="{substring-before(substring-after(substring-after(substring-after(substring-after(FreeText, '/'), '/'), '/'), '/'), '/')}">
However, when I need the 6th, 7th.... etc. the number of "substring-after"s increases and is starting to get more difficult to interpret/read. Also, sometimes I only need a substring of the data (i.e. from the 2nd element I need to create an XML tag with just the first 3 characters ("MAN") and for another XML tag I need the last 4 converted to hh:mm format
As I have different "Freetext" lines containing different delimited data, I was going to set up templates passing in the data & the number of the element I need.
Any ideas anyone??
thanks in advance