[xquery-talk] Whitespace problem in CSV-like output
John Snelson
john.snelson at oracle.com
Fri Oct 17 18:23:32 PDT 2008
Yves Forkl wrote:
> It is a bit disappointing to see that XQuery does not offer a simple,
> general method to create CSV-type files, at least not in my case.
What would be simpler than what you have written here?
> NB: While the names of the functions seem to suggest that the line feed
> should rather be appended in my:join-records-into-lines than in
> my:join-fields-into-record, I don't see any easy way to do this.
Redefine your functions like this:
declare function my:join-fields-into-record
( $fields as xs:string*,
$delimiter as xs:string ) as xs:string {
string-join($fields, $delimiter)
} ;
declare function my:join-records-into-lines
( $records as xs:string* ) as xs:string {
string-join($records, " ")
} ;
John
--
John Snelson, Oracle Corporation http://snelson.org.uk/john
Berkeley DB XML: http://oracle.com/database/berkeley-db/xml
XQilla: http://xqilla.sourceforge.net
More information about the talk
mailing list