ballerina/xmldata

Overview

This module provides APIs to perform conversions between XML and JSON/Ballerina records. It provides APIs to get natural representations of data in XML from JSON and to get JSON or Ballerina records data from natural representations of data in XML.

For information on the operations, which you can perform with the xmldata module, see the below Functions.

Functions

[5]

fromJson

Converts a JSON object to an XML representation.

fromXml

Converts an XML to its Map or Record representation.

toJson

Converts an XML object to its JSON representation.

toRecord
D

Converts an XML to its Record representation.

toXml

Converts a Map or Record representation to its XML representation.

Records

[4]

JsonOptions

Provides configurations for converting JSON to XML.

NameConfig

Defines the new name of the name.

NamespaceConfig

Defines the namespace of the XML element

XmlOptions

Provides configurations for converting XML to JSON.

Annotations

[3]

Attribute

The annotation is used to denote the field that is considered an attribute.

Name

The annotation is used to specify the new name of the existing record name or field name according to the XML format.

Namespace

The annotation is used to specify the namespace's prefix and URI of the XML element.

Errors

[1]

Error

Represents the error type of the ballerina/xmldata module.