Skip to Content
0

XSLT-Need code for o...unbounded field

Jul 07, 2017 at 05:46 PM

74

avatar image
Former Member

Hello Experts,

We have existing xslt mapping which is converting input proxy data to output xml.(Proxy to SOAP scenario)

Now,we have to add below structure at Proxy side which is at sender side. But we need xslt code to convert below input structure to expected output structure.

Input Structure <EmployeeContactInfo> ->0...1 occurance

<TEL_NO></TEL_NO> ->0..unbounded occurance

</EmployeeContactInfo>

Output structure

<EmployeeContactInfo> ->0...1 occurance

<TEL_NO></TEL_NO> ->0..unbounded occurance(Array of TEL_NO) </EmployeeContactInfo>

If we are passing multiple values of <TEL_NO> from input structure,then we are getting below output structure which is not expected.

Input Structure

<EmployeeContactInfo>

<TEL_NO>9876123456</TEL_NO>

<TEL_NO>9087123456</TEL_NO>

</EmployeeContactInfo>

Wrong Output structure

<EmployeeContactInfo>

<TEL_NO></TEL_NO>

</EmployeeContactInfo>

Expected Output Structure-

<EmployeeContactInfoResp>

<TEL_NO>9876123456</TEL_NO>

<TEL_NO>9087123456</TEL_NO>

</EmployeeContactInfoResp>

Please help.

Regards,

Ankit

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Evgeniy Kolmakov Jul 08, 2017 at 12:04 AM
0

Hi Ankit!

Since your source and target structures are equal why not to use <xsl:copy-of select="."/> ?

Regards, Evgeniy.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Evgeniy ,

Thanks for reply.

I used <xsl:copy-of select="."/> in xslt code.

Now.it is generating output structure with extra namespace in field name which is not acceptable at third party.

<EmployeeContactInfo>

<Tel_Number>

http.com:BusinessPartner" xmlns:prx="urn: sap.com:proxy:ECD:/1SAI/TAS89AD2C0DBB6BF0770B61:740">123456789

http.com:BusinessPartner" xmlns:prx="urn: sap.com:proxy:ECD:/1SAI/TAS89AD2C0DBB6BF0770B61:740">987654321

</tem:Tel_Number>

<EmployeeContactInfo>

How can we remove this extra namespace in string fielname.

0