You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by belinda_browne <be...@telstra.com> on 2003/01/30 02:44:20 UTC

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/project[@id='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/project[@id=\'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