Entering content frameProcedure documentation Creating XSLT Programs Locate the document in its SAP Library structure

Use

In an XSLT program, you implement the rules for XSL transformation using the XSLT language (and its additional statements).

XSLT programs, like ABAP programs, are Repository objects and are assigned to other packages. All changes and transports are managed through the Transport Organizer.

Procedure

To create an XSLT program:

  1. Start the Object Navigator (SE80) and select the package in the Repository Browser.
  2. Choose Create ® Other ® XSL Transformation in the context menu (right click with the mouse).
  3. The system displays the Create XSLT Program dialog box.

  4. Enter a name and short description for the new XSLT program.
  5. Choose This graphic is explained in the accompanying text to confirm your entries.

Result

The XSLT program was created as a Repository object and included in the tree display of the object list under XSLT Transformations. The following contents are generated as source text:

<xsl:transform version="1.0"

  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

  xmlns:sap="http://www.sap.com/sapxsl"

>

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

 

<xsl:template match="/">

</xsl:template>

 

</xsl:transform>

This standard source text is the starting point for your own implementation of the transformation rules.

Standard Source Text and Program Structure:

Generated line

Meaning

<xsl:transform version="1.0"

Specifies the XSL version.
Each XSLT program has to support Version 1.0.

xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

Declares the namespace for the XSL standard.
Each valid XSLT program has to support this standard.

xmlns:sap="http://www.sap.com/sapxsl"

Declares the SAP namespace extension needed for ABAP calls.

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

Ensures that "whitespaces" (spaces, tabulator, return, and so on) are not considered in any of the elements of the document tree at runtime for the purpose of improving performance.
This line is a proposal especially for representing data structures.

Insert your source text with global elements (such as parameters) here.

<xsl:template match="/">

Defines the beginning of the XSL templates and associates the template with the root of the XML document.

Define one or more templates with the relevant transformation rules here.

</xsl:template>

Defines the end of the XSL template.

</xsl:transform>

Defines the end of the XSLT program.

See also:

SAP XSLT Processor Reference

Testing the XML Transformation

Leaving content frame