I'm trying to bind together fields from 2 separate documents.
Using a plain binding works, however fails when trying to use an index-scan.
The following binding works:
let $dataset := doc("Customer.xml")
return
<results>{
for $element in $dataset/Customers/Customer
let $name := $element/Name/text()
let $typeId := $element/CustomerTypeId/text()
let $type :=
doc("CustomerType.xml")/CustomerTypes/CustomerType[Id=$typeId]/Name/text()
return(<r><c>{$name}</c><c>{$typeId}</c><c>{$type}</c></r>)
}</results>
The following index-scan binding fails with ERROR XPTY0004:
let $dataset := doc("Customer.xml")
return
<results>{
for $element in $dataset/Customers/Customer
let $name := $element/Name/text()
let $typeId := $element/CustomerTypeId/text()
let $type := index-scan("CustomerTypeIndex", $typeId, "EQ")/Name/text()
return(<r><c>{$name}</c><c>{$typeId}</c><c>{$type}</c></r>)
}</results>
Am I missing something? Can an index-scan be used when trying to bind 2
documents together?
Thanks,
Malcolm
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts.
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Sedna-discussion mailing list
Sedna-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sedna-discussion