I am currently trying to run an XQuery file via Java. Since I am very new to XQuery, not sure how to debug it. When i run the XQ, i get the following error:
XQuery Processor Exception: Exception while calling Saxon: Required item type of first operand of '/' is node(); supplied value has item type xs:anyAtomicType; SystemID: ; Line#: 301; Column#: -1; Cause: Error on line 301 XPTY0019: Required item type of first operand of '/' is node(); supplied value has item type xs:anyAtomicType
Now I want to know how do i pin point the line which is throwing the error?
EDIT:
if ($ipItems) then (
for $item in $ipItems
let $ipAddress := data ($item/nc:IpAddressList/nc:ipAddress)
After numurous attempts i finally pinpointed the root casue to the let command, if i remove it, the code runs fine. Can you please let me know, what i did wrong in there.