cancel
Showing results for 
Search instead for 
Did you mean: 

XML re-structuring via java or xslt mapping

0 Kudos

Dear Experts,

I wanted to seek your expert advise on what is the best approach to attain my output. I have a source structure as illustrated below which i want to modify into target structure as mentioned also below.

Source Input:

Target Output:

>> C10 / D10 / E10 can occur multiple times.

Appreciate your help whether this can be achieved easily by Java or XSLT mapping.

Thank you in advance!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Frederick,

you can try out a simple xsl transformation to solve the problem. I have attached a sample implementation for you.

Please be aware of the namespace foo... I think you will need to the declare the target namespace and prefix it at the generated elements as "ns1".

Best regards,

Daniel.

iaki_vila
Active Contributor
0 Kudos

Hi Frederick,

Check  Shabarish Vijayakumar's blog because your problems seems to be very near to nodeDeception issue explained there. In that blog you have a link to a wiki with the java code that it could be a good start.


Regards.

0 Kudos

Thank you.

I am checking the thread as well.

Former Member
0 Kudos

Hi

I would have used the java mapping to generate the target output.

Please provide your sample xml files if you need any help on Java Mapping.

Thanks,

Indrajit

0 Kudos

Thanks Indrajit for the reply.

Attach is my source input XML.

Former Member
0 Kudos

Hi

Tell me whether the occurrence of the node C,D and E will be same always  ?

In the sample example all of them had 2 instances. Ore there can be scenarios when you have 1 C, 2 D and 4 E node.

Thanks,

Indrajit

0 Kudos

Hello,

They will always be the same number of occurrences.

Thank you