2013-08-20 16 views
0

我是eXist和xPath的新手。我正在嘗試使用小寫函數。這是我的java代碼。eXist-db xPath函數XQueryService:小寫()

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] 

我該模塊具有被包括在文檔中讀取,所以我把下xquery->內置模塊在conf.xml中以下。

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

在重新啓動後出現同樣的錯誤。我也試着從org.xmldb.api.modules.XQueryService改變XQueryService到org.xmldb.api.modules.XMLResource

+1

''/ realestatedata/agents/author/name [小寫(text())='「...',即短劃線」 - 「而不是下劃線」_「)? –

+1

@ paul-t是對的。您拼錯了函數名稱。並且需要向conf.xml添加任何內容以使XPath函數模塊可以正常工作;這些將會開箱即用。另外,隨着數據庫的增長,您可以通過向名稱元素添加索引來提高這些查詢的性能。範圍索引或全文索引是適當的。請參閱http://exist-db.org/exist/apps/doc/indexing.xml。 – joewiz

+0

謝謝。這是一個錯字。我的收藏將會是幾GB的大小,所以我會看看索引。 – waqas

回答

0

拼錯函數名

「/ realestatedata /代理/作家/名稱[小寫(文字())='」