[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

Unexpected token syntax error, unexpected DeclareFunction_

Michael Blakeley michael.blakeley at marklogic.com
Thu Oct 1 12:50:41 PDT 2009


  Unexpected token syntax error
Anil,

Since this is a question specific to MarkLogic Server, I recommend 
joining the mailing list at 
http://developer.marklogic.com/discuss/subscribe.xqy?list=general

You can also search the list: for example, try 
http://marklogic.markmail.org/search/?q=XDMP-UNEXPECTED+1.0-ml (the 
second hit is relevant: http://markmail.org/thread/2nuwbppxeemsrpjs).

The problem you're running into is that the shakespeare demo code is 
somewhat old, and was written in a custom dialect that is not quite 
XQuery 1.0. To use this older demo code, set the "default xquery 
version" for your app server (the one configured to listen on port 8010) 
to "0.9-ml".

-- Mike

On 2009-09-30 18:13, Anil Shekhar wrote:
> Dear Experts,
>
> I am new to XQuery and I need your help.  I am getting the following error when accessed ...
>
> http://127.0.0.1:8010/shakespeare.xqy
> 500 Internal Server Error
>
> XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected DeclareFunction_
>
> in /shakespeare.xqy, on line 8 [1.0-ml]
>
> Line 8 is where I have defined the function.
>
> Thanks
> Anil
>
>
>
> <html>
>      <head>
>          <title>Shakespeare ...</title>
>      </head>
>      <body>
>          <p>
>          {
>              declare function local:handle-doc(
>                  $doc      as document-node(),
>                  $speeches as element(SPEECH)+
>              )
>              {
>                  <h1>{ document-uri($doc) }</h1>,
>                  for $speech  in $speeches
>                  let $speaker := $speech/SPEAKER
>                  let $lines   := $speech/LINE
>                  return (
>                      <h3>{ $speaker/text() }</h3>,
>                      <p>{ $lines/text() }</p>
>                  )
>              };
>
>              for $d in doc("file:///C:/Users/ashekhar/Desktop/Mark Logic/Shakespeare/*.xml")
>                  order by $d ascending
>                  return local:handle-doc($d, $d//SPEECH)
>          }
>          </p>
>      </body>
> </html>)
>
>
>
>
>
>
>
> ________________________________
> Insert movie times and more without leaving Hotmail®. See how.<http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009>
>





PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.