Joe Wicentowski
2016-09-08 03:10:27 UTC
Hi Michael,
I hope this is an acceptable forum to raise a question regarding your
post to public-xsl-query, since I think non-WG members can't post to
that list.
map:find() seems like a very convenient new function. It gives us the
equivalent of the descendant-or-self axis for maps, which is really
going to simplify querying maps. My question:
Has the WG considered a ?? operator or some such shortcut for
map:find(), to correspond to the abbreviated syntax for the
descendant-or-self axis, (//)? For example:
```
let $inventory := map{"name":"car", "id":"QZ123", "parts":
[map{name":"engine", "id":"YW678", "parts":[]}]}
return
$inventory??parts
(: same as map:find($inventory, 'parts') :)
```
Not necessary, but it seems in the spirit of other syntax
abbreviations like ?* (similar to /*).
Incidentally, searching the spec to see if this was already discussed
(it isn't) led me to a possible typo. In
https://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/Overview-diff.html#regex-syntax
for "X, once or not at all."
Joe
---------- Forwarded message ----------
From: Michael Kay <***@saxonica.com>
Date: Tue, Sep 6, 2016 at 6:37 PM
Subject: New F+O 3.1 draft
To: Public Joint XSLT XQuery XPath <public-xsl-***@w3.org>
I have committed a new F+O draft (dated 6 September) which
incorporates most of the changes agreed today.
http://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/Overview-diff.html#func-map-find
It includes a proposed spec for map:find(): please review this.
I have also committed some tests for map:find().
Michael Kay
Saxonica
_______________________________________________
***@x-query.com
http://x-query.com/mailman/listinfo/talk
I hope this is an acceptable forum to raise a question regarding your
post to public-xsl-query, since I think non-WG members can't post to
that list.
map:find() seems like a very convenient new function. It gives us the
equivalent of the descendant-or-self axis for maps, which is really
going to simplify querying maps. My question:
Has the WG considered a ?? operator or some such shortcut for
map:find(), to correspond to the abbreviated syntax for the
descendant-or-self axis, (//)? For example:
```
let $inventory := map{"name":"car", "id":"QZ123", "parts":
[map{name":"engine", "id":"YW678", "parts":[]}]}
return
$inventory??parts
(: same as map:find($inventory, 'parts') :)
```
Not necessary, but it seems in the spirit of other syntax
abbreviations like ?* (similar to /*).
Incidentally, searching the spec to see if this was already discussed
(it isn't) led me to a possible typo. In
https://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/Overview-diff.html#regex-syntax
X?? matches X, once or not at all
Shouldn't the second question mark be deleted? "X?" should sufficefor "X, once or not at all."
Joe
---------- Forwarded message ----------
From: Michael Kay <***@saxonica.com>
Date: Tue, Sep 6, 2016 at 6:37 PM
Subject: New F+O 3.1 draft
To: Public Joint XSLT XQuery XPath <public-xsl-***@w3.org>
I have committed a new F+O draft (dated 6 September) which
incorporates most of the changes agreed today.
http://www.w3.org/XML/Group/qtspecs/specifications/xpath-functions-31/html/Overview-diff.html#func-map-find
It includes a proposed spec for map:find(): please review this.
I have also committed some tests for map:find().
Michael Kay
Saxonica
_______________________________________________
***@x-query.com
http://x-query.com/mailman/listinfo/talk