Ross,
If JXPath finds an element that matches the XPath, it simply returns
that element instead of creating a new one.
You can take one of these two approaches:
- introduce some distinguising feature for the new element, e.g.
createPath("/form/[EMAIL PROTECTED]'another']")
- use explicit indexing, e.g.
createPath("/form/input[2]")
I hope this helps.
- Dmitri
--- Ross Bleakney <[EMAIL PROTECTED]> wrote:
> I would like to create a new element with JXPath (even if an element
> with the same name exists). If I try to use
> JXPathContext.createPath(),
> it returns an existing element. For example, if I have the following
> XML:
>
> <form>
> <input type="text" id="existing" />
> </form>
>
> and I want to add another <input> element, how can I do this?
> Thanks,
> Ross
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]