XSLT Mapping
XSLT (Extensible Stylesheet Language Transformations) is a powerful transformation language designed to convert XML-based documents from one format to another. With XSLT, a specific XML structure can be taken and transformed into a new XML document, allowing for changes in content, layout, or format. Beyond merely processing XML documents and converting them into different output formats, XSLT enables a range of operations, including data filtering, sorting, and grouping within XML documents.
The fundamental components of XSLT include:
-
XSLT Templates: These templates target specific XML elements or groups of elements and define how to transform them.
-
XPath: A language employed to select particular elements within an XML document. XPath expressions are utilized to pinpoint specific elements within XSLT templates.
-
XSLT Functions: Built-in functions within XSLT facilitate various transformations. These functions cover a range of operations such as text manipulation, mathematical calculations, and date processing.
In the context of integration, to leverage XSLT Mapping, it is imperative to start by adding the XSLT document prepared in the "Resources" tab. Subsequently, this document is selected within the XSLT Mapping connector for effective integration.
Pre-defined functions can be used in XSLT Mapping.
<!--
At least one of the following namespaces must be defined in the xsl:stylesheet node.
xmlns:xslt-functions="http://mdpgroup.com/xslt-functions" or xmlns:xslt-functions="mip:xslt:functions"
-->
<xsl:value-of select="xslt-functions:getProperty('authorizationKey')"/> <!-- Get Value of Property from Exchange -->
<xsl:value-of select="xslt-functions:uuid()"/> <!-- Generate UUID -->
<xsl:value-of select="xslt-functions:base64('decode or encode',value)"/> <!-- Encode or Decode the data selected with XPath -->