cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Merge two Xml files, having same structure, using java.

Former Member
0 Kudos

i'm in need to merge two Xml files.....

Example,

File1:

<root>
<a>
 <b/>
</a>
</root>

File2:

<root>
<a>
 <c/>
</a>
<d/>
</root>

Listing 2 shows the command-line input to merge these two files using the XmlMerge utility, followed by the resulting output.

output:

<?xml version="1.0" encoding="UTF-8"?>
<root>
<a>
 <b />
 <c />
</a>
<d />
</root>

thanks & regards

rajesh...

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi rajesh_beu,

Could you please share the code how you are trying to read an xml stored under /src/mimes/<component> in your WD application?

I've been using DOM and all I get is null everytime..

Thanks!

Former Member
0 Kudos
Former Member
0 Kudos

Hello rajesh,

have you tried the WDCopyService?

There is a class in the WD API called WDCopyService and this class provides the functionallity to copy corresponding attributes from one class to another.

So if you create two objects out of your XML Files you can try to merge the values with the method: copyCorresponding().

hope this will help

kind regards

Fabian