cancel
Showing results for 
Search instead for 
Did you mean: 

Start to learn XSLT transformation

Former Member
0 Kudos

Hi,

i started to learn XSLT transformation, but i get the first problems very soon.

Here is my coding :


<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">

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

  <xsl:template match="/">
    <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
      <asx:values>
        <EXPORT>
          <xsl:for-each select="BUT000">
            <BUT000>
              <PARTNER>
                <xsl:value-of select="PARTNER"/>
              </PARTNER>
            </BUT000>
          </xsl:for-each>
        </EXPORT>
      </asx:values>
    </asx:abap>
  </xsl:template>

</xsl:transform>

My problem is, that the transformation exit on the tag "for-each" and do nothing.

My source is a internal table from type BUT000.

In the internal table are two entries.

Where is my fault?

Regards,

Anton

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Check those tutorials:

XSLT Tutorial - http://www.w3schools.com/xsl/

XPath Tutorial - http://www.w3schools.com/xpath/

XQuery Tutorial - http://www.w3schools.com/xquery/default.asp

Regards.

Liang

stefan_grube
Active Contributor
0 Kudos

Y64 need XPATH for the select attribut.

For testing you can use //BUT000 (that means anywhere in the XML document)

A correct term could be /root/node/node/element

Regards

Stefan