Belinda,

I copied your example exactly and ran it from my IDE (WSAD). It worked fine.
At what point are you getting the database error messages? Are you running
the example from an IDE (like JBuilder, WSAD, etc.)? This is how I formatted
the dates:

SimpleDateFormat formatter = new SimpleDateFormat ("yyyy.MM.dd G 'at'
hh:mm:ss a zzz");
Date currentTime_1 = new Date();
String dateString = formatter.format(currentTime_1);

Bob Corcoran

> -----Original Message-----
> From: belinda_browne [SMTP:[EMAIL PROTECTED]
> Sent: Wednesday, January 29, 2003 8:44 PM
> To:   [email protected]
> Subject:      XUpdate still
> 
> Hi Everyone,
> 
> I am still trying with XUpdate with Xindice 1.1b on a Windows NT system 
> running Tomcat 4.1, and when i execute the following XUpdate statement:
> 
> <xu:modifications version="1.0"  xu="http://www.xmldb.org/xupdate";>  
> <xu:insert-before select="//projects/[EMAIL PROTECTED]'4']">  
> <xu:element name="project">
>   <xu:attribute name="id">1</xu:attribute>  
>   <name>Belinda</name>
>   <manager>Steve</manager>
>   <startDate>30-01-2003</startDate>
>   <endDate>30-01-2003</endDate>  
> </xu:element>
> </xu:insert-before>
> </xu:modifications>
> 
> I get the following error:
> 
> org.xmldb.api.base.XMLDBException: Query error
>         at org.apache.xindice.core.FaultCodes.createXMLDBException
> (FaultCodes.java:536)
>         at org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query
> (CollectionImpl.java:562)
>         at org.apache.xindice.client.xmldb.XindiceCollection.query
> (XindiceCollection.java:285)
>         at org.apache.xindice.client.xmldb.services.QueryService.query
> (QueryService.java:129)
>         at 
> org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.upda
> te(XUpdateQueryServiceImpl.java:124)
> 
> I tested the query, and that works fine, both in the source code of my 
> project and at a DOS prompt.  Here is the java code in which this is 
> called:
> 
> String xupdate = 
>                "<xu:modifications version=\"1.0\" " +
>                "  xmlns:xu=\"http://www.xmldb.org/xupdate\";>" +
>                "  <xu:insert-before select=\"//projects/[EMAIL PROTECTED]'4
> \']\">" +
>                "  <xu:element name=\"project\">" +
>                "  <xu:attribute name=\"id\">" + projectID 
> + "</xu:attribute>" +
>                "  <name>" + projectName + "</name>" +
>                "  <manager>" + projectManager + "</manager>" +
>                "  <startDate>" + aSimpleDateFormat.format(startDate) 
> + "</startDate>" +
>                "  <endDate>" + aSimpleDateFormat.format(endDate) 
> + "</endDate>" +
>                "  </xu:element>" +
>                "  </xu:insert-before>" +
>                "</xu:modifications>";
> 
>          System.out.println(xupdate);
> 
>          XUpdateQueryService service = (XUpdateQueryService) 
> col.getService("XUpdateQueryService", "1.0");
> 
>          service.update(xupdate);
> 
> Also, here is the XML file that I am using
> <?xml version="1.0"?>
> <projects>
>   <project id="4">
>     <name>Steve</name>
>     <manager>Belinda</manager>
>     <startDate>11-02-03</startDate>
>     <endDate>13-02-03</endDate>
>   </project>
> </projects>
> 
> I have tried many different things that has been mentioned here to help 
> XUpdate, and none of these have worked.
> 
> I am trying to get something working before the new release of Xindice 
> 1.1, when this comes out.
> 
> Any help would be much appreciated,
> 
> Thanks
> Belinda
> 
>  
> 

------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please 
immediately notify the sender by e-mail at the address shown.  This e-mail 
transmission may contain confidential information.  This information is 
intended only for the use of the individual(s) or entity to whom it is intended 
even if addressed incorrectly.  Please delete it from your files if you are not 
the intended recipient.  Thank you for your compliance. Copyright (c) 2003 CIGNA

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply via email to