cancel
Showing results for 
Search instead for 
Did you mean: 

XML file opening in 1 line

Former Member
0 Kudos

Dear Friends,

SAP PI is placing file on FTP location. When client is opening file, contents are getting displayed in 1 line instead of standard XML format in separate lines.

Can anybody guide me as to what can be done?

Thanks.

SM.

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi,

These threads, with similar matter, could be helpful for you:

http://scn.sap.com/thread/1555806

http://scn.sap.com/thread/2109969

http://scn.sap.com/thread/1765943

Regards.

Answers (3)

Answers (3)

former_member198060
Participant
0 Kudos

You could achieve line breaks by writing and applying an adapter module before you send out the message.

In my opinion this makes no sense though. XML files are usually meant to be read by programs, not human beings. SAP opted to send out the payload as compact as possible therefore cutting all unnecessary spaces or line breaks.

For a program this does not make a difference. If a human being wants to read it, it is simply a matter of the program they are using to display your XML file.

Former Member
0 Kudos

Hi,

Does your PI system is placing xml file in target file server.

If yes .It is display problem.Nothing to do with PI.

Tip to view line by line.

open the file using editplus s/w-->click ctrl+b .

Regards

Venkat

Former Member
0 Kudos

Hi,

Are you placing new line character at the end of each line before writting to the target location.

Regards,

Ashish

Former Member
0 Kudos

No Ashish...I am not doing it.

How can i do it using message mapping and XSLT mapping.

Thanks.

Sumeet.

Former Member
0 Kudos

S M,

It depends on which mode you are opening file If you open any XML file with notepad all the tags will be displayed in one row.

If you open the same XML file with internet exploer/xml editor it shows formatted.

Let me know when you write file what is the file name...is it ends with .txt or .xml

Regards,

Ashish

Former Member
0 Kudos

Hi Ashish,

Even in IE content is coming in 1 line. May be i have to use XSLT mapping to indent the contents of XML file, it could work.

I am not putting any extension to file(.txt or .xml), it is coming as default from PI.

Any advice on that.

Thanks.

Sumeet.

Former Member
0 Kudos

Sumit,

Is this a pass through interface in PI or you are using any mapping.

Try to use the below code -

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

<xsl:output method="xml" encoding="UTF-8"/>

      <xsl:template match="/">

          <xsl:copy-of select="Write your message type /Child node or nodes you want to copy./>

      </xsl:template>

</xsl:stylesheet>

Regards,
Ashish

Former Member
0 Kudos

Hi Ashish,

I am using message mapping.

Right now servers are down, once up i will try your code. Is there any need to give the indent property as 'YES' in this code.

Thanks

Sumeet.