Hi Charlie,

I think you are missing the closing tag for <xu:element>. Add it right before:
"buf.append("</xu:update>")" and it should work.


From: Charlie <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: XUpdate query
Date: Sat, 18 Jun 2005 12:47:34 +0100

Hi,

I am trying to play around with Xupdate. However have come across abit of a stumbleing block. I have a methdod as follows:
public void tryAppend() throws Exception{
Collection col = super.getXMLCollection("xmldb:xindice://localhost:8080/db/test"); XUpdateQueryService xUpSer = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
       StringBuffer buf = new StringBuffer();
       buf.append("<xu:modifications version=\"1.0\"" +
               " xmlns:xu=\"http://www.xmldb.org/xupdate\";>");
       buf.append("<xu:update select=\"/coeProject\">");
       buf.append("<xu:element name=\"project\">" +
               "<xu:attribute name=\"id\">2</xu:attribute>");
       buf.append("</xu:update>");
       buf.append("</xu:modifications>");
       System.out.println("update string: " + buf.toString());
       xUpSer.update(buf.toString());

   }
Where /coeProject is the root element of my document. When i exec this method I am getting: org.xmldb.api.base.XMLDBException: org.apache.xmlrpc.XmlRpcException: Error Compiling XUpdate Query

I am using tomcat 5.0x and FC3

Thanks for any help you can give.
Charlie

_________________________________________________________________
Moda para esta temporada. Ponte al día de todas las tendencias. http://www.msn.es/Mujer/moda/default.asp

Reply via email to