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 Thomas Sempf <xi...@chaosmachine.de> on 2002/03/16 18:13:34 UTC
Problems with xupdate
Hello,
i´ve trying to do some xupdate instructions. But every time i get:
XML:DB Exception occured 1
and nothing is updated.
Here is my xupdate code:
try {
String xupdate = "<xu:modifications version=\"1.0\"" +
" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
" <xu:update select=\"/page/header/"+nodeid+ "\">" +node +
"</xu:update>"+
"</xu:modifications>";
System.out.println( xupdate );
XUpdateQueryService service =(XUpdateQueryService)
col.getService("XUpdateQueryService", "1.0");
service.updateResource( Integer.toString( kernid ), xupdate );
return true;
}
By the way, i open the db in an other routine.
So any advice out there?
Greetings
Thomas Sempf
Re: Problems with xupdate
Posted by "Mark J. Stang" <ma...@earthlink.net>.
What I have seen with xupdate is that it is usually silent if
there is a problem. Could you send your output(the xupdate string)?
My gut instinct is that the XML:DB is related to either then
name of the collection or something not being initialized.
Can you put some code in to make sure that the
XUpdateQueryService service =(XUpdateQueryService)
col.getService("XUpdateQueryService", "1.0");
service.updateResource( Integer.toString( kernid ), xupdate );
is working. I take it kernid is the key of the document that you
inserted?
HTH,
Mark
Thomas Sempf wrote:
> Hello,
>
> i´ve trying to do some xupdate instructions. But every time i get:
>
> XML:DB Exception occured 1
>
> and nothing is updated.
> Here is my xupdate code:
>
> try {
> String xupdate = "<xu:modifications version=\"1.0\"" +
> " xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
> " <xu:update select=\"/page/header/"+nodeid+ "\">" +node +
> "</xu:update>"+
> "</xu:modifications>";
>
> System.out.println( xupdate );
>
> XUpdateQueryService service =(XUpdateQueryService)
> col.getService("XUpdateQueryService", "1.0");
> service.updateResource( Integer.toString( kernid ), xupdate );
> return true;
> }
>
> By the way, i open the db in an other routine.
> So any advice out there?
>
> Greetings
> Thomas Sempf