I am trying to extract text within a template in marklogic , but I got an error of :
[1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Lpar_, expecting Rpar_
I use for functx declaration .
<path-namespaces>
<path-namespace>
<prefix>functx</prefix>
<namespace-uri>http://www.functx.com</namespace-uri>
</path-namespace>
</path-namespaces>
Here is my val element where it is occur in object element
<val>
substring-before(@functx:substring-after-last
(@functx:substring-after-last("Clínica Universidad de Navarra, Pamplona, Navarra, España. Electronic address: [email protected].",",")
," ")
,".")
declare function @functx:escape-for-regex
( $arg as xs:string? ) as xs:string {
replace($arg,
'(\.|\[|\]|\\|\||\-|\^|\$|\?|\*|\+|\{|\}|\(|\))','\\$1')
} ;
declare function @functx:substring-after-last
( $arg as xs:string? ,
$delim as xs:string ) as xs:string {
replace ("Clínica Universidad de Navarra, Pamplona, Navarra, España. Electronic address: [email protected].",concat('^.*',@functx:escape-for-regex($delim)),'')
} ;
</val>
Get rid of the "@" signs before all the function names.