This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 30024 - [F+O 3.1] Is map:entry superfluous?
Summary: [F+O 3.1] Is map:entry superfluous?
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2016-11-30 17:08 UTC by Michael Kay
Modified: 2016-12-16 19:55 UTC (History)
1 user (show)

See Also:


Description Michael Kay 2016-11-30 17:08:45 UTC
Comment from Thomas Fischer on public-qt-comments:

the documentation for map:entry says:

Unlike the map expression (map{...}), this technique can be used to construct a map with a variable number of entries, for example:
    map:merge(for $b in //book return map:entry($b/isbn, $b))

At least with Saxon-HE you can achieve the same result with a simple map constructor
    map:merge(for $b in //book return map{$b/isbn: $b})

I wonder, if this is just a "special feature" of Saxon or if there is any other reason to keep map:entry in the proposal

Th. Fischer
Comment 1 Michael Kay 2016-11-30 17:17:01 UTC
Provisional personal response: yes, I think map:entry() is now in a technical sense redundant. However, the fact that something can be done using custom syntax doesn't necessarily mean it's wrong to have a function as well, and at this stage of the game, I don't think redundancy is a good enough reason to pull something out of the spec.

At one time I believe that the XSLT working group was trying to ensure that maps could be manipulated using XPath 2.0 without syntax extensions, purely as a function library, and that may still be a relevant argument for some people.
Comment 2 Josh Spiegel 2016-11-30 17:37:34 UTC
Maybe deleting the text "Unlike the map expression (map{...})" would avoid implying there is some technical limitation where map:entry is required.
Comment 3 Michael Kay 2016-12-05 14:44:38 UTC
I have implemented Josh's suggestion.
Comment 4 Michael Kay 2016-12-06 16:26:03 UTC
The WG decided that there were adequate reasons to retain the function and the text justifying its inclusion has been improved.