fn-generate-id function parameters cause errors

Bug #1090521 reported by Juan Zacarias
This bug report is a duplicate of:  Bug #1090514: fn-generate-id failures. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Critical
Sorin Marian Nasoi

Bug Description

Error caused by empty-sequence in parameter

Failing tests:
generate-id-017, generate-id-015

Query:
import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; declare namespace op = 'http://www.zorba-xquery.com/options/features'; declare namespace f = 'http://www.zorba-xquery.com/features'; declare option op:enable 'f:hof'; declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { switch($entity) case 'module' return switch($namespace) case 'http://www.w3.org/QT3/copy' return unparsed-text('file:///home/juanza/FOTS/2011/QT3-test-suite/fn/id/copy.xq') default return () default return () }; variable $queryID := xqxq:prepare-main-module(' xquery version "3.0"; import module namespace copy="http://www.w3.org/QT3/copy"; let $att := (//@*)[1] return generate-id(copy:copy($att)) eq generate-id($att) ' , resolver:url-resolver#2, ()); variable $contextItem := doc("file:///home/juanza/FOTS/2011/QT3-test-suite/docs/works-mod.xml"); xqxq:bind-context-item($queryID, $contextItem); xqxq:evaluate($queryID)

Error:
Expected result: . Found error XPTY0004 - The query (2d559bd2-cfe3-4338-bba8-732bf3a206f6) evaluated using xqxq:evaluate raised an error at line 12 column 1: The query (fe7536cb-df4f-4aaa-9fe7-42a85b4aa929) evaluated using xqxq:evaluate raised an error at line 6 column 13: sequence of more than one item can not be promoted to parameter type node(*, xs:anyType*)? of function generate-id()

Error caused by sequence in parameter

Failing test:
generate-id-018

Query:
import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; variable $queryID := xqxq:prepare-main-module(' xquery version "3.0"; declare namespace ma = "http://www.example.com/AuctionWatch"; declare namespace xlink = "http://www.w3.org/1999/xlink"; declare namespace anyzone = "http://www.example.com/auctioneers#anyzone"; declare namespace eachbay = "http://www.example.com/auctioneers#eachbay"; declare namespace yabadoo = "http://www.example.com/auctioneers#yabadoo"; generate-id(//*) eq generate-id(/*)' ); variable $contextItem := doc("file:///home/juanza/FOTS/2011/QT3-test-suite/docs/auction.xml"); xqxq:bind-context-item($queryID, $contextItem); xqxq:evaluate($queryID)

Error:
Expected result: . Found error XPTY0004 - The query (2d559bd2-cfe3-4338-bba8-732bf3a206f6) evaluated using xqxq:evaluate raised an error at line 12 column 1: The query (fe7536cb-df4f-4aaa-9fe7-42a85b4aa929) evaluated using xqxq:evaluate raised an error at line 6 column 13: sequence of more than one item can not be promoted to parameter type node(*, xs:anyType*)? of function generate-id()

Tags: fots
Revision history for this message
Dana Florescu (dflorescu) wrote :

Might be a legal answer. Can you please check ?

Changed in zorba:
importance: Undecided → Critical
assignee: nobody → Sorin Marian Nasoi (sorin.marian.nasoi)
milestone: none → 2.9
Revision history for this message
Sorin Marian Nasoi (sorin.marian.nasoi) wrote :

Marking as duplicate.

summary: - FOTS: fn-generate-id function parameters cause errors
+ fn-generate-id function parameters cause errors
tags: added: fots
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.