OSB - XQuery - line 7, col 2: {err}FORG0005: expected exactly 1 item, got 0
877991Aug 1 2011 — edited Aug 4 2011Hi,
I am trying to execute the below sample XQuery. Eclipse designer does not show any error. However on executing the XQuery, I get the following error "+Error executing the XQuery transformation: line 7, column 2: {err}FORG0005: expected exactly one item, got 0 items+". Appreciate your help.
xquery version "1.0" encoding "UTF-8";
declare namespace xf = "http://tempuri.org/OSB%20Project%201/Ids/";
declare function xf:Ids()
as element() {*
* let $abc := <catalog><product dept="MEN"><number>784</number><name language="en">Cotton Dress Shirt</name><colorChoices>white gray</colorChoices><desc>Our favorite shirt!</desc></product></catalog>*
* for $product in $abc/catalog/product*
* let $name := $product/name*
* where $product/@dept = "ACC"*
* order by $name*
* return $name*
*};*
xf:Ids()