Skip to Content
Oct 30, 2017 at 10:09 AM

XML to ABAP using XSLT


Hi, I'm a bit stuck with an XSLT translation issue. I've used the same setup as in the tutorial from Jan Krohn,

I've got most it to work, however I'm very uncertain how to handle 2nd line i the XML file process in my XSLT transformation.

<?xml version="1.0" ?>
<alarm xmlns="">
  <quality bad="0" realtime="1"/>
  <pbs native="XXXX-L001_PF-PS-MVS-52DF1_Q1100" n="" l2="100" l1="Q1" q="52DF1-" r="MVS" s="PS-" t="PF" a4="" a3="01" a2="L0" a1="XXXXX-XXX</pbs>
  <sign prog="01" code="A3"/>
  <property autogen="0" internal="0" prio="3"/>

If I remove the


it works fine, but If I let it stay I don't get any data durring the XSLT transformation

My XSLT look like this:

<xsl:transform xmlns:xsl="" version="1.0">
  <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <asx:abap xmlns:asx="" version="1.0">
          <xsl:apply-templates select="//alarm"/>

  <xsl:template match="alarm">
        <xsl:value-of select="quality"/>
        <xsl:value-of select="ts"/>
        <xsl:value-of select="pbs"/>
        <xsl:value-of select="sign"/>
        <xsl:value-of select="sender"/>
        <xsl:value-of select="state"/>
        <xsl:value-of select="property"/>
        <xsl:value-of select="initts"/>

What do I need to change in XSLT for getting the XML transformed correctly ?.

Another issue, how to I manage to read the attributes in some of the nodes ? I've read several articles, and some are telling I can do "@attrib name" However I never get it to work.

If I put this question into the wrong group, I'm sry for that :)


Henrik Mortensen