Hi Pascal,
if you use BaseX inside a shell script or as a command line xquery processing tool, you may also use the -L flag:
$ basex -h 2>&1 | grep L Usage: basex [-bcdiLosuvVwxz] [query] -L Append newlines to query results
$ basex -L 'for $i in 1 to 10 return $i' 1 2 3 ...
All the best, Alex
On 04.07.2012, at 04:24, Christian Grün wrote:
Hi Pascal,
you can either create a new, single string via the fn:string-join() function…
string-join(for $i in 1 to 10 return "x"," ")
…or use the "output:separator" option of BaseX:
declare option output:separator '\n'; (1 to 10) ! "x"
The second option, or a variation of it, may eventually find entrance into the official W3 XQuery Serialization Specification (see [1] for future details).
Hope this helps, Christian
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=16311
Anyone has a little xquery / basex tip in getting rid of the extra white space that shows up at the beginning of each line after the first in the following xquery for $i in 1 to 10 return concat("x"," ") which in the UI returns x x x x x Just need a text output going to csv but this extra space is causing me headaches. tks *P
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Alexander Holupirek |-- http://www.informatik.uni-konstanz.de/~holupire |-- Database & Information Systems Group, U Konstanz `-- Room E 221, 0049 7531 88 2188 (phone) 3577 (fax)