Can someone tell me the exact difference between node()
and element()
types in XQuery? The documentation states that element()
is an eleme
node()
is an element, attribute, processing instruction, text node, etc.
But data()
converts the result to a string, which isn't any of those; it's a primitive type.
You might want to try item()
, which should match either.
See 2.5.4.2 Matching an ItemType and an Item in the W3C XQuery spec.
Although it's not shown in your example code, I assume you are actually returning a value (like the $value
you are working with) from the local:myFunction
.