xquery - Marklogic Xquery fn :data(<type>hello world</type>) giving Invalid lexical value error

标签 xquery marklogic

我的 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("&#13;&#10;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/

相关文章:

intellij-idea - IntelliJ Idea 中的 Xquery 支持?

xml - XQuery 如果在输入处理期间发生错误,则出现意外情况

group-by - 如何在 Marklogic 中使用 Group By?

string - 基于xpath值的xslt中的动态字符串形成

sql - 在 SQL Server 中使用 XML 类型字段获取值

sql-server - SQL Server 2005 Xquery 命名空间

list - XQuery 从列表中获取随机文本

node.js - Marklogic Node.js API : How to get the document where an embedded triple lives?

marklogic - 如何安全地解耦 MarkLogic 集群?