Hi!
I am an electronic archivist and I have recently tried to use BaseX to unzip files in an archive. The two main lines I have used are:
let $archive := file:read-binary(xquery:eval($filepath-corrected) return archive:extract-to(xquery:eval($dir_corrected), $archive)
The variables $dir_corrected and $archive are defined earlier in the code. But I get the error message 'malformed input off : 10, length : 1' , indicating that there is an issue with the input data being processed.
Do you know what can cause this problem? And do you know of a possible work - around?
Med vennlig hilsen
Thomas Berge Grythe Rådgiver Innlandet Fylkesarkiv/IKA Opplandene
Telefon: 48 99 47 85 E-post: thogry@innlandetfylke.nomailto:thogry@innlandetfylke.no
[cid:cb942b57-4e06-4d32-b529-cd07173c2993]
Innlandet fylkeskommune Telefon: 62 00 08 80 www.innlandetfylke.nohttps://www.innlandetfylke.no/
On 12/11/2024 10:27, Grythe, Thomas Berge wrote:
Hi!
I am an electronic archivist and I have recently tried to use BaseX to unzip files in an archive. The two main lines I have used are:
let $archive := file:read-binary(xquery:eval($filepath-corrected) return archive:extract-to(xquery:eval($dir_corrected), $archive)
The variables $dir_corrected and $archive are defined earlier in the code. But I get the error message 'malformed input off : 10, length : 1' , indicating that there is an issue with the input data being processed.
Do you know what can cause this problem? And do you know of a possible work - around?
What do you need those xquery:eval calls for?
Hi Thomas,
As Martin indicated, it would be interesting what the xquery:eval function call does. Could you possibly provide us with a little self-contained example?
With BaseX 11 or later, you can simply do:
archive:extract-to('/path/to/target', '/path/to/archive')
Best, Christian
On Tue, Nov 12, 2024 at 10:28 AM Grythe, Thomas Berge < thogry@innlandetfylke.no> wrote:
Hi!
I am an electronic archivist and I have recently tried to use BaseX to unzip files in an archive. The two main lines I have used are:
let $archive := file:read-binary(xquery:eval($filepath-corrected) return archive:extract-to(xquery:eval($dir_corrected), $archive)
The variables $dir_corrected and $archive are defined earlier in the code. But I get the error message 'malformed input off : 10, length : 1' , indicating that there is an issue with the input data being processed.
Do you know what can cause this problem? And do you know of a possible work - around?
Med vennlig hilsen
*Thomas Berge Grythe* Rådgiver Innlandet Fylkesarkiv/IKA Opplandene
Telefon: 48 99 47 85 E-post: thogry@innlandetfylke.no
*Innlandet fylkeskommune* Telefon: 62 00 08 80 www.innlandetfylke.no
basex-talk@mailman.uni-konstanz.de