Generate xml and add it to existing xml

Generate xml and add it to existing xml

Post by mike » Sat, 14 Mar 2009 01:49:46


Hi,

We have the following xml that needs to be generated for 200 users.



<wopi:createUser>
<typ:WOUser>
<typ:id>
<typ:serviceProviderId>AOne</typ:serviceProviderId>
<typ:companyId>Acme</typ:companyId>
<typ:userId>Alice</typ:userId>
</typ:id>
<typ:sipAddress>sip: XXXX@XXXXX.COM </typ:sipAddress>
<typ:firstName>Alice</typ:firstName>
<typ:lastName>Wonderland</typ:lastName>
</typ:WOUser>
</wopi:createUser>

ServiceProviderId and companyId will be the same but I need to
generate a user like:

user001
user002
user003

and so on...

So I will generate a <wopi:createUser>-Node for each user. Then I have
to add this into the existing xml document where we create the
serviceProvider and company.

I am using java 1.5 and I wonder if you have any advice to me in this
matter on how to implement it.
 
 
 

Generate xml and add it to existing xml

Post by Arne Vaj » Sat, 14 Mar 2009 08:26:29


For all practical purposes you can not add to an existing
XML document. You read the document, you add nodes and
you write a new document (possible with the same name).

Arne