cancel
Showing results for 
Search instead for 
Did you mean: 

Append messages with out header tag "<?xml version="1.0" encoding="UTF-8"?>

Former Member
0 Kudos

Hi all,

I am doing file to file scenario.When I use APPEND in the File adapter it is also adding <?xml version="1.0" encoding="UTF-8" ?>

I need to send a file for every 10 minutes consolidate all files and send at the end of the day.

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

<ID>31154</ID>

The next time when i send the file with different< ID>31155</ID>

it should append ignoring <?xml version="1.0" encoding="UTF-8" ?>

The consolidated file must look like this...

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

<ID>31154</ID>

< ID>31155</ID>

Thanks ,

Srinivas

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI,

See the below links for XSLT .

XSLT Mapping

/people/prasadbabu.nemalikanti3/blog/2006/03/30/xpath-functions-in-xslt-mapping

/people/sreekanth.babu2/blog/2005/01/05/design-time-value-mappings-in-xslt

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

XSLT Mapping with java enhancement

/people/pooja.pandey/blog/2005/06/27/xslt-mapping-with-java-enhancement-for-beginners

Regards

Chilla

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

there is an easy way

put an XSLT mapping (or java or abap)

that will just remove the header tag - as a second mapping in your

interface mapping (in XSLT this is just a few lines of code )

then you won't see this in file adapter

Regards,

michal

Former Member
0 Kudos

Hi Michal,

Can u Please Post me the Sample Code for the Same..

Please Suggest me some good material on XSLt mapping for XI.

Thanks

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Even if you do manage to do this like pointed by Michal, the final output that will be produced will not be a valid XML.

Any XML needs to have a Root tag and if we take your Solution into picture, you will use APPEND mode without the <xml version .. > but there will be no root tag here and this might cause an issue if you are using some XML parser to process this file further as this is not a valid XML at all.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

Then what i s the solution for the same?

Please let me know.

Thanks

bhavesh_kantilal
Active Contributor
0 Kudos

The append mode should be used only with text files and not with XML files.

Either collect all the files in XI iinside a BPM and then do a N:1 mapping to send the data to the file or , collect all data at thge source and send data to the target . or, use any other mode in the receiver file adapter other than create,.

Regards

Bhavesh

Former Member
0 Kudos

Thanks,

Is there any other way?

Even driven process?

I should not use BPM as per the requirment.

bhavesh_kantilal
Active Contributor
0 Kudos

Is it mandatroy that the output file be an XML file?

If no, consider using Content Conversion in the Receievr File Adapter with the mode as Append.

If you want to continue to create an XML file then,you need to change the mode in the receive file adapter to either AddMessage ID , AddCounter , etc.

Regards

Bhavesh

henrique_pinto
Active Contributor
0 Kudos

Hi there,

I think the proper question here should be "why is there a requirement of 'do not use this or that technology'?".

BPM is not recommended when you need performance over all costs, but that is the exactly opposite of your scenario. 😛

I think you should reconsider that requirement.

Regards,

Henrique.

Former Member
0 Kudos

Hey

as pointed out by everyone else,there is no straight way for this,one thing u can do is that create two separate scenarios.

in first scenario use content conversion on receiver side and keep on appending the text for 10 mins (guess this is ur pooling interval),now since ur using FCC u wont get <?xml version="1.0" encoding="UTF-8" ?>,you will get a flat file on receiver side.

after 10 mins u can have one more scenario which picks up this flat file and this time use FCC on sender side so that it will convert this flat file to XML,in this way you will get <?xml version="1.0" encoding="UTF-8" ?> only once.

hope this solves ur problem.

just make sure that you specify correct polling intervals for both the scenarios.

thanx

ahmad

Former Member
0 Kudos

Hi,

Do you wat to xml file only?? if so i am not sure, bcz the xml file structure should have the said tag.

Why dont try with file content conversion with ingnoring the header column, then the result text file will be appended with only records whatever you want..

Regards

Chilla

Former Member
0 Kudos

Hi ,

My requirement it that in the receiver side I need to append as xml.

Former Member
0 Kudos

Ram,

In your case, go for a BPM collect pattern with deadline monitoring. Give the time interval as 24 hours(1 day). Collect all the file you receive till then and do a transformation step N:1 mapping to produce a single msg(file). Write this file to the receiver at the day end.

Regards,

Jai Shankar

Former Member
0 Kudos

Thanks,but I should not use BPM as per the Instructions