I have input data of the form
<coordinates>x1,y1 x2,y2 x3,y3</coordinates>
e.g.
<coordinates>10,10 10,20 20,20</coordinates>
There can be any number of space-delimited substrings. At present this is
parsed using substring-before and substring-after with a recursive template,
to generate a sequence of elements <Point X="10" Y="10"/> etc.
Unfortunately this can sometimes be slow for long lists (by which I mean
5000 or so x,y pairs). In addition I have to divide up the resultant list
of elements into chunks (to avoid exceeding a limit on the number of points
in a line), although this can easily be done on a second pass (it's then a
similar problem to splitting up for a table with a given number of columns).
i.e. I want
<coordinates>x1,x2 ...
to become someething like (ignoring attributes for simplicity!)
<Polyline>
<Point><Point><Point><Point>
</Polyline>
<Polyline>
<Point><Point><Point><Point>
</Polyline>
Can anyone think of a better way, especially a way of splitting up without
the need for a second pass? What I'd really like is a trivial way to make
xsl treat the string as a node list split at whitespace, but I suspect that
that isn't possible!
Tim
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list