Dear all,
I 'm trying to return a zip from a restxq request with a (simplified) function like :
declare %restxq:path("cnfull/aozip/{$doc-number}/{$kind}") %restxq:GET %output:media-type("application/zip") function questel:zipped-ao-request-by-doc-number-kind($doc-number as xs:string, $kind as xs:string) { archive:create( element archive:entry { 'blabla.xml' }, fn:serialize(<xml-here/>)) };
But the result is an invalid zip archive...
Am I missing something ?
Best regards, And thank you for the wonderful peace of software BaseX is.
Fabrice
Hi Fabrice,
But the result is an invalid zip archive...
You will have to add the following annotation:
%output:method("raw")
It enforces binary64 and hex data to be passed on in its original byte representation.
I have extended some info in our Wiki RESTXQ entry.
Best, Christian
Once again thank you Christian !
I wrote a servlet in my young days to do that... Now A single XQuery line does it !
Do you plan to offer 'user defined' indexes in near future ? (Indexing only a giving xpath attribute, text or ft)
Have a nice day.
Best regards, Fabrice
-----Message d'origine----- De : Christian Grün [mailto:christian.gruen@gmail.com] Envoyé : mardi 25 février 2014 17:53 À : Fabrice Etanchaud Cc : basex-talk@mailman.uni-konstanz.de Objet : Re: [basex-talk] RESTXQ : returning application/zip data
Hi Fabrice,
But the result is an invalid zip archive...
You will have to add the following annotation:
%output:method("raw")
It enforces binary64 and hex data to be passed on in its original byte representation.
I have extended some info in our Wiki RESTXQ entry.
Best, Christian
Do you plan to offer 'user defined' indexes in near future ? (Indexing only a giving xpath attribute, text or ft)
Feel free to add your voting to the oldest, still open GitHub issue [1] :)
Christian
[1] https://github.com/BaseXdb/basex/issues/59
Have a nice day.
Best regards, Fabrice
-----Message d'origine----- De : Christian Grün [mailto:christian.gruen@gmail.com] Envoyé : mardi 25 février 2014 17:53 À : Fabrice Etanchaud Cc : basex-talk@mailman.uni-konstanz.de Objet : Re: [basex-talk] RESTXQ : returning application/zip data
Hi Fabrice,
But the result is an invalid zip archive...
You will have to add the following annotation:
%output:method("raw")
It enforces binary64 and hex data to be passed on in its original byte representation.
I have extended some info in our Wiki RESTXQ entry.
Best, Christian
basex-talk@mailman.uni-konstanz.de