xqxq: add new bind-variable signature
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
In Progress
|
High
|
Juan Zacarias |
Bug Description
I would need the following signature added to XQXQ:
declare %an:sequential function xqxq:bind-variable(
$query-key as xs:anyURI,
$var as xs:QName,
$value as xs:string*) as empty-sequence() external ;
such that the XQXQ can cast to the correct type internally.
details about the issues I have:
- one creates a XQUERY (please see below) that raises an error because of the external variable binding:
xqxq:bind-variable( $queryID, xs:QName("ext"), "5");
should be
xqxq:bind-variable( $queryID, xs:QName("ext"), xs:integer(5));
XQUERY:
import module namespace xqxq = 'http://
variable $queryID := xqxq:prepare-
declare variable $ext as xs:integer external := 0; <a>
xqxq:bind-variable( $queryID, xs:QName("ext"), "5");
xqxq:evaluate(
Related branches
- Matthias Brantner: Needs Fixing
- Sorin Marian Nasoi: Approve
- Chris Hillery: Approve
-
Diff: 367 lines (+202/-38)11 files modifiedinclude/zorba/static_context.h (+12/-0)
modules/xqxq/xqxq.xq (+18/-3)
modules/xqxq/xqxq.xq.src/xqxq.cpp (+47/-2)
modules/xqxq/xqxq.xq.src/xqxq.h (+56/-32)
src/api/dynamiccontextimpl.cpp (+0/-1)
src/api/staticcontextimpl.cpp (+46/-0)
src/api/staticcontextimpl.h (+3/-0)
test/rbkt/ExpQueryResults/zorba/xqxq/variable-type-name.xml.res (+1/-0)
test/rbkt/Queries/zorba/xqxq/variable-type-name.xq (+13/-0)
test/rbkt/Queries/zorba/xqxq/variable-type-name2.spec (+1/-0)
test/rbkt/Queries/zorba/xqxq/variable-type-name2.xq (+5/-0)
tags: | added: fots |
tags: | added: new-functionality-requirement |
tags: | added: xqxq |
Changed in zorba: | |
importance: | Undecided → Medium |
milestone: | none → 2.8 |
Changed in zorba: | |
importance: | Medium → High |
Changed in zorba: | |
milestone: | 2.8 → 2.9 |
Changed in zorba: | |
status: | New → In Progress |
tags: |
added: fots-driver removed: fots |
Changed in zorba: | |
milestone: | 2.9 → 3.0 |
description: | updated |
Sorin I don't understand why you need the new signature with xs:string* since the current signatures should cover strings too, since the current signature is
declare %an:sequential function xqxq:bind-variable(
$query-key as xs:anyURI,
$var as xs:QName,
$value as item()*) as empty-sequence() external ;
And sorry don't understand the problem, The query you attached is breaking because you are trying to attach a xs:string to a xs:integer variable.
declare variable $ext as xs:integer external := 0;
^
In my eyes this is a correct error, but I don't know much xquery, is zorba supposed to do an automatic cast of the string to an integer?