我正在尝试在 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>