Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/328.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java eXist db xPath函数XQueryService:lowercase()_Java_Xpath_Xquery_Exist Db - Fatal编程技术网

Java eXist db xPath函数XQueryService:lowercase()

Java eXist db xPath函数XQueryService:lowercase(),java,xpath,xquery,exist-db,Java,Xpath,Xquery,Exist Db,我是eXist和xPath新手。我正在尝试使用小写函数。这是我的java代码 CompiledExpression compiled = xQueryService.compile("/realestatedata/agents/author/name[lower_case(text())='" + authorName.toLowerCase() + "']"); 它给出了以下错误 Caused by: org.exist.xquery.XPathException: exerr:ERROR

我是eXist和xPath新手。我正在尝试使用小写函数。这是我的java代码

CompiledExpression compiled = xQueryService.compile("/realestatedata/agents/author/name[lower_case(text())='" + authorName.toLowerCase() + "']");
它给出了以下错误

Caused by: org.exist.xquery.XPathException: exerr:ERROR err:XPST0017 Function lower_case()  is not defined in module namespace: http://www.w3.org/2005/xpath-functions [at line 1, column 36] [at line 1, column 36]
我在文档中读到必须包含模块,因此我将以下内容放在conf.xml中的xquery->builtin modules下

<module uri="http://www.w3.org/2005/xpath-functions"  class="org.exist.xquery.functions.fn.FnModule" />

重新启动exist后,我收到相同的错误。我还尝试将XQueryService从
org.xmldb.api.modules.XQueryService
更改为
org.xmldb.api.modules.XMLResource

您拼错了函数名

“/realestatedata/agents/author/name[小写(text())=””


那么,
“/realestatedata/agents/author/name[小写(text())=”…
,即用破折号“-”而不是下划线“\ux”呢?@paul-t是对的。您拼错了函数名。而且需要向conf.xml中添加任何内容才能使XPath函数模块正常工作;这些都是现成的。此外,随着数据库的增长,您可以通过向name元素添加索引来提高这些查询的性能。范围索引或全文索引将是合适的。请参阅.Than谢谢。这是一个打字错误。我的收藏只有几gb大小,所以我要看看索引。