Use
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.
Features
XPath and
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
Runtime Constants
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 (ABAP proxy runtime, Java proxy runtime). | 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 | Name of the sender interface. As of SAP XI 3.0, use this constant instead of the constant SENDER_NAME used previously. | Yes |
$InterfaceNamespace | Namespace of the sender interface. 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: Communication party |
$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: Service |
$ReceiverName | Name of the receiver interface. | Yes |
$ReceiverNamespace | Namespace of the receiver interface. | Yes |
$ReceiverParty | Communication party to receive the message. | Yes See also: Communication party |
$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: Service |
$MappingTrace | Returns a MappingTrace object that you can use to write messages in the monitoring. | 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:
Java Enhancements
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.
Example
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
No comments:
Post a Comment