I need to add a document to a collection from a Java application.  I'm trying to
do this using the XUpdate API.  Is this the best way?

Here is the xupdate string I'm passing to my XUpdateQueryService update method.

<xu:modifications version="1.0" xmlns:xu="http://www.xmldb.org/xupdate";>
  <xu:insert-after select="/services/service[1]">
    <xu:element name="service">
      <xu:attribute name="name">foo</xu:attribute>
      <description>bar</description>
    </xu:element>
  </xu:insert-after>
</xu:modifications>

It fails with the following stack trace.

org.xmldb.api.base.XMLDBException: org.apache.xmlrpc.XmlRpcException: Error
Compiling XPath Expression: null
        at
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(CollectionImpl.java:119)
        at
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(CollectionImpl.java:515)
        at
org.apache.xindice.client.xmldb.XindiceCollection.query(XindiceCollection.java:259)
        at
org.apache.xindice.client.xmldb.services.QueryService.query(QueryService.java:90)
        at
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.update(XUpdateQueryServiceImpl.java:81)

Any suggestions would be greatly appreciated!

--
R. Mark Volkmann
Partner, Object Computing, Inc.

Reply via email to