Skip to Content
0
Jun 03, 2005 at 06:44 AM

Another XSLT issue

18 Views

Hi,

I'm trying to convert an internal ABAP table to XML using CALL TRANSFORMATION. Form what I understand, I have to do this in two steps: from ABAP table to asXML, then from asXML to "real" XML. I have two conversions, but only the first one seems to work:

CALL TRANSFORMATION (`ID`)

SOURCE MYTABLE = wt_mytable[]

RESULT XML xml_out.

This one functions flawlessly; I can see the results by using the following call in my BSP:

runtime->server->response->set_data( data = xml_out ).

However, when trying to do the final step, from asXML to XML, I hit upon problems. I've created an XSLT program, but it does not seem to function.

The output from my first transformation looks like this:

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

- http://www.sap.com/abapxml" version="1.0">

- <asx:values>

- <REFGROUPS>

...

Now, if I debug my XSLT and delete the <asx:abap> tags, it works. My question is therefore: should my XSLT transformation handle these tags as elements, like this:

<xsl:template match="/">

<Root>

<xsl:for-each select="asx:abap/asx:values">

<xsl:for-each select="REFGROUPS">

...or should I start my first "for-each" loop at the REFGROUPS tag? Either way, it doesn't work. Has anyone any sample code for handling asXML, or, better still, is there a working example of how to convert ABAP tables into real XML (or even HTML)?

Trond