Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HI Can I add a child node to an Element Node with a name that exists

843834Jul 9 2003 — edited Jul 10 2003
HI,

Can I add a child node to an Element Node with a name that is already existing in the Element Node.
Let me explain what I need exactly.
My Existing element Node looks like this:
<form>
<name>
<FirstName></FirstName>
<LastName></LastName>
</name>
</form>

Can I add another child node with hte name 'FirstName' to the 'name' node ..?
I want to put a attribute rvsn with a value 1 for the original 'FirstName' element Node.
so the new Element Node should look like the foloowing:

<form>
<name>
<FirstName rvsn="1"></FirstName>
<FirstName></FirstName>
<LastName></LastName>
</name>
</form>
Hopefully this is valid XML !!
when I tried to use appendChild, it removed the previous node and put the new one. Thats what is the documentation also said.. I read it after I tried it :(
Anyway, ther should be another way to add a node like that.

Any hints, ideas will be of great help.
-Thanks in advance !!
Murthy



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2003
Added on Jul 9 2003
3 comments
605 views