Skip to content

utils/xml

Documentation

Overview

Classes

XML

fromJson()

Converts a JSON input (either a JSON string or a raw JavaScript object) into an XML string.

Note: If a JavaScript object is passed, it is first stringified using JSON.stringify().

ts
static fromJson(input: any): string;
ParameterTypeDescription
inputanyThe JSON string or object to be converted to XML.

Returns

  • Type: string
  • Description: The resulting XML content as a string.

toJson()

Converts an XML input (expected as an XML string) into a JSON formatted string.

ts
static toJson(input: any): string;
ParameterTypeDescription
inputanyThe XML string to be converted to JSON.

Returns

  • Type: string
  • Description: The resulting JSON content as a string.