From: Ariel L. <ar...@ho...> - 2006-04-18 18:49:18
|
Hi thanks Giulio for reply. While writing an answer to your mail, I found the problem. It was an error in my code :). The source of the problem was: File file = new File(fileName); BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); String line; StringBuffer xQueryBuffer = new StringBuffer(); while ((line = reader.readLine()) != null) xQueryBuffer.append(line); reader.close(); I didn't realise that BufferedReader.readLine() removes the CR or LF character at the end of the line, and because of that the string stored in xQueryBuffer didn't contains any CR. I'm sorry for my previous post, Thanks again Ariel -------- Original Message -------- From: "Giulio Valentino" <> To: "Ariel Lira" <ar...@ho...> Sent: Tuesday, April 18, 2006 12:33 PM Subject: Re: [Exist-open] Exception in a simple query with XMLRPC HI, fro debug you exception is important know how you call the xquery and also language you use. also what is the result if you call let $resource := fn:doc("/db/shakespeare/plays/hamlet.xml")/PLAY return $resource Giulio 2006/4/18, Ariel Lira <ar...@ho...>: > > Hi, > In the last 2 days I was figthing with an stupid error when executing an > xquery > An extreme simplification of the query is > > let $resource := > fn:doc("/db/shakespeare/plays/hamlet.xml")/PLAY > return $resource > > > Running this query from XMLRPC throws the next exception (in client-side) > > org.xmldb.api.base.XMLDBException: unexpected token: $ > [at line 1, column 72] [at line 1, column 72] > at > org.exist.xmldb.RemoteXPathQueryService.compile(RemoteXPathQueryService.java:74) > ... 37 more > Caused by: org.exist.xquery.XPathException: unexpected token: $ [at > line > 1, column 72] [at line 1, column 72] > at > org.exist.xmldb.RemoteXPathQueryService.throwXPathException(RemoteXPathQueryService.java:122) > at > org.exist.xmldb.RemoteXPathQueryService.compileAndCheck(RemoteXPathQueryService.java:93) > at > org.exist.xmldb.RemoteXPathQueryService.compile(RemoteXPathQueryService.java:72) > ... 38 more > > But if I run the query from the XQuery Sandbox works OK. > > The source of the problem seems to be the absence of a " " (space > character) > after PLAY and before return. > Could be that the CR character is not replaced by a " "? > > Greetings > Ariel |