我的 Marklogic XQuery fn:data(<type>hello world</type>)
给我无效的词汇值错误
这是堆栈跟踪:
query evaluated in Documents at file::Docs/ as 1.0-ml (cq v4.1-1-EA)
[1.0-ml] XDMP-LEXVAL: xs:integer("hello world") -- Invalid lexical value "hello world"
Stack trace:
line 2:
1:
2: fn:data(<type>hello world</type>)
xdmp:eval(" fn:data(<type>hello world</type>)", (), <options xmlns="xdmp:eval"><isolation>different-transaction</isolation></options>)
in /cq/eval.xqy line 111:
当我使用fn:data(<p>hello world</p>)
时它给了我预期的答案( Hello World )。
任何有关此错误的帮助将不胜感激。
谢谢。
最佳答案
终于知道问题出在哪里了。
有一个 xsd 将元素 type
定义为 xs:integer
这就是出现此错误的原因。删除了 xsd,现在一切正常:)
关于xquery - Marklogic Xquery fn :data(<type>hello world</type>) giving Invalid lexical value error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7171779/