But what if <user> is in a collection of <userS> and I want to replace the whole <user> element and its contents. It seems I can only do this by removing the current <user> and appending the new <user> at the correct location. I would prefer to do this in with one command. It seems the <xupdate:update> command does not support the updating of a block of xml only the element data.
-Craig ----- Original Message ----- From: "Julie McCabe" <[EMAIL PROTECTED]> To: <xindice-users@xml.apache.org> Sent: Monday, October 13, 2003 6:12 AM Subject: Re: Updating specific documents in a Collection Hi, I think the following should work, use the xupdate XML as, <xupdate:modifications version="1.0" xmlns:xupdate="http://www.xmldb.org/xupdate"> <xupdate:update select="/user/name[.='Joe']/../city">Detriot</xupdate:update> </xupdate:modifications> then if your using Java - call s'thing like, XUpdateQueryService updateService = .... updateService.update(updateXml); Regards, Julie. On Monday 13 October 2003 10:51, Matthieu RIOU wrote: > Hi, > > I want to update a document in a collection but the element used to select > the document in the collection and the element I want to replace are > different. For example in : > > <user> > <name>Joe</name> > <address> > <street>Michigan Avenue</street> > <city>Chicago</city> > </adresse> > </user> > > How can I express that I want to change the city to Detroit in the document > having Joe as name ?? My understanding is that xupdate is made to update a > document so how do you do when you want to update only some documents in a > collection ?? > > Thanks a lot. Matt. > > > > > > --------------------------------- > Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! > Testez le nouveau Yahoo! Mail