0

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: mjyepes@unav.es.",",")
    ," ")
    ,".")
    
    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: mjyepes@unav.es.",concat('^.*',@functx:escape-for-regex($delim)),'')
     } ;
    </val>
  • Is this for a TDE? Can you provide a more complete example demonstrating how you are executing or validating the TDE i.e. https://docs.marklogic.com/tde:validate? – Mads Hansen May 02 '21 at 13:11

1 Answers1

1

Get rid of the "@" signs before all the function names.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164