Hi All,
I am not sure whether the serialize function is working properly (the first example works, the second does not, because instead of tabs I get commas, and there is no way to specify to add the header)
<csv> <record> <a>f</a> <b>f</b> <c>f</c> <d>f</d> <e>f</e> <f>f</f> </record> </csv> => csv:serialize(map{"header":"yes", "separator": " "})
return a b c d e f f f f f f f
<csv> <record> <a>f</a> <b>f</b> <c>f</c> <d>f</d> <e>f</e> <f>f</f> </record> </csv> => serialize(map{"method":"csv", "item-separator": " "})
f,f,f,f,f,f
Thanks! Giuseppe
Hi Giuseppe,
If you use fn:serialize, you can use the 'csv' parameter to assign CSV serialization options [1].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Serialization
Giuseppe Celano celano@informatik.uni-leipzig.de schrieb am Fr., 20. Juli 2018, 15:45:
Hi All,
I am not sure whether the serialize function is working properly (the first example works, the second does not, because instead of tabs I get commas, and there is no way to specify to add the header)
<csv> <record> <a>f</a> <b>f</b> <c>f</c> <d>f</d> <e>f</e> <f>f</f> </record> </csv> => csv:serialize(map{"header":"yes", "separator": " "})
return a b c d e f f f f f f f
<csv> <record> <a>f</a> <b>f</b> <c>f</c> <d>f</d> <e>f</e> <f>f</f> </record> </csv> => serialize(map{"method":"csv", "item-separator": " "})
f,f,f,f,f,f
Thanks! Giuseppe
basex-talk@mailman.uni-konstanz.de