cancel
Showing results for 
Search instead for 
Did you mean: 

How to add XML Header tag to XML output from XI?

Former Member
0 Kudos

Hi ,

My requirement is I need to genarate the XML according to client requirements.

I am able to genareate the XML with <?xml version="1.0" encoding="UTF-8" ?> as Header but client requiremetn is like this

<?xml version="1.0" encoding="UTF-8" ?>

<?Label MEXICO|PROFILE|2033169|SUCCESS?>

and hear MEXICO and 2033169 will change dynamically for every xml genaration. How it make as dynamical and how can I achive this.?

Plz guid me...

Thanks

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> <?Label MEXICO|PROFILE|2033169|SUCCESS?>

This is not an XML header, but a process instruction.

If you are familiar with XSLT, you can use this XSLT-element:

<xsl:processing-instruction>

http://w3schools.com/xsl/el_processing-instruction.asp

Answers (1)

Answers (1)

sunilchandra007
Active Contributor
0 Kudos

Hi Krishna,

You can easily do this by adding a java mapping after the graphical mapping. Keep a element in target structure to catch the dynamic value and in java mapping modify that as your need.

Regards,

Sunil Chandra

Former Member
0 Kudos

can U plz provide me sample psudo code to achive this.

sunilchandra007
Active Contributor
0 Kudos

You can refer to the code provided in this thread and . Java mapping would do these steps -

a) Convert the incoming xml into string.

b) Modify it with some string function as per requirement.

c) Convert the string back to xml.

For more understanding about Java mapping, go through links provided in the thread .

Regards,

Sunil Chandra