@qt4cg statuses

This page displays recent status updates about the QT4CG project.

The are also captured in an RSS feed.

By year: 2026, 2025, 2024, 2023, 2022, 2021, 2020

QT4 CG meeting 189 draft agenda #agenda-11-17

16 Nov at 09:45:00 GMT

Draft agenda published.

Issue #3084 created #created-3084

13 Nov at 12:48:31 GMT
Forwards compatibility of options parameters

I'm having to modify some load-xquery-module tests to specify trusted=true, because the dynamically-loaded module in turn does static imports of further modules. Fortunately the queries still run under 3.1, because in 3.1, processors are required to ignore unknown options.

This makes me question whether it was really wise to make 4.0 processors reject unknown options: it may well be that the option is given a meaning in a future version of the specification.

One way around this would be the XSLT mechanism of forwards compatibility mode: a version N processor executing a query labelled with version N+x should accept and ignore unknown options.

Alternatively, revert this change; make the presence of an unknown option a warning condition rather than an error.

Issue #3083 created #created-3083

12 Nov at 08:39:07 GMT
Refactoring of rules for node construction

There is currently a great deal of duplication between the XSLT and XQuery specifications describing basic operations for node construction (specifically, XNode construction). Because it appears in both XSLT and XQuery, it's difficult to reference it normatively from the new fn:update function, which needs to perform many of the same operations. I therefore propose that we define a set of node construction operations in the data model spec, and reference them from XSLT, XQuery, and fn:update where appropriate.

We have already extracted common material relating to XSD validation into one place (section 17.2.4 of F&O) and I'm thinking that the data model spec might be a better home for this.

Candidates for this treatment include

From XSLT: sections 5.7.1 to 5.7.3 on Constructing Simple Content, Constructing Complex Content, Namespace Fixup

From XQuery: much of section 4.12, Node Constructors

It's also possible that this might open the door to creation of a free-standing function library for node construction (something that has always been an ambition of mine) but that's not the primary goal.

There are differences between XSLT and XQuery, for example in the way that duplicate attributes are handled, or in the error codes that are returned, and these will need to be handled by parameterizing the common descriptions in XDM.

Issue #3082 created #created-3082

11 Nov at 23:40:50 GMT
function-name() of a partially applied function

There's a special rule for a static partial function application that if all the arguments are placeholders, the function name is retained. That's designed to ensure equivalence between count(?) and count#1.

There's no similar rule for a dynamic partial application. $f(?) should be a no-op, it should return $f unchanged, but it actually drops the function name if there is one.

If we're going to make an exception in one case then we should make it in both.

Problem is exposed by test case fn-function-name-030

[Question: is function-name() actually useful? Would it make more sense if all function items were anonymous?]

Pull request #3081 created #created-3081

11 Nov at 15:30:21 GMT
2935B Arithmetic Mode Decimal

Addresses the other part of issue 2935 by allowing arithmetic mode = decimal to be defined in the static context.

The enhancement is proposed as an optional feature in both XSLT and XQuery because the facility is special to the needs of a particular market sector.

See issue #2935

Pull request #3080 created #created-3080

11 Nov at 15:24:46 GMT
3079 Split %fixed into two terminal symbols

Split %fixed into the two terminal symbols "%" "fixed", as suggested by Michael Kay, aligning the syntax with annotations.

Closes #3079

Issue #3079 created #created-3079

11 Nov at 14:51:02 GMT
Proposal to classify `%fixed` as a non-delimiting terminal symbol

%fixed is currently classified as a "delimiting terminal symbol". Per A.3.2 Terminal Delimitation, this does not call for symbol separators following it, even if the following terminal is a name. So this would be valid:

declare record local:s(%fixeda := 1);

This does not feel right to me. My proposal is to make %fixed a "non-delimiting terminal symbol". This would ask for symbol separators on its right hand side if followed by a name, as in the case above. The preceding token is always a "delimiting terminal symbol" (( or ,), so an extra symbol separator would not become necessary there.

Pull request #3078 created #created-3078

11 Nov at 12:52:00 GMT
3076 Function assertions in reserved namespaces

Closes #3077

Issue #3077 created #created-3077

11 Nov at 12:49:46 GMT
Function assertions in reserved namespaces

3.2.8.7 (Function Types) says: “it is a static error [err:XQST0045] for a user to define a function assertion in a reserved namespace.”

It’s not 100% clear to me what “define” means here. Using an assertion in a function type is not the same as defining one:

local:f#0 instance of %public function() as item()*

An unprefixed assertion name is in the reserved namespace http://www.w3.org/2012/xquery. A note says that this is “in practice … always an error”, but the rule itself doesn’t require it. As a result, test annotation-assertion-20 accepts true or false, not an error.

I would propose to…

  • replace the sentence with: “It is a static error [err:XQST0045] if the name of a function assertion is in a reserved namespace, unless the assertion is defined in a specification, such as %updating in the XQuery Update Facility.”,
  • add function assertions to the description of XQST0045 in the error appendix, and
  • turn the note into a short consequence of the rule: unprefixed names are an error unless they are defined assertions.

%public and %private are annotations, not function assertions, so the exception doesn’t cover them.

Issue #2992 closed #closed-2992

11 Nov at 12:13:12 GMT

JNodes: tweaks

Pull request #3076 created #created-3076

11 Nov at 11:21:24 GMT
2935A: Default function options in the static context

Addresses part of issue 2935 by allowing defaults for function options to be taken from the static context.

Currently defined for XSLT only, but if favourably received I will add syntax for xquery, probably along the lines

declare default options fn:doc {'dtd-validation': true()}

A difficulty is that XQuery has no equivalent to XSLT's static expressions.

Pull request #3075 created #created-3075

11 Nov at 11:03:41 GMT
3074 Regular expressions: Unicode scripts

Closes #3074

Issue #3074 created #created-3074

11 Nov at 10:46:27 GMT
Regular expressions: Unicode scripts

Regular expressions support Unicode categories (\p{Lu}) and blocks (\p{IsGreek}), but not scripts. Blocks are a poor substitute: \p{IsGreek} covers U+0370–U+03FF, which includes Coptic letters but not Greek Extended:

matches('ἀ', '\p{IsGreek}')  (: false :)

Scripts are needed, for example, for JSON Schema (IDNA2008 rules, RFC 5892, idn-hostname format).

Proposal:

charProp ::= IsCategory | IsBlock | IsScript
IsScript ::= ("Script=" | "sc=") ScriptName

ScriptName is a script name or short alias from the Unicode Character Database (Greek, Grek), matched case-sensitively:

matches('ἀ', '\p{Script=Greek}')  (: true :)
matches('ἀ', '\p{sc=Grek}')       (: true :)

The implementation effort should be small: most regex engines support it out of the box (JavaScript, Java, ICU, PCRE2, Rust, etc.).

Pull request #3073 created #created-3073

11 Nov at 10:32:15 GMT
3072 Switch, typeswitch: optional default clause

Closes #3072

Issue #3072 created #created-3072

11 Nov at 10:28:26 GMT
Switch, typeswitch: optional default clause

With switch and typeswitch, default is mandatory. This gets in the way when all possible values are already covered by the case clauses, which is often true for enums:

declare variable $color as enum('red', 'green', 'blue') external;

switch ($color) {
  case 'red' return 1
  case 'green' return 2
  case 'blue' return 3
  default return error()  (: never reached :)
}

Users have to write a default branch that can never be reached. This adds noise, and if the default branch is an error call, it hides missing cases.

Proposal:
* Make the default clause optional in switch and typeswitch expressions.
* If no case matches, raise a new dynamic error.
* Processors may report missing cases statically (for enums, choice types, perhaps other and future cases)

Pull request #3071 created #created-3071

11 Nov at 10:25:42 GMT
3070 Guarded expressions: missing constructs

Closes #3070

Issue #3070 created #created-3070

11 Nov at 10:22:56 GMT
Guarded expressions: missing constructs

The section on guarded expressions says it gives “the complete list of expressions that have guarded subexpressions”. I think some constructs seem to be missing, at least…

  1. Function bodies, for example, let $f := fn() { 1 div 0 } return 1
  2. Lookups, for example, ()?(1 idiv 0)
  3. Predicates: in E[P], P is guarded, but the effective boolean value is computed by the filter expression, not by P. May ()[('a', 'b')] raise FORG0006? I suggest saying that computing the truth value is guarded too.
  4. Quantifiers: Only P in satisfies P is guarded. In some $x in (), $y in 1 idiv 0 satisfies true(), the second binding is not covered. I suggest the same rule as for FLWOR: each binding is guarded by the existence of an item bound in the earlier bindings.

Pull request #3069 created #created-3069

11 Nov at 10:20:12 GMT
3068 `item` axis: document order

Closes #3068

Issue #3068 created #created-3068

11 Nov at 10:17:31 GMT
`item` axis: document order

The item axis returns JNodes whose parent is the context node, but which are not children of it. The rules for document order in JTrees don’t say where these nodes belong.

The most obvious solution I guess is to let the nodes come directly after its parent and before the parent’s children, like XML attributes.

Pull request #3067 created #created-3067

11 Nov at 10:14:16 GMT
3066 Node constructors: JNodes

Closes #3066

Issue #3066 created #created-3066

11 Nov at 10:10:22 GMT
Node constructors: JNodes

We have already adapted the map constructors rules for JNodes, but didn’t look at other constructors yet:

node() now matches JNodes too, so the rule “For each node returned by an enclosed expression, a new copy is made…” applies, but a JNode can’t be copied into an XML tree.

Examples:

<a>{ { 'x': 'y' }/x }</a>
<a>{ [ <b/> ]/1 }</a>
<a>{ [ [ 1, 2 ] ]/1 }</a>

I think we should replace each JNode by its ·jvalue·. The existing rules then apply: atomic items become text, XNodes are copied, arrays are flattened, and maps raise XQTY0105. The results for the examples would be:

<a>y</a>`
<a><b/></a>
<a>1 2</a>

Pull request #3065 created #created-3065

11 Nov at 10:04:05 GMT
3064 `fn:jvalue`: accept any item

Closes #3064

Issue #3064 created #created-3064

11 Nov at 10:01:30 GMT
`fn:jvalue`: accept any item

fn:jvalue declares its parameter as jnode()?, so any other item raises XPTY0004. This is at odds with how JNodes are handled everywhere else. Examples:

  • Axis steps wrap maps and arrays implicitly: $map/child::* works without an explicit jtree call.
  • fn:jtree was generalized to accept any value (see #2825).
  • Coercion unwraps JNodes silently wherever atomic items, maps or arrays are expected.

As a result, sequences that mix JNodes and plain values arise naturally, e.g. when ? lookups and / steps are combined, and jvalue is the obvious function to normalize them. Currently, this fails:

let $data := { "a": 1, "b": [ 2, 3 ] }
let $items := ($data/a, $data?b?*, $data/b/*)
return $items ! jvalue()

Expected: 1, 2, 3, 2, 3. Instead, XPTY0004 is raised for the plain integers returned by $data?b?*. Users have to write:

$items ! (if (. instance of jnode()) then jvalue() else .)

I think parameter type should be item()?: if $input is not a JNode, it is returned unchanged. The XPTY0004 error for the context value can then be dropped, as only the absent case remains.

fn:jkey could stay as it is: a plain value has no key, and returning the empty sequence would hide errors.

Pull request #3063 created #created-3063

11 Nov at 09:45:24 GMT
3062 fn:resolve-uri: non-hierarchical bases

Closes #3062

Issue #3062 created #created-3062

11 Nov at 09:40:55 GMT
`fn:resolve-uri`: non-hierarchical base URIs

According to the rules of fn:resolve-uri, a non-hierarchical base URI is an example of a base that is “not a suitable IRI to use as input to the chosen resolution algorithm”.

However, RFC 3986 5.2 resolves against any absolute base, though. In particular, fragment-only and query-only references are used in practice, for example in JSON Schema, which resolves $ref values such as #/$defs/bar against $id values such as urn:uuid:….

resolve-uri('#s', 'urn:uuid:1234')  (: FORG0002; RFC 3986: urn:uuid:1234#s :)
resolve-uri('?y', 'urn:doi:2345')   (: FORG0002; RFC 3986: urn:doi:2345?y :)

#280 already relaxed the rules for bases with fragment identifiers. I’d suggest going a step further, by dropping the non-hierarchical example from the FORG0002 rule and apply RFC 3986 as written.

Pull request #3061 created #created-3061

11 Nov at 09:23:17 GMT
3049 err:map becomes a labeled record

Fix #3049

QT4 CG meeting 188 draft minutes #minutes-11-10

11 Nov at 08:30:00 GMT

Draft minutes published.

Pull request #3060 created #created-3060

11 Nov at 08:13:54 GMT
3059 fn:char: FOCH0001 instead of FOCH0005

Closes #3059

Issue #3059 created #created-3059

11 Nov at 08:10:16 GMT
`fn:codepoints-to-string`, `fn:char`: use same error code

codepoints-to-string(65535) and char(65535) raise different error codes, which complicates internal rewrites. I think we should always raise the pre-4.0 FOCH0001.

Pull request #3058 created #created-3058

11 Nov at 07:42:20 GMT
3057 Casting to records: use target %fixed values

…could be treated as editorial, as we have added extensible records just yesterday.

Closes #3057

See 6385 more statuses in yearly archives.