> In my XQuery script Ibm building a map from all the image files in a
directory tree (using BaseXbs file extensions):
>
> let $files := file:list($rootDir, true(), b*.pngb)
> let $imageMap := map:merge(
> for $file in $files
> map:entry(local:getFilename($file), map{bpathb : $file, bkeynameb,
local:getKeyName($file))
> )
>
> At this point $imageMap is a map where each entrybs value is also a map.
Then declare it as such: don't forget the "as" clause. Declaring the types of
your variables would have caught the bug for you. It would also have made the
code more readable.
Michael Kay
Saxonica
|