From: mzha <min...@de...> - 2008-04-14 09:19:15
|
Hi all, my current version of eXist is 1.2.0. I am trying to insert a new element into a existing document. My XQuery works well with the Sandbox but it does not work in my code, which works with Rest interface. Hier is a snapshot of my code. xquery="<query xmlns='http://exist.sourceforge.net/NS/exist'> <text>declare default element namespace 'http://www.mynamespace'; update insert <businessLog xmlns='http://www.mynamespace'> <actorAccessRecord> <read id='1' version='1'> <timeStamp>2008-04-14T10:34:15</timeStamp> </read> <write id='1' version='12'> <timeStamp>2008-04-14T10:34:15</timeStamp> </write> </actorAccessRecord> </businessLog> into observationContext[observationContextKey/statisticsID='0001' and observationContextKey/referencePeriod='020060000' and observationContextKey/observationUnitID='01001003' and observationContextKey/collectingUnitID='06']/messageResource[@id='222222222' and @version='1']</text> </query>"; PostMethod method = new PostMethod(this.hostURL + "/" + collection); httpMethod.setRequestHeader("Authorization", "Basic " + this.credentials); httpMethod.setRequestEntity(new StringRequestEntity(xquery, "text/xml", "UTF-8")); statusCode = httpMethod.execute(new HttpState(), httpConnection); I've got '202' as HTTP status code back and in exist.log file it points to DEBUG (XQuery.java [compile]:129) - org.exist.xquery.XPathException: err:XPST0003 in line 1, column 96: unexpected token: observationContext When I use XUpdate instead, I've got the same status code back and in exist.log file and I didn't find any error message. I am frustrated. I don't understand why update-insert works well in Sandbox but not in my code; furthermore why other updates variants like update-delete and update-replace works well in my code, but update-insert not. Please help. Thank you in advance. ming -- View this message in context: http://www.nabble.com/update-insert-problem-with-rest-interface-tp16674407p16674407.html Sent from the exist-open mailing list archive at Nabble.com. |