XML Script logo
Parsing repeated text using a _for loop
Code
<_data >
<parseInput >testing a1,b1,c1,d1
testing a2,b2,c2,d2
testing a3,b3,c3,d3</parseInput>
</_data>
# parseInput := parseInput '\nENDTAG' #
<_for from="1" to="3" >
<_parse text="parseInput" >testing # col1 #,# col2 #,# col3 #,# col4 #
# parseInput #
ENDTAG</_parse>
# parseInput := parseInput '\nENDTAG' #
parsed: # col1 #: # col2 #: # col3 #: # col4 #
</_for>
Output

parsed: a1: b1: c1: d1

parsed: a2: b2: c2: d2

parsed: a3: b3: c3: d3
Ref

x.2308

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited