Hi,
I am running the below query :
declare namespace MET100 = 'MET100' ;
let $output :=
<user><userId>test1</userId><sessionId>54C76A855C23EF8AC5AFBC59C8D4C40A</sessionId>
<outputs>
<output><columnAlias>CollectionNo</columnAlias>
<functions type="decimal">CollectionNo*3</functions></output>
</outputs></user>
let $functions := fn:data($output//functions)
let $docId := '/docs/BONY_0000049_ISDA-CSA-GB95_6749.xml'
let $type := ($output//functions/@type)
let $doc := fn:doc($docId)
let $alias := ($output//columnAlias/text())
let $ns := "MET100"
let $elem := "CollectionNo"
let $element := fn:concat($ns,":",$elem)
let $result :=($doc//*[name() = $element])/text()
let $result :=
if($type eq 'string') then
xdmp:value(xdmp:quote(fn:replace($functions,$alias,fn:concat("'",$result,"'"))))
else
let $exp := (fn:replace($functions,$alias,$result[1]))
return xdmp:value("$exp")
return $result
actual output is : 0000049*3
Expected Output is : 147
But Since I am using let $exp := (fn:replace($functions,$alias,$result[1]))
which returns a string expression, which is causing problem.
How can I solve this ?
Thanks
Pragya
"This e-mail and any attachments transmitted with it are for the sole use of
the intended recipient(s) and may contain confidential , proprietary or
privileged information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message. Any
unauthorized review, use, disclosure, dissemination, forwarding, printing or
copying of this e-mail or any action taken in reliance on this e-mail is
strictly prohibited and may be unlawful."
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general