Open fgeorges opened 8 years ago
An example query that fails to parse is:
xquery version "1.0-ml";
module namespace bin = "http://expath.org/ns/ml/console/binary";
declare namespace xdmp = "http://marklogic.com/xdmp";
(:~
: Return true if the parameter is a binary node.
:)
declare function bin:is-binary($arg as node())
as xs:boolean
{
$arg instance of binary()
};
(:~
: Return true if the parameter is a JSON node.
:
: http://markmail.org/message/mypneadypxmj4xly
:)
declare function bin:is-json($arg as node())
as xs:boolean
{
typeswitch ( $arg )
case object-node() return fn:true()
case array-node() return fn:true()
case number-node() return fn:true()
case boolean-node() return fn:true()
case null-node() return fn:true()
default return fn:false()
};
The parser returns:
<ERROR b="522" e="523" s="266">lexical analysis failed
while expecting '(:'
after successfully scanning 1 characters at line 25, column 23
...() return fn:true()
case ...</ERROR>
The grammar is not up-to-date with the latest MarkLogic extensions to the language. For instance,
ItemTest
such asobject-node()
.