Pursuant to this same question about sending Element variables, is there a
way to verify from XQuery or MarkLogic that the variable I've created is in
fact an Element and not a String? From the feedback above it's unclear if I
can trust xdmp:type or getValueType.

Thanks,
Dave

On Sun, Jul 31, 2016 at 1:59 PM, Dave Liepmann <[email protected]>
wrote:

> On Sat, Jul 30, 2016 at 3:35 PM, David Lee <[email protected]>
> wrote:
>
>> You need to use ValueFactory.newElement to create Elements, it will not
>> be done for you in this method.
>>
>>
> Right, that was what I expected too! :) But when I pass a pre-created
> Element (such as the result of your above code) to setNewVariable, I get
> an IllegalArgumentException: "String, org.w3c.dom.Element or InputStream
> value required to construct element()". That message makes me suspect it is
> passing the buck to newElement
> <https://docs.marklogic.com/javadoc/xcc/com/marklogic/xcc/ValueFactory.html#newElement(java.lang.Object)>
> .
>
> In contrast, setNewVariable accepts your `is` InputString variable, giving
> me the same results as when I passed a String, including the
> getValueType report that the variable is of type "element()". Using
> setVariable also gives me identical results in XQuery and getValueType.
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to