XML

Integration with XSLT

Integration with XSLT

XSLT is a form of programming language that primarily transforms XML data from one syntax to another. It can also be used to convert files to and from other formats such as CSV to XML or vice versa.

There are two different ways to work with XSLT and Blue Integrator:

It is possible to use XSLT that works in a mapping directly to the file and is by default in Blue Integrator. In Blue Integrator there are so-called functiods, a functiod is a type of function used by the map editor and does anything from sharing a string to retrieving data from the database. One of these functiods is an XSL transformer that takes an XML file and XSLT code and applies the code to the XML file. The transformer then provides an output that depends on how and what is written in its code. XSLT can also be applied to CSV files to provide a better structured XML file for easier management. XSLT uses both XPATH and XQuery to find and retrieve data based on parameters that you decide.

Example of XPATH:

Using the following line: “Users \ User[Id]\ Name” you will get the name “Carl” from the XML file below:

Exempel på XPATH


XQuery can, for example, convert the CSV string (1,2,3) using the function below to divide the values to each node named “num”

functx:wrap-values-in-elements(
(1,2,3),
xs:QName(‘num’))

<num>1<>
<num>2<>
<num>3</num>

The second way is to use XSLT 2.0 is using workflow and third party libraries. This method is used when there are very complex mappings that need to be done. An SXLT 2.0 library is more developed and also has access to XPATH 2.0, providing more functionality, as well as easier and greater capabilities.

Example of XSLT Scheme:

XML

Blue Integrator manages XML data from scratch

Try for free

Download Blue Integrator Trial today for free