I try to write some elements in an existing xml file.
Original XML file is
<Config>
<host type="Array">
</host>
</Config>
I want to insert node inside host tag like
I tried using createElement() method, but i'm getting xml file asCode:<Config> <host type="Array"> <element> <name>ServerName1</name> </element> <element> <name>ServerName2</name> </element> </host> </Config>
<Config>
<host type="Array">
</host>
<name>ServerName</name>
</Config>
How to get the expected XML using java?
Can anyone guide me?
-haifriends.




Reply With Quote