0

我正在尝试在 marklogic 的模板中提取文本,但出现以下错误:

[1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected Lpar_, expecting Rpar_

我用于 functx 声明。

<path-namespaces>
<path-namespace>
<prefix>functx</prefix>
<namespace-uri>http://www.functx.com</namespace-uri>
</path-namespace>
</path-namespaces>

这是我的 val 元素,它出现在对象元素中

<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>
4

1 回答 1

1

去掉所有函数名称前的“@”符号。

于 2021-05-02T07:57:24.063 回答