[xquery-talk] Whitespace problem in CSV-like output
Y.Forkl at srz.de
Mon Oct 20 13:34:24 PDT 2008
John Snelson wrote:
> Well, DataDirect's method seems to require you to construct a custom XML
> structure, and specify a implementation specific serialization method.
> Your current method requires that you create some strings, and join them
> with string-join(). I'm not sure there's a lot of difference between the
You are right that both approaches don't have what I was looking for: A
pre-cooked solution for writing CSV rows and cells. But that's OK, now I
have what I need and at the same time I have learned some useful things.
> I agree that using a space as a separator between atomic items when
> outputting them can be confusing - but at other times it's actually very
> useful. It's now a widespread practice in both XQuery and XSLT 2.0, so I
> don't know how much it could be changed.
That's completely true. I'm familiar (and happy) with the space
insertion rules of XSLT 2.0 (if I may use this non-technical term here),
but still have to wrap my head around the way XQuery serializes the
results of multiple iterations.
> It would seem to be a bug if it drops the last line feed in the output.
Unfortunately not: Of course, string-join's separator character (here:
line feed) is by definition not to be appended after the last item.
That's why changing the functions doesn't work out.
More information about the talk