cancel
Showing results for 
Search instead for 
Did you mean: 

Add namespace to receiver file

Former Member
0 Kudos

Hi All,

i tried to add three namespaces to the receiver file, for example

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

<PostBrandOccurrence releaseID="1.1"

xmlns="http://www.ford.com/oagis" xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<oa:ApplicationArea>

<oa:Sender>

but not succeded, please let me know how to add.

Regards,

Pradeep.

Edited by: Pradeep Amisagadda on Apr 7, 2011 3:23 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Use XSLT Mapping to add three namespaces.

udo_martens
Active Contributor
0 Kudos

Hi Pradeep,

from my point of view it is the easiest if you do that with XSLT. Just right the style content as the output should be and add the text nodes with xsl:value-of, address repeatable fields with xsl:for-each.

Regards,

Udo

Former Member
0 Kudos

HI Martens,

my structure is show below, the below namespace has to replace with three namespaces xmlns="http://www.ford.com/oagis" xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

please provide me the XSLT ..

INPUT.

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

<PostBrandOccurrence revision="1.0.0" xmlns="http://www.openapplications.org/oagis">

<ApplicationArea>

<Sender>

<LogicalID> </LogicalID>

<ComponentID> </ComponentID>

<TaskID> </TaskID>

<AuthorizationID>d </AuthorizationID>

</Sender>

<CreationDateTime> </CreationDateTime>

<BODID/>

</ApplicationArea>

<DataArea>

<BrandOccurrence>

<MetaOrderNumber> </MetaOrderNumber>

<EventCode> </EventCode>

<BrandEventTimeStamp> </BrandEventTimeStamp>

<BrandProcessTimeStamp> </BrandProcessTimeStamp>

</BrandOccurrence>

</DataArea>

</PostBrandOccurrence>

OUTPUT.

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

<PostBrandOccurrence releaseID="1.1"

xmlns="http://www.ford.com/oagis" xmlns:oa="http://www.openapplications.org/oagis/9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<oa:ApplicationArea>

<oa:Sender>

<oa:LogicalID> </oa:LogicalID>

<oa:ComponentID> </oa:ComponentID>

<oa:TaskID> </oa:TaskID>

<oa:AuthorizationID> </oa:AuthorizationID>

</oa:Sender>

<oa:CreationDateTime> </oa:CreationDateTime>

<oa:BODID> </oa:BODID>

</oa:ApplicationArea>

<DataArea>

<oa:Post />

<BrandOccurrence>

<MetaOrderNumber> </MetaOrderNumber>

<EventCode> </EventCode>

<BrandEventTimeStamp> </BrandEventTimeStamp>

<BrandProcessTimeStamp> </BrandProcessTimeStamp>

</BrandOccurrence>

</DataArea>

</PostBrandOccurrence>

Regards,

Pradeep A.

udo_martens
Active Contributor
0 Kudos

Hi Pradeep,

>please provide me the XSLT ..

he, he. Do you want to hire me?

Regards,

Udo

Former Member
0 Kudos

Hi Martens,

i don't have the know the knowledge of xslt, i request you to provide the code.

Regards,

Pradeep A.

Former Member
0 Kudos

Chk this:

http://wiki.sdn.sap.com/wiki/display/XI/XMLNamespaceManipulationUsingXSL

Thanks

Amit

Former Member
0 Kudos

Hi Pradeep,

Why go for adding namespace at mapping runtime? It would be a good idea to add the desired namespaces and prefixes at the datatype/xml structure definition stage. You can create an XSD definition for your target file structure with the desired namespace and attribute information. This way the information would be available on your target XML docutment and you dont need do any mapping/program for this.

Regards,

Suddhasatta

Former Member
0 Kudos

Hi Pradeep,

I had similar requirements , i have achived this using Java.

I am not having the code at this moment.

But the logic is

1) get the the payload from input stream . get the XML content

2) convert the XML into String

3) use replaceFirst or replaceAll function and replace the current namespace with ur new namespace.

4) write the same in outputstream

Hope this will help you.