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 16118 - Maps should be first class citizens
Summary: Maps should be first class citizens
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-25 16:44 UTC by Eric van der Vlist
Modified: 2012-05-17 16:17 UTC (History)
0 users

See Also:


Attachments

Description Eric van der Vlist 2012-02-25 16:44:05 UTC
I think that this is important for XSLT and XQuery users to be able to traverse maps like they traverse XML fragments (with the same level of flexibility and syntaxes that are kept as close as possible). And yes, that means being able to apply templates over maps and be able to update maps using XQuery update…

But I also think that this will be important to other technologies that rely on XPath such as (to name those I know best) XForms, pipeline languages (XPL, XPROC, …) and Schematron.

Being able to use XForms to edit JSON object is an obvious need that XForms 2.0 is trying to address through a “hack” that has been presented at XML Prague 2012.

In a longer term we can hope that XForms will abandon this hack to rely on XDM maps XForms relies a lot on the notions of nodes and axes. XForms binds controls to instance nodes and the semantics of such bindings would be quite different to be applied to XDM map entries as currently proposed.

XML pipeline languages are also good candidates to support JSON objects. Both XPL and XProc have features to loop over document fragments and choose actions depending on the results of XPath expressions and again the semantics of these features would be affected if they had to support XDM maps as currently proposed.

Schematron could be a nice answer to the issue of validating JSON objects. Schematron relies on XPath at two different levels: its rules are defined as XPath expressions and it is often very convenient to be able to use XPath axes such as ancestor and its processing model is defined in term of traversing a tree. Again, an update of Schematron to support maps would be more difficult is maps are not similar to XML nodes.

(See also http://eric.van-der-vlist.com/blog/2012/02/25/xdm-maps-should-be-first-class-citizens/ )
Comment 1 Michael Kay 2012-05-10 16:49:36 UTC
This whole area (maps, JSON) has been the subject of very active discussion in the working groups over the last year or so. Detailed proposals have been made, though agreement has not yet been reached. However, we expect the next published working draft of XSLT to include a proposal in this area, and we will greatly welcome your detailed review when it appears.

I'm marking this as resolved.
Comment 2 Michael Kay 2012-05-17 16:17:44 UTC
We are closing this to get it off the agenda; feel free to re-open if you feel the matter needs further discussion.