cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove message type tag in receiver xml

Former Member
0 Kudos

my scenario is idoc to xml file with out content conversion.

I am getting data like that

eg:

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

<ns0:MT_TEST xmlns:ns0="https:test">

<header>

<field1>100<field1>

<field2>200</field2>

<header>

</ns0:MT_TEST xmlns:ns0="https:test">

but i want

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

<header>

<field1>100<field1>

<field2>200</field2>

<header>

Thanks In Adavance

Accepted Solutions (0)

Answers (5)

Answers (5)

samiullah_qureshi
Active Contributor
0 Kudos

Why dont you create a DT and MT as header structure and use it in inbound interface. In mapping u can get use MT_TEST as source and header as target.

Former Member
0 Kudos

i am not understandig what you explained.

could you please explian clearly.

my source interface is idoc and target interface is MI_TEST

for message type is the below mentioned structure

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

<ns0:MT_TEST xmlns:ns0="https:test">

<header>

<field1>100<field1>

<field2>200</field2>

<header>

</ns0:MT_TEST xmlns:ns0="https:test">

i would like to remove the message type tag <ns0:MT_TEST> in target structure.

Thanks

samiullah

samiullah_qureshi
Active Contributor
0 Kudos

Hi SWATHIP,

I meant that u can create target message structure as follows instead of the one u r trying to use:

<?xml version="1.0" encoding="UTF-8" ?>
<header>
<field1>100</field1>
<field2>200</field2>
</header>

In case u need to have multiple occurrences of header, in that case u have to use the structure something like ur existing structure:

<?xml version="1.0" encoding="UTF-8" ?>
<MT_Header>
<header>
<field1>100</field1>
<field2>200</field2>
</header>
<header>
<field1>300</field1>
<field2>400</field2>
</header>
</MT_Header>

If you want to use the structure something like as follows:

<?xml version="1.0" encoding="UTF-8" ?>
<header>
<field1>100</field1>
<field2>200</field2>
</header>
<header>
<field1>300</field1>
<field2>400</field2>
</header>

Then, this strucutre doesn't comply with basic xml rules. So u can't use it.

Regards,

Samiullah.

Former Member
0 Kudos

HI Samiullah,

In my receiver structure have more than one node.

eg:

<MT_TEST>

<header>

<field1>100</field1>

<field2>200</field2>

</header>

<detail>

<detail1>123</detail1>

<detail2>456</detail2>

</detail>

</MT_TEST>

header will be one to one and detail also one to one. could you please explian xslt mapping ,if it is possible with xslt mapping.

Edited by: SWATHIP on Mar 7, 2011 5:47 AM

Edited by: SWATHIP on Mar 7, 2011 5:59 AM

samiullah_qureshi
Active Contributor
0 Kudos

Hello SWATHIP,

If you have more than one node then u should have one root node in ur case it is <MT_TEST> . Why u want to remove it.

*As per xml basic rule, in one xml file there can be only one root node. *

In ur requirement u have to use <MT_TEST> or any other root node and under that u will be having header and detail node.

If any how, u removed this root node then ur xml will be malformed.

Regards,

Sami.

Former Member
0 Kudos

What version you are Using ,

If your using 7.0 or less

Then remove On Message Type : remove value against XML Namespace so result you will get is Data with That Namesapce information

If it equalent to 7.1 . Then you have to use . java Mapping or XSLT mapping to achieve this ...

Hope this help.

regards

PS

Former Member
0 Kudos

thanks.

I am using 7.1 version.

instead of java mapping is there any module configuration?

Edited by: SWATHIP on Mar 4, 2011 1:17 PM

prateek
Active Contributor
0 Kudos

I agree to what Samiullah suggested. You are complicating your scenario without any specific reason. Just remove the root node name from the Message Type and it should work.

The suggestions others provided were mostly to remove namespace (which was not the actual question).

Regards,

Prateek

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

but i want

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

<header>

<field1>100<field1>

<field2>200</field2>

<header>

Not possible at all without resorting to:

a.) XSLT Mapping

or

b.) Java Mapping

or

c.) creating a header data type and header message type

Hope this helps,

Mark

Former Member
0 Kudos

A couple of ways:

1. As suggested in Shadab's blog:http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2769. [original link is broken] [original link is broken] [original link is broken] remove the value in XML namespace in MT.

2. Use XMLAnonymizerBean as suggested in the blog: /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

Former Member
0 Kudos

Hi,

Thanks for yoour response.

i wana to delete the message type (root node) in side of the namespce tag.

Thanks

Former Member
0 Kudos

check this blog:-

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

chirag