on 01-25-2018 8:04 AM
Hello.
I'm trying to use a XSLT transformation in order to map XML data to ABAP. I've follwed the BIT14E course but unfortunately this didn't help me with my problem.
My problem is that the data is provided to the transformation but it doesn't give the ABAP formatted data back. This is my solution:
Service provider:
Call the transformation:
Content of IV_DATA:
Transformation:
The result from the call transformation is empty.
What am I doing wrong?
Thanx for ypur input. Grtz John.
With XSL your transformation must transform the input XML to asXML. You have to know this format in order deserialize any XML into ABAP data.
As an alternative you might use ST. There you don't have to know asXML but of course the syntax of ST.
As a trick, you might serialize the expected ABAP outcome with the predefined transformation ID to asXML in order to see what your XSLT should produce.
Last but not least, you can also parse the XML yourself with the iXML or sXML libraries.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For instance, asXML means that the XSLT must render something like this, so that the values can fill the variables (and we don't see that in your XSLT - did your try the demo programs like SXSLTDEMO_FLIGHTS):
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
...
</asx:values>
<asx:heap>
...
</asx:heap>
</asx:abap>
Hello All.
My proble was the exact syntax of the transformation. I wanted to create a flexible transformation related to the input fields.I have followed the BIT14E course but this did not help me at all.
I've solved the problem my self at last by naming al the elements seperatly. Thanks for your effort.
My solution is:
<xsl:template match="/" priority="2">
<abap version="1.0">
<values>
<xsl:apply-templates select="*"/>
</values>
</abap>
</xsl:template>
<xsl:template match="CLAIM" priority="2">
<xsl:element name="V_CLAIM">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
........
Grtz John
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.