Now I don't get any error bu the extracted file are not stored as binaries
What is wrong with this code?
I removed the updating annotation and returned $target instead of the try/store/catch inside the loop and got the expected result path name
let $database := 'db'
let $extractTo := 'target.zip'
(: path to raw stored zip :)
let $archivePath := 'alpha/bravo/charlie/delta.zip'
let $archive := db:retrieve($database, $archivePath)
let $basePath := replace($archivePath, '[^/]+$', '') || $extractTo
let $entries := archive:entries($archive)
let $contents := archive:extract-binary($archive)
return for-each-pair($entries, $contents, %updating function($entry, $content) {
let $target := $basePath || '/' || $entry/text()
return try {
db:store($database, $target, $content)
} catch * {
()
}
})