commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Rogers" <>
Subject RE: Insert using JXpath?
Date Sun, 23 Nov 2003 20:40:32 GMT


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

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
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
If so maybe that is my problem, as i wrote my own JDOMFactory extending

Is there a "standard" implementation of AbstractFactory for JDOM or DOM? I
looked but
could not find one.


-----Original Message-----
From: Dmitri Plotnikov []
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" <>
To: <>
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 can i do this...with jxpath?
> Or should I just do it the jdom way?
> Thanks,
> -Dave
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message