[MarkLogic Dev General] Unexpected token syntax error, unexpected Vbar_

Kapoor, Pragya PKapoor1 at innodata.com
Wed Jan 6 00:57:39 PST 2016


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."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20160106/d1bb1fde/attachment.html 


More information about the General mailing list