Hi Pragya, It surprises me that this doesn’t error on Windows. The line that you marked ends with ||, but from the looks of it, there is no following string operand that I would expect. Try removing it..
Cheers, Geert From: <[email protected]<mailto:[email protected]>> on behalf of "Kapoor, Pragya" <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Wednesday, January 6, 2016 at 9:57 AM To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] Unexpected token syntax error, unexpected Vbar_ Hi, Below code is working fine on windows server, but on linux server its giving the error. XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Vbar_ let $sort as xs:string := string-join( for $output in $outputs let $sortOrder := $output//sort/text() return (if($sortOrder != '') then let $element := let $path:= $output/path let $ns := $path/@ns let $path := fn:tokenize($path,"/") let $elem := fn:concat($ns,":",$path[fn:last()],"[1]") let $elemParent := fn:concat($ns,":",$path[fn:last()-1],"[1]") return fn:concat($elemParent,"/",$elem) return fn:concat("$doc","//", $element," ",$sortOrder) else ()),", ") let $results := 'element report { element columns { for $alias in $aliases return element title {$alias}}, element results { for $docId in $docUris let $doc := fn:doc($docId) let $tempResult := element result { for $output in $outputs let $element := let $path:= $output/path let $elem := fn:tokenize($path,"/")[fn:last()] let $ns := $path/@ns return fn:concat($ns,":",$elem) let $functions := if($output/functions) then fn:data($output/functions) else () let $type := if($output/functions) then fn:data($output/functions/@type) else () let $alias := fn:data($output/columnAlias) let $result := $doc//*[name() = $element]/text() let $result := if($type eq "string") then let $exp := fn:replace($functions,$alias,fn:concat("'",$result,"'")) return xdmp:value($exp) else (:let $exp := (fn:replace($functions,$alias,$result[1])):) (:xdmp:value("$exp"):) $result return if($cartesianFlag eq "false") then element {$alias} {fn:string-join($result,";")} else let $resultCount := fn:count($result) return if($resultCount > 1 ) then for $i in $result return element {$alias} { ($i) } else element {$alias} { ($result) } }' || (if($sort != '') then fn:concat("order by ",$sort) else ()) || (: error on this line:) ' return if($cartesianFlag eq "false") then $tempResult else for $result in $tempResult let $_ := xdmp:set($qt, "") return local:transform-into-result($result) } }' let $results := xdmp:value($results) return results 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
