----- Original Message ----- From: "Olivier Mo�ses" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 26, 2002 7:04 PM Subject: RE: making xupdate with xslt
> Considering the code below : > > <xupdate:update select="/addresses/address[2]/town"> > New York > </xupdate:update> > <xupdate:remove select="/addresses/address[2]"/> > > I ask the system to update and to remove the same element. I believe that > the document order must be followed, especially when many commands must be > performed. Is that correct ? Hi Olivier, That is correct. That second address element is first updated and the removed. Semantically that doesn't make much sense to me but that is what this XUpdate query does. > I have a second question more important now because I made progress in my > work : > What's about two different commands on the same node like > > <xupdate:update select="/addresses/address[2]/town"> > New York > </xupdate:update> > <xupdate:update select="/addresses/address[2]/town"> > Atlanta > </xupdate:update> > > or like > > <xupdate:update select="/addresses/address[2]/town"> > New York > </xupdate:update> > <xupdate:update select="/addresses/address[position()=last()]/town"> > Atlanta > </xupdate:update> > considering there is only two elements /addresses/address ??? These XUpdate queries both change the same element twice. Ones to "New York" and then to "Atlanta", so you could say only the last one has effect. Hope this helps, Jeroen ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact administrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------
