Stay organized with collections
Save and categorize content based on your preferences.
XML functions
This page describes the additional set of predefined Jsonnet functions for the Data Transformer Script task available in Application Integration.
Before you begin
To use the following predefined functions, you must import the functions library in your script. Importing the functions library lets you use both the standard Jsonnet functions and the predefined Data Transformer functions.
Application Integration supports Jsonnet functions library v0.20.0. For information about the Jsonnet standard functions, see Jsonnet Standard Library.
Parse XML
Syntax
parseXml(xml, format = "badgerfish")
Description
Parses the specified input XML string into a JSON object.
Input parameter
xml: The input XML string.
format: The output JSON representation format.
Return type
JSON
Output
Returns the JSON object representation of the provided XML string.
Manifest XML
Syntax
manifestXml(json, format = "FORMAT", indent_output = false)
Description
Converts the specified input JSON object into an XML string.
Input parameter
json: The input JSON object.
format: The input JSON representation format. Replace FORMAT with one of the following supported formats:
badgerfish (default): Use the BadgerFish format to map JSON fields to XML in a key-value manner.
jsonml: Use the JsonML format when maintaining element order is important for your integration, as it represents XML elements as arrays and preserves their original ordering.
Example usage:
manifestXml(jsonObject,"badgerfish",false)
[or]
manifestXml(jsonArray,"jsonml",false)
indent_output: Boolean input to indicate if the output XML string should be indented. Default value is False.
Return type
STRING
Output
Returns the XML string of the provided JSON object representation.
XSL Transform
Syntax
xslTransform(xml, xsl, params = {})
Description
Transform the specified XML string using the specified XSL string and the specified parameters.
Input parameter
xml: The input XML string.
xsl: The input XSL string.
params: The input parameters that are passed to the XSL transformation.
The parameters are passed as a JSON object with keys representing the parameter name and values representing the parameter value.
The parameter values can be of type STRING, INTEGER or BOOLEAN.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-04-12 UTC."],[[["This page details the predefined Jsonnet functions available for the Data Transformer Script task in Application Integration, which is a Pre-GA feature with potential limitations and \"as is\" availability."],["The `parseXml()` function is used to convert an XML string into a JSON object, defaulting to the BadgerFish format."],["The `manifestXml()` function converts a JSON object into an XML string, also defaulting to the BadgerFish format, and offering an option to indent the output."],["The `xslTransform()` function transforms an XML string using a provided XSL string, supporting XSL version 1.0, with the option to pass parameters as a JSON object."],["Using these predefined functions, requires the `functions` library to be imported into your script, it is compatible with Jsonnet library v0.20.0."]]],[]]