[MarkLogic Dev General] Using a validate statement inside a FLWOR expression

Mary Holstege mary.holstege at marklogic.com
Wed Aug 11 13:34:56 PDT 2010

On Wed, 11 Aug 2010 12:57:36 -0700, Stewart Shelline  
<ShellineSE at ldschurch.org> wrote:

> Should I be able to do the following?
> for $doc in doc()//some-root-element
> let $try := try { validate strict { $doc } } catch ( $e ) { $e }
> return $try
> The offending line is the second one, and I suspect it is the validate  
> statement. But the error message is:
> XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error,  
> unexpected ElementContentChars_
> Not sure how to read it, but it behaves as if a validate statement is  
> not allowed in a FLWOR expression.

That should be perfectly OK.  It looks like some kind of lexer bug.
FWIW your query works OK for me in the latest release.


More information about the General mailing list