Hi David,

You're correct, this is a change to the XQuery parser in 4.2-2 to make 
it more conformant to the XQuery specification.

John

On 22/02/11 17:28, David Sewell wrote:
> We have not changed the location of our Modules DB (on the filesystem in
> our case). Possibly something else in our environment changed, but I was
> assuming it was the upgrade to 4.2-2.
>
> On Tue, 22 Feb 2011, [email protected] wrote:
>
>>
>> I've noticed that an empty function seems to work when the Modules DB
>> is off the filesystem, but throws a syntax error when the Modules DB
>> is an actual DB.
>>
>>> Date: Tue, 22 Feb 2011 10:11:05 -0500
>>> From: [email protected]
>>> To: [email protected]
>>> Subject: [MarkLogic Dev General] ML 4.2-2 throws error on empty function
>>>
>>> Just noticed a server error when running a script that had been working
>>> fine. It turns out that until this release, the following code worked
>>> fine, returning the ML version number:
>>>
>>> xquery version "1.0-ml";
>>> declare function local:handle-ref() as item()* { };
>>> xdmp:version()
>>>
>>> With 4.2-2, it throws a syntax error. It must be rewritten as
>>>
>>> xquery version "1.0-ml";
>>> declare function local:handle-ref() as item()* { () };
>>> xdmp:version()
>>>
>>> with the explicit null item.
>>>
>>> Obviously this is a tightening to bring behavior in line with the XQuery
>>> language spec. We're probably not the only MarkLogic shop in the world
>>> to have an unfinished function declaration like the above lying around
>>> somewhere in their code, so I thought I would mention it as something to
>>> watch out for.
>>>
>>> David

-- 
John Snelson, Senior Engineer                  http://twitter.com/jpcs
MarkLogic Corporation                         http://www.marklogic.com
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to