Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Problem converting XML back to ABAP Structure using XSLT program

Former Member
0 Likes
338

Hi Experts,

I am currently trying to convert this xml file back to my ABAP structure but i have been unsuccessful so far. In XML file contain more than 1 reocrd. But my XSLT program is retriving only only first record. Try to help to get all the records.

Sample XML File:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

<soapenv:Header/>

<soapenv:Body>

<m:matchResponse xmlns:m="http://www.openuri.org/">

<matchResult soapenc:arrayType="xs:string[1]">

<enc:String xmlns:enc="http://www.openuri.org/encodedTypes">

23417|finc|20060427 |BELMETALNERGO||||||X

X|ALL||||20060427|20880808

</enc:String>

</matchResult>

</m:matchResponse>

</soapenv:Body>

</soapenv:Envelope>

My XSLT Program:

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sapxsl="http://www.sap.com/sapxsl" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hp="http://www.openuri.org/" version="1.0">

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

<xsl:template match="/">

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values>

<OUTTAB>

<xsl:for-each select="soapenv:Envelope/soapenv:Header/soapenv:Body/m:matchResponse/matchResult/enc:String">

<ZA2_RPL_DETAILS_S>

<FINAL_RESULTS>

<xsl:value-of select="."/>

</FINAL_RESULTS>

</ZA2_RPL_DETAILS_S>

</xsl:for-each>

</OUTTAB>

</asx:values>

</asx:abap>

</xsl:template>

</xsl:transform>

My Structure is : Structure Name is ZA2_RPL_DETAILS_S.

filed is: FINAL_RESULT CHAR553

My requirement is to store the complete value between <String> and </String>.

Currently it is giving the blank records

Thanks for your help in advance.

Regards,

Rao

1 REPLY 1
Read only

Former Member
0 Likes
315

Hi,

post here

expert forums -> sapnetweaver -> exchange infrastructure

Regards