cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping flat xml file to xml Structure

Former Member
0 Kudos

Hi all,

i have to map an xml file, wich is incoming via a RFC call in a flat import field, to a xml-Structure. The xml Structure has the same Structure except that it is not flat but even as a xml-Structure in the Repository. Ist ther a way to make a 1:1 - Mapping?

Regards Mathias

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Matthias,

congratulation for your talent to explain easy things maximal complex

I assume you could use XSL with <xsl:copy-of select="/myNSPrefix:myRootelm/*"/>.

Assumedly the rootelement cant be copied coz of namespace.

Regards,

Udo

Former Member
0 Kudos

Is there no way using message mapping?

Former Member
0 Kudos

Hi,

This can be done very easily using Java Mapping.

Parse the flat xml String using Dom4j and directly set this as the target structure.

eg code:


public void execute(InputStream in, OutputStream out) throws StreamTransformationException{

String flatXml = "the flat xml string";
Document doc = DocumentHelper.parseText(flatXml) ;

out.write(doc.asXML().getBytes());

}

Regards,

P.Venkat

Answers (1)

Answers (1)

Former Member
0 Kudos

Mathias,

You mean the source and target structures are different. In that case you have do manually one by one.

But if you have both same structures then you have an option in message mapping.

---Satish

Former Member
0 Kudos

Yes this are the same structures.

How to map? To which node shall I link the incoming field(flat xml-File) to the other xml-Message?

Regards

Mathias