English 中文(简体)
Marklogic Xquery fn:data(<type>hello world</type>) giving Invalid lexical value error
原标题:

My Marklogic XQuery fn:data(<type>hello world</type>) gives me Invalid lexical value error

This is the stack trace:

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: 

And when I use fn:data(<p>hello world</p>) it is giving me expected answer (hello world).

Any help on this error would be appreciated.

Thanks.

最佳回答

Finally figured what was wrong. Had an xsd which was defining element type as xs:integer thats why this error was coming. Removed that xsd and now everything is working fine :)

问题回答

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.





相关问题
XQuery, fn:id and BD eXist

Does "fn:id" function return IDREFS when it is used in a FLOWER xquery with eXists database? I can t get any example... :(

SQL Server xQuery return NULL instead of empty

So in this example I m trying to return a NULL instead of an empty nvarchar for element2 and element3. I can t seem to find an answer to this anywhere, or if it s even possible. I know I can check ....

Does QExo XQuery string-join work?

When I run string-join, I get a weird output like this: <clinic> <Name>Olive Street Pediatrics</Name> <Address>1500 Olive St, Los Angeles, CA 90015</Address> <...

XQuery: how to properly append , in for loop

So I have xml data like this: <PhoneNumber>213-512-7457</PhoneNumber> <PhoneNumber>213-512-7465</PhoneNumber> and with this XQuery: <PhoneNumberList> { for $...

Filter SQL queries on the XML column using XPath/XQuery

I m having a table with one XML column. I d like to filter out the rows where a specific attribute in the XML match a string, essentially doing a WHERE or HAVING. The table looks something like this ...

热门标签