I have taken several steps backward to get any xupdate command to work in 
Xindice 1.0.

I am using the phone exampe

<person>
   <fname>John</fname>
   <lname>Smith</lname>
   <phone type="work">563-456-7890</phone>
   <phone type="home">534-567-8901</phone>
   <email type="home">[EMAIL PROTECTED]</email>
   <email type="work">[EMAIL PROTECTED]</email>
   <address type="home">34 S. Colon St.</address>
   <address type="work">9967 W. Shrimp Ave.</address>
</person>

I added this to my collection.

I used the EXACT example on the Xindice site site. line for line.

        Collection col = null;
        try {
           String driver = "org.apache.xindice.client.xmldb.DatabaseImpl";
           Class c = Class.forName(driver);

           Database database = (Database) c.newInstance();
           DatabaseManager.registerDatabase(database);
           col =
              DatabaseManager.getCollection("xmldb:xindice:///db/addresses");

           String xupdate = "<xu:modifications version=\"1.0\"" +
              "      xmlns:xu=\"http://www.xmldb.org/xupdate\";>" +
              "   <xu:remove select=\"/person/[EMAIL PROTECTED] = 'home']\"/>" +
              "   <xu:update select=\"/person/[EMAIL PROTECTED] = 'work']\">" +
              "       480-300-3003" +
              "   </xu:update>" +
              "</xu:modifications>";

           XUpdateQueryService service =
              (XUpdateQueryService) col.getService("XUpdateQueryService", 
"1.0");
           service.update(xupdate);
        }
        catch (XMLDBException e) {
           System.err.println("XML:DB Exception occured " + e.errorCode + " " +
              e.getMessage());
        }
        finally {
           if (col != null) {
              col.close();
           }
        }

And I get the below...

org.apache.xindice.client.corba.db.APIException: 
IDL:org/apache/xindice/client/corba/db/APIException:1.0
        at 
org.apache.xindice.client.corba.db.APIExceptionHelper.read(APIExceptionHelper.java:112)
        at 
org.apache.xindice.client.corba.db._CollectionStub.queryCollection(_CollectionStub.java:833)
        at 
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.updateResult(XUpdateQueryServiceImpl.java:165)
        at 
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.update(XUpdateQueryServiceImpl.java:185)
        at src.explorer.test.QueryTest.exampleTest(QueryTest.java:82)
        at src.explorer.test.QueryTest.main(QueryTest.java:32)
XML:DB Exception occured 1 Query Compilation Error

Clues?

Reply via email to