cancel
Showing results for 
Search instead for 
Did you mean: 

XML file without indent

Former Member
0 Kudos

Hi Friends,

I have to send a XML file to receiver without indent.

<Message>

<Header>

<Sender>SSDRTWRQ</Sender>

<Receiver>RSGSFDHDJ</Receiver>

<MessageType>PRMSG</MessageType>

<MessageDescription>MSGR - 000001</MessageDescription>

<TimeStamp>2013-02-06T13:21:05</TimeStamp>

</Header>

<Body>

<PayrollMessage>

<PayrollMessageRef>MSGR - 000001</PayrollMessageRef>

<PayrollMessageType>MT100 - Payroll</PayrollMessageType>

<PayrollTransactionCount>0000094</PayrollTransactionCount>

<PayrollTransactionAmount>718606.4</PayrollTransactionAmount>

</PayrollMessage>

</Body>

</Message>

instead of actual structure given below

<Message>

    <Header>

        <Sender>SSDRTWRQ</Sender>

        <Receiver>RSGSFDHDJ</Receiver>

        <MessageType>PRMSG</MessageType>

        <MessageDescription>MSGR - 000001</MessageDescription>

        <TimeStamp>2013-02-06T13:21:05</TimeStamp>

    </Header>

    <Body>

        <PayrollMessage>

            <PayrollMessageRef>MSGR - 000001</PayrollMessageRef>

            <PayrollMessageType>MT100 - Payroll</PayrollMessageType>

            <PayrollTransactionCount>0000094</PayrollTransactionCount>

            <PayrollTransactionAmount>718606.4</PayrollTransactionAmount>

        </PayrollMessage>

    </Body>

</Message>

I even used below statement in XSLT mapping but didn't get result.

<xsl:output method="xml" indent="no"/>

Can anybody guide me, if he has any such experience? Can i use XSLT mapping to achieve this.

Thanks.

Sumeet.

Accepted Solutions (0)

Answers (5)

Answers (5)

gagandeep_batra
Active Contributor
0 Kudos

Hi,

You can go for java mapping or XSLT mapping. check below blog for java mapping it might help you.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/11/06/adding-carriage-return-or-line-fe...

for xslt did you try like that:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

     

     <xsl:output method="xml" indent="no"/>

     <xsl:template match="node() | @*">

         <xsl:copy>

              <xsl:apply-templates select="node() | @*"/>

         </xsl:copy>

    </xsl:template>

               

</xsl:stylesheet>

Regards

Gagan

iaki_vila
Active Contributor
0 Kudos

Hi,

Also you can try with these two sentences:

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

    <xsl:strip-space elements="*"/>

Regards.

Former Member
0 Kudos

Hi,

I tried, but didn't make any difference.

Thanks.

Sumeet.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sumeet,

                  You need java mapping to resolve this. What is the version of PI you  are working in?

Do you have experience in working with java mapping?

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

PI version is 7.1. I have no exp. with java mapping.

Thanks.

Sumeet.

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sumeet,

                 Issue has been resolved or still you are facing the same problem?

Regards

Anupam

Former Member
0 Kudos

Hi Anupam,

I am still facing issue.

Can anybody has any other idea?

Thanks.

SM.

nabendu_sen
Active Contributor
0 Kudos

Hi Sumeet,

Check with:

   <xsl:output indent="no" /> accompanied by

<xsl:template match="text(normalize-space()='')" />
Former Member
0 Kudos

Hi.

Have you tried with UTF encoding

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

Regards
Former Member
0 Kudos

Yes..Luis

I tried. But not successful.

Thanks.

Sumeet.

smavachee
Active Contributor
0 Kudos

Hello sm,

Similar thread at..

It may help you.!

Regards,

Sunil