cancel
Showing results for 
Search instead for 
Did you mean: 

Namespace in output xml file problem?

Former Member
0 Kudos

Hi,

i imported an xsd in IR for developing an interface and the output was satisafactory except for a small problem in the namesapce which the file contains.

My xml file output looks like

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

- <MT_OSD_FILE xmlns="http://localfile/ext" Version="123" >

-field1

-field2

But where as the required format in the naming is

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

- <MT_OSD_FILE Version="123" xmlns="http://localfile/ext">

-field

-field

how to get the namespace before the version(attribute)

any ideas?

Accepted Solutions (1)

Accepted Solutions (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Hi Prabhas,

<MT_OSD_FILE Version="123" xmlns="http://localfile/ext"> 
OR
<MT_OSD_FILE xmlns="http://localfile/ext" Version="123">

Both are same. Because, both Version and xmlns are arrtributes. And they should be unique (which they are) and they can be in any order.

Check XML standard [Link1|http://www.w3.org/TR/REC-xml-names/] Declaring Namespaces Such an attribute's name must either be xmlns or begin xmlns:. These attributes, like any other XML attributes, may be provided directly or by default.

Regards,

Raghu_Vamsee

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Theoraticallly there is no difference between the required and the ouput. If you hit issue, then do Java Mapping to fix this issue.

Using Java mapping is not a big effort to fix.

Former Member
0 Kudos

HI

are we talking about complete java mapping or an UDF?

baskar_gopalakrishnan2
Active Contributor
0 Kudos

I would go for Java Mapping. You have to read the XMLDocument and look for the tag using getElementsByTagName() and update the namespace and attribute as per the requirement

stefan_grube
Active Contributor
0 Kudos

> how to get the namespace before the version(attribute)

>

> any ideas?

Why? Do you have an issue with this?

There should not be a difference.

RKothari
Contributor
0 Kudos

Hello,

Please check the below mentioned blogs:

/people/shabarish.vijayakumar/blog/2010/05/07/quick-tips-dealing-with-namespaces-in-xipi

/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

-Rahul

Former Member
0 Kudos

hi i already used anonymiser bean for namespaces tats working fine.

i just want my namespace to be after attrbiute

udo_martens
Active Contributor
0 Kudos

Hi,

>i just want my namespace to be after attrbiute

If you look to the message from a parsers view it should be the same. Attributes do not have a sequence capacity.

If you look to the message as string then there is a difference. So you need to create a not parsing mapping, the is possible with Java or ABAP, where you just replace the substring describing the root element with your wished version.

The question is here if the message receiver is using a XML parser (then it should be the same)

Regards,

Udo