Subject: Re: [xsl] Subtle (or not?) Map Processing Bug in XQuery From: "Eliot Kimber ekimber@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 7 Jan 2022 18:22:42 -0000 |
Good point about asbIbm OCD about it in XSLT but havenbt gotten there in my XQuery yet. But Ibm not sure how it would have caught the error in this case as in the bug case Ibm still providing maps to map:merge(), just the wrong ones. Cheers, E. -- Eliot Kimber http://contrext.com From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Reply-To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Date: Friday, January 7, 2022 at 12:11 PM To: xsl-list <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: [xsl] Subtle (or not?) Map Processing Bug in XQuery 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 XSL-List info and archive EasyUnsubscribe (by email)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Subtle (or not?) Map Proc, Michael Kay mike@xxx | Thread | Re: [xsl] Subtle (or not?) Map Proc, Wendell Piez wapiez@ |
Re: [xsl] Subtle (or not?) Map Proc, Michael Kay mike@xxx | Date | Re: [xsl] Subtle (or not?) Map Proc, Wendell Piez wapiez@ |
Month |