Trying to use the example,  in the RESTXQ section of the documentation:

 

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)

};

 

Using:

 

curl  -i -XPOST –data @test.csv   -H’Content-Type: text/csv’ http://blah/basex/store.csv

 

The result is [XPTY0004] Cannot cast xs:string to document-node()

 

I can just invoke csv:parse but, is the example missing a detail?

 

Kendall