2

我的 Marklogic XQuery fn:data(<type>hello world</type>)给了我Invalid lexical value 错误

这是堆栈跟踪:

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>)它时,它会给我预期的答案(你好世界)。

对此错误的任何帮助将不胜感激。

谢谢。

4

2 回答 2

2

终于明白哪里不对劲了。有一个 xsd 将元素定义typexs:integer出现此错误的原因。删除了那个 xsd,现在一切正常:)

于 2011-08-24T09:14:11.313 回答
2

Glad you figured it out. It looks like the extra schema was targeting the empty namespace?

Here's a tip: avoid using a schema unless it also specifies a namespace. That makes it much easier to keep your schemas organized.

于 2011-08-24T14:19:44.773 回答