Hi, Thanks for the reply but I am still unclear on this. I am concerned with the case were the path and leaf node already exist when using a context.createPathAndSetValue(path, value) on a JDOM.
Now if value is a string, i expect that the text of the existing leaf node will be replaced with the string in value. -fine. However, if value is a JDOM Element, then should the Element be inserted at the specified index (rather than replace the existing Element)? Is this correct? Or how do i do an insert. (not a replace) Is this behavior meant to be implemented in the createObject method of the AbstractFactory? If so maybe that is my problem, as i wrote my own JDOMFactory extending AbstactFactory. Is there a "standard" implementation of AbstractFactory for JDOM or DOM? I looked but could not find one. Thanks, Dave -----Original Message----- From: Dmitri Plotnikov [mailto:[EMAIL PROTECTED] Sent: Sunday, November 23, 2003 3:05 PM To: Jakarta Commons Users List Subject: Re: Insert using JXpath? The APIs to insert a node is context.createPathAndSetValue(path, value) - Dmitri ----- Original Message ----- From: "David Rogers" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 21, 2003 8:35 PM Subject: Insert using JXpath? > > > Hi, > > Im using jxpath with jdom and im wondering if it is possible > to insert an element between two other elements. I thought > context.setValue("document/paragraph[3],new Element("paragraph")); for > examlple > would do it but this replaces the existing paragraph[3] with the new one.. > > I need to insert...how can i do this...with jxpath? > Or should I just do it the jdom way? > > Thanks, > > -Dave > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
