Interface descriptions are in the form of XML documents. XSL Transformation (XSLT) is a member of the XML family of languages. It describes how an XML structure is transformed into another XML structure.
In releases lower than SAP NetWeaver Process Integration 7.1, XSLT programs are executed by using the SAP XML Toolkit. The SAP XML Toolkit will be replaced by version 5 of the Java Development Kit (JDK). JDK 5 has the following advantages over the SAP XML Toolkit:
● Quicker execution of XSLT programs
● More-advanced troubleshooting
● Greater scope of functions
The SAP XML Toolkit is supported by SAP NetWeaver Process Integration 7.1, and will also be supported by the next release version. It will not be supported in any subsequent releases. Therefore, SAP recommends that you use JDK 5 for all new XSLT mapping programs, and that you test any existing XSLT programs with JDK 5 and modify them accordingly. To use the JDK 5 as the runtime for XSLT mapping programs, do not select Use SAP XML Toolkit in the operation mapping that you reference the XSLT mapping program from.
In SAP NetWeaver 2007, the PCK will only have JDK 5.
You can define mappings using XSLT together with XPath. XPath is also a specification of the XML family. Using XPath you can address any node in an XML document. XSLT implements XPath expressions to select substructures of an XML document. Using templates in XSLT you can define the mapping rules for the selected substructures.
You can use the XSLT tags <xsl:include> and <xsl:import> to include predefined templates for substructures in a complete mapping definition. In this way, you can reuse mappings for data types.
In the same way as in Java mappings, the mapping runtime in XSLT programs also returns parameters that you can use to evaluate information in the XSLT program that is not known until runtime.
Mapping Runtime Constants
Constant |
Meaning |
Relevant for PCK |
$MessageClass |
Classification of message. Possible values: ●
ApplicationMessage: ●
ApplicationResponse: ●
SystemAck, ApplicationAck, SystemError, ApplicationError: |
Yes |
$VersionMajor |
XI message protocol version. Example: For the XI 3.0 message protocol VERSION_MAJOR = 3 and VERSION_MINOR = 0. |
No The PCK only uses message protocol XI 3.0. |
$VersionMinor |
|
No |
$ProcessingMode |
The mode of a message can be synchronous or asynchronous. Correspondingly, these constants can have the value synchronous or asynchronous. |
Yes |
$MessageId |
The message ID. It can change during communication: ● Response messages get a new message ID. ● If new messages result from a message (the message is copied at multiple receivers), the new messages get new message IDs. |
Yes |
$RefToMessageId |
The ID of a referenced message that belongs semantically to this message. For example, a response message uses this field to note which request message it belongs to. |
Yes |
$ConversationId |
This field is not
mandatory in the message. It enables an ID to be used to group messages that
belong together. This field is not intended to be used for message
serialization and has nothing to do with the serialization context (
|
Yes
|
$TimeSent |
Time stamp specifying when the message was sent by the sender. The format of the time stamp is as follows: YYYY-MM-DDTHH:MM:SSZ The letter ‘T’ separates the date from the time, which is generally specified in UTC. If it is a local time, the closing ‘Z’ is omitted. |
Yes |
$Interface |
Sender interface name. As of SAP XI 3.0, use this constant instead of the constant SENDER_NAME used previously. |
Yes |
$InterfaceNamespace |
Sender interface namespace. As of SAP XI 3.0, use this constant instead of the constant SENDER_NAMESPACE used previously. |
Yes |
$SenderParty |
Communication party that sent the message. |
Yes See also:
|
$SenderPartyAgency |
Issuing agency for the message sender. |
Yes |
$SenderPartyScheme |
Identification scheme used by the sender. |
Yes |
$SenderService |
Service on the sender side that sent the message. For example, the name of a business system. As of SAP XI 3.0, use this constant instead of the constant SENDER_SYSTEM used previously. |
Yes See also:
|
$ReceiverName |
Receiver interface name. |
Yes |
$ReceiverNamespace |
Receiver interface namespace. |
Yes |
$ReceiverParty |
Communication party to receive the message. |
Yes See also:
|
$ReceiverPartyAgency |
Issuing agency for the message receiver. |
Yes |
$ReceiverPartyScheme |
Identification scheme used by the receiver. |
Yes |
$ReceiverService |
Service on the receiver side that receives the message. For example, the name of a business system. As of SAP XI 3.0, use this constant instead of the constant RECEIVER_SYSTEM used previously. |
Yes See also:
|
$MappingTrace |
Returns an AbstractTrace object that you can use to write messages to monitoring in the mapping program. |
No |
If you want to access one of the constants in the XSLT program, you first have to declare the constant as a parameter, for example:
<xsl:param name="MessageId" />
Moreover, using an XSLT definition you can call external Java methods to convert XML structures. This procedure gives you more flexibility when defining mappings. For more information about XSLT mapping with Java enhancement , see further documentation.
For more information about XSL/XSLT and XPath, see the Web page of the W3 Consortium .
The function for booking a flight contains a parameter for the flight class. The outbound interface represents flight classes as symbolic values; in the inbound interface, flight classes have numerical values. The XSLT section converts the symbolic representation of the source system into the numerical representation of the target system.
The XPath expression match=“//hh:class“ selects the node <hh:class> in the outbound interface. The XSLT statement <xsl:choose> then defines the mapping rule for how the Integration Engine converts the symbolic values in the source system into the numerical values in the target system.