cancel
Showing results for 
Search instead for 
Did you mean: 

CRLF character in xi output xml message

Former Member
0 Kudos

Hi All,

I am trying to open in Textpad an XML document which is my output message from SAP XI and it shows no new line character, all comes in one line;

When I open the XI output xml in Textpad, everything is in one line there is no line break. How Can I put line breaks-end of line characters in XI transformation, I am using message mapping as my mapping program. I am using jms adapter to send the output to target syatem. Does it got to do with some encoding formats.

How would I get my output to have the end of line when I open it with

wordpad or Textpad.

Thanks in advance.

ravijeet

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Ravijeet,

Try this wiki entry. It looks like it may work for your requirement. It makes use of a UDF which you can then incorporate into your message mapping:

[https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/howtoappendCarriageReturnintheendofeachtagofxml+file]

Regards, Trevor

Former Member
0 Kudos

Hi Trevor,

I saw the blog and feel thats the way I can resolve this issue but I am not sure how to use it.

What will be the input to this user defined function ?

Do I map the source xml node to target xml node and use this UDF in between, how will the user define get the whole xml payload in graphical message mapping.

<tag>Ravi</tag><tag1>DEV</tag1>

to

<tag>Ravi</tag>

<tag1>DEV</tag1>

So here should I map source node <tag> to target node <tag> in message mapping.

Thanks in advance.

Ravijeet

stefan_grube
Active Contributor
0 Kudos

line feed and other white space can have a negative impact on processing of the XML by the receiver.

Therefore PI does not provide any line feed.

Regards

Stefan

Former Member
0 Kudos

Hi,

Please check the same in sxmb_moni.In that go the payload of the message and right click and view source.Check the output XML in that.

Thanks,

Tiny

Former Member
0 Kudos

Hi Stefan,

My target syatem expects a new line feed after each xml end tag.

Can this be explictly done in adapter module, Is there any custom adapter module for xml2xml whre I can introduce a CRLF character.

Thanks in advance

Ravijeet

stefan_grube
Active Contributor
0 Kudos

The easiest way to achieve this, is using a simple XSLT mapping.

I do not understand why an XML parser requests line feeds, as this is not part of the XML specification.

Maybe you can influence the behaviour of the target system?

Former Member
0 Kudos

Hi,

I suppose if you open it with wordpad it should be in proper format. In notepad you generally dont get this formatting.

Regards,

Siddhesh S.Tawate

Former Member
0 Kudos

Did you mark the option "warp text" in your notepad (menu => format => warp text).

And: Is there any negative effect from this in your processing?

Regards,

Kai

Former Member
0 Kudos

Hi,

With my limited knowledge, I think you need to develop java mapping which will be called after your message mapping to write code for pretty printing (inserting new line between field tags in XML structure).

Thanks.

Regards,

Vineetha.