Sorry for the duplicate post.
From: Kendall Shaw kendall.shaw@workday.com Date: Sunday, August 20, 2017 at 9:00 PM To: BaseX basex-talk@mailman.uni-konstanz.de Subject: RESTXQ %input:csv annotation
The example produces an error saying it can’t convert string to document node:
declare %rest:path("/store.csv") %rest:POST("{$csv}") %input:csv("header=true,encoding=CP1252") function page:store-csv($csv as document-node()) { "Number of rows: " || count($csv/csv/record) };
I can just change the function signature and parse the string with csv:parse, but is the example missing a detail (or am I missing a detail)?
I used this to store CSV data in the default format.
curl –XPOST –H’Content-Type: text/csv’ –data @some.csv http://example.com/basex/store.csv
Kendall