QT4 CG Dashboard

These are the open pull requests and current branches. Where possible, a summary of the changes between the pull request or branch and the latest drafts is provided with a DeltaXML pipeline.

Pull requests in descending order

PR #1853: 1845 Revised design of methods to use . rather than $this

Pull request #1853 by michaelhkay.

Proposal is that in methods, the containing map should be bound to the context item rather than to the special variable $this, so fields of that map are referenced as `?x` rather than `$this?x`.

Changed files
  • specifications/xquery-40/src/errors.xml
  • specifications/xquery-40/src/expressions.xml
  • specifications/xquery-40/src/query-prolog.xml

PR #1850: Actions from meeting 111

Pull request #1850 by michaelhkay.

[ ] QT4CG-111-01: MK to review the editorial comments on PR #1837 and then merge the PR. Done (along with a couple of other minor corrections noted in passing) [ ] QT4CG-111-02: MK to fix the typo $in as xs:double+ and 1.3. 1.4 that middle “.” should be a “,” Already done before the PR was merged [ ] QT4CG-111-03: MK to add a %method example that uses the arrow syntax. Done (though the example isn't especially convincing). Also added another couple of examples and notes in passing.

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xquery-40/src/expressions.xml
  • specifications/xquery-40/src/query-prolog.xml

PR #1839: Relax the return type of the Invisible XML parsing function

Pull request #1839 by ndw.

Fix #1796 This change does not appear to change any test results. (In other words, none of our tests checked that the return type was explicitly a document node.)

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml

PR #1838: Attempt to add change markup in collapsed ToC

Pull request #1838 by ndw.

Fix #1820 This PR updates the styling so that a small "Δ" is added to the expand arrow when there are changes or additions in the concealed subsections. It's smaller and not blue. I could argue that this is on purpose so that the marking is different and perhaps more subtle. But the truth is, it was just easier to add the Δ without any markup that would make it larger or blue. I've opted to conceal the Δ when the ToC is "open" on the grounds that you can see what is or isn't marked new on the revealed subsctions.

Changed files
  • specifications/js/toc.js
  • style/xmlspec-2016.xsl

PR #1835: add zero-width assertions to regular expressions

Pull request #1835 by liamquin.

Proposal for issues !998 and !1006 to add zero-width assertions - lookahead, lookbehind, and word boundary. Word boundaries use the already-defined \w and \W from XML Schema. The syntax for lookahead and lookbehind assertions supports the two most common variants, one using < and > and the other using `(*positive_lookahead:expr)`, which is at least amenable to Web searches, and doesn’t need escaping in XSLT or XQuery. Note that word boundary \< \b \B \> assertions can be rewritten in terms of lookahead and lookbehind assertions. Perl has a more powerful form of \b and \B that can match grapheme clusters, the Unicode linebreaking algorithm, and more, but supporting that would require language and script based mechanisms; if the graphemes() function is added, it would be worth considering. For now, i made it an error to write \b{...} so that the support could be added later if wanted, and also so that copying regular expressions into XPath would raise an error for the unsupported feature. I will reopen !998 - if this is accepted i can produce test cases. Of course, i’m also happy to edit/rewrite etc. The syntax is widely supported, although \K is i think not in libpcre (but, libpcre has looser restrictions on negative backward assertions).

Changed files
  • specifications/xpath-functions-40/src/xpath-functions.xml

PR #1801: 1798 Function fn:function-identity

Pull request #1801 by dnovatchev.

The function fn:identity as already described and discussed in #1798

Changed files
  • specifications/xpath-datamodel-40/src/xpath-datamodel.xml
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml

PR #1778: 1456 Lookup expressions filtered by type

Pull request #1778 by michaelhkay.

Fix #1456 Allows selection of records by type within a JSON tree, for example `$json ?? ~record(first, last) ? last`. I'm aware that the use of the tilde here is controversial but I think this kind of query is going to be very common; it needs something simple and I think people will get used to it. No-one has suggested anything that is obviously better, and I propose to also use `~` in other similar contexts, for example type patterns in XSLT, which will increase familiarity. I suggest reading `~` as "of type".

Changed files
  • specifications/grammar-40/xpath-grammar.xml
  • specifications/xquery-40/src/expressions.xml

PR #1766: 1715 Drop array bound checking

Pull request #1766 by michaelhkay.

Fix #1715 Drops array bound checking from `array:get`, arrays-as-functions, and array lookup. Returns () instead of an error FOAY0001 when the index is out of bounds. This brings arrays and maps into closer alignment. Drops the `$fallback` argument of `array:get()` Adds a new function `array:get-if-present()` which replicates the old behaviour of `array:get()`. Functions such as `array:put`, `array:replace`, `array:insert-before`, `array:head`, `array:tail` continue to perform bound checking.

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml
  • specifications/xquery-40/src/expressions.xml

PR #1740: 1725b Further elaboration of duplicates handling in maps

Pull request #1740 by michaelhkay.

Actions QT4CG-107-02 and QT4CG-107-03. The three functions map:build, map:of-pairs, and map:merge now all have the same options parameters, and avoid duplication in the specification. The xsl:map instruction is defined by reference to map:merge. Although the action suggested specifying these functions to use the first key from a set of duplicates, I found this was not possible because of the way map:put is defined. They therefore use the last key from the set of duplicates. Fix #1725

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml
  • specifications/xslt-40/src/element-catalog.xml
  • specifications/xslt-40/src/schema-for-xslt40.rnc
  • specifications/xslt-40/src/schema-for-xslt40.xsd
  • specifications/xslt-40/src/xslt.xml

PR #1735: 1341 Drop $position callback from many functions

Pull request #1735 by michaelhkay.

Responding to the discussion in #1341, this (somewhat experimental) PR explores the possibility of dropping the optional $position argument to the callback of many higher-order functions such as some(), every(), filter(), for-each(), fold-left(), fold-right(). Instead, it provides the option to wrap the input sequence in a call of numbered-items() which replaces each item in the input with an (item, position) pair. I've done this only (so far) for higher-order sequence functions, but the intent is that the same could be done for arrays and (potentially) maps. I left the position argument in place for a few functions where losing it seemed to cause genuine inconvenience: - partition(), where the function wraps the supplied items into arrays, and you don't want to have to remove the positions afterwards - subsequence-where(), where many use cases are likely to use positional information - for-each-pair(), where there are two input sequences and it seems clumsy to associate position information with one or the other The main benefit is that we provide one basic mechanism which is automatically available everywhere, which means we don't have to have debates about whether or not there is a use case for adding position information to (say) fold-left or scan-right. A further benefit is that the functions defined for sequences automatically become available for arrays and maps. I haven't yet explored the impact on maps and arrays; I will wait first to see what the reaction is to this proposal.

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml

PR #1587: 557 Add fn:binary-resource

Pull request #1587 by michaelhkay.

Adds the function `fn:binary-resource` Also fixes some inconstencies in the handling of static/executable base URI in other resource access functions. Fix #557

Changed files
  • specifications/xpath-functions-40/src/fos.xsd
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml
  • specifications/xquery-40/src/expressions.xml

PR #1296: 982 Rewrite of scan-left and scan-right

Pull request #1296 by michaelhkay.

Fix #982 1. The "equivalent expression" is replaced with one that is much shorter and hopefully easier to understand, though hopelessly inefficient as an actual implementation. 2. The result no longer includes the zero value. This seems simpler, and is consistent with other expositions I have read, e.g. of the Scala functions. 3. The signature of scan-left and scan-right is now identical to fold-left and fold-right, which apart from having the virtue of consistency, makes it much easier to specify one in terms of the other. The change is that the callback function now allows a position argument.

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml

PR #1283: 77b Update expressions

Pull request #1283 by michaelhkay.

This PR is the result of splitting PR #832 into two parts; this part extracts update expressions into a separate proposal, for ease of review.

Changed files
  • specifications/grammar-40/xpath-grammar.xml
  • specifications/xquery-40/src/expressions.xml

PR #1227: 150 PR resubmission for fn ranks

Pull request #1227 by dnovatchev.

This is a resubmission of the original [PR 1027 for function fn:ranks](https://github.com/qt4cg/qtspecs/pull/1027). No new changes, this is fixing a pure git-technical issue. Now the PR is submitted from a dedicated feature-branch and not from _master_

Changed files
  • specifications/xpath-functions-40/src/xpath-functions.xml

PR #1062: 150bis revised proposal for fn:ranks

Pull request #1062 by michaelhkay.

This proposal is an amended/alternative proposal for the fn:ranks function, taking into account the work done on the original issue #150 and the PR #1027 and the comments raised. Acknowledgements to the original author for the idea and for a lot of good work on examples etc. It amends the previous proposal as follows: (a) the signature and the semantics are aligned with fn:sort. This adds some functionality (multiple sort keys, ascending/descending) and also removes some complexity (two different collations for comparing input items and result items) (b) the style of exposition is changed editorially for consistency with other functions

Changed files
  • specifications/xpath-functions-40/src/function-catalog.xml
  • specifications/xpath-functions-40/src/xpath-functions.xml