cancel
Showing results for 
Search instead for 
Did you mean: 

File receiver - output without xml header

Former Member
0 Kudos

HI,

is it possible to write the output to file without the xml header:

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

or an flatfile ?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Henrique,

the file arrived at the ftp but with <xml... header again.

Any ideas ?

Gordon

henrique_pinto
Active Contributor
0 Kudos

Make sure you use .xsl mapping as the <b>last</b> mapping program in your mappings list, in the Interface Mapping.

Also, test the mapping in interface mapping test tab.

Execute the mapping and go to XML Source view of the target message.

Is it removed there?

- If yes, then probably the header is added in a later point, maybe in receiver adapter (could occurr with soap adapters, for example). Try a test scenario with a file receiver adapter.

- If not, try to revise the xsl mapping.

The key is the <i>omit-xml-declaration="yes"</i> attribute in the <xsl:output> tag.

You could alternatively, try to use <i>method="text"</i>, also in the <xsl:output> tag (if you go for text output, then you don't need to set the <i>omit-xml-declaration</i> attribute).

Regards,

Henrique.

Former Member
0 Kudos

Hey,

If you are using <b>File Content Conversion</b> then you can generate a file with out xml header.

You can used the following parameters.

<b>File.addHeaderLine</b> = 4

<b>File.headerLine</b>= "Header Line You Want"

Hope it answers a bit.

Cheers,

<b>*RAJ*

*REWARD POINTS IF FOUND USEFULL*</b>

Former Member
0 Kudos

I have created an xslt file.

xsltmap.xslt -> xsltmap.zip -> imported ->activated

It´s not shown in the Interfacemapping ?

any ideas ?

Regards,

Gordon

prateek
Active Contributor
0 Kudos

Just a ckeck:

Have u selected the XSL Mapping option in the Interface Mapping

Regards,

Prateek

henrique_pinto
Active Contributor
0 Kudos

Gordon,

two things.

1. try to save the file as .xsl instead of .xslt;

2. you have to select Type of Mapping = XSL (and not Message Mapping) in the table inside Interface Determination.

Regards,

Henrique.

Former Member
0 Kudos

Henrique,

it´s working now with .xsl.

I´m going to do the rest of this blog now.

Thx,

Gordon

henrique_pinto
Active Contributor
0 Kudos

Prateek and Amit,

it doens't have anything to do with namespaces AND it doesn't need necessarily to be in the output for it to be recognized as a valid xml file!!!

Pff...

Gordon,

try this xslt mapping:


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
	<xsl:template match="/">
		<xsl:copy-of select="." disable-output-escaping="yes"/>
	</xsl:template>
</xsl:stylesheet>

Henrique.

Former Member
0 Kudos

Hi Gordon,

In the message Type tab in the IR just remove the XML namespace text below he Data type and then it will not come in yr message .

Also serach the forum with namespace ur prob will be resolved I got the same prob and was resolved like this

REgards

Former Member
0 Kudos

Hey

>>In the message Type tab in the IR just remove the XML namespace text below he Data type and then it will not come in yr message .

This will make sure that the namespace tag <ns01:MT_.......> does not show up,it wont solve the problem,XSLT mapping is the way to solve it as suggested by Henrique.

Thanx

Ahmad

Former Member
0 Kudos

Ahmad / Henrique,

can you explain me how to import / map this xslt in the IR ? Do i need something to do in the ID, too ?

Thanks (points will be rewarded)

Gordon

henrique_pinto
Active Contributor
0 Kudos

First, to load the xslt mapping in IR, you have to put it into a .zip file and upload it into a Imported Archive entry.

Also, do you already have a mapping in your integration?

If yeah, just add this xslt mapping in the mapping tree of your interface mapping (you can have several mapping programs in the same Interface Mapping). Just enter in edit mode in the interface mapping and add a new entry in the mapping programs list (table in the bottom-center of the interface mapping screen). Select type XSL and in the value, select the .xslt file you have just uploaded into Imported Archives.

If you don't have a mapping, you'll have to create a interface mapping for that (input and output message types would be the same). After that, add the interface mapping to the interface determination in ID.

Regards,

Henrique.

prateek
Active Contributor
0 Kudos

Go for file content conversion and u can write a plain text file.

For XML files, those tags are necessary

Regards,

Prateek