On 01/02/2008, Cecil New <cecil.new@...> wrote:
> I am creating a CSV file from a collection of xml documents using the text
> output method. The second and following lines have a blank at the
> beginning. I cannot figure out how to suppress it. The query below
> reproduces the problem in the small.
> declare option saxon:output "method=text";
> declare option saxon:output "indent=no";
> declare variable $FS := ',';
> declare variable $RS := ' ';
> declare function local:sequence-to-csv($seq) as xs:string
> for $row in ("_1_" , "_2_" , "_3_")
You're passing a single item to the function each time, so
string-join() will have no effect.
Didn't you mean something like:
let $row := ("_1_","_2_","_3_")
The reason why you get the extra space in the output with your current
code is probably because you're returning a sequence of three items,
and so the default separator is used.