@azure/core-xml package

Interfaces

XmlOptions

Options to govern behavior of xml parser and builder.

Functions

parseXML(string, XmlOptions)

Converts given XML string into JSON

stringifyXML(unknown, XmlOptions)

Converts given JSON object to XML string

Variables

XML_ATTRKEY

Default key used to access the XML attributes.

XML_CHARKEY

Default key used to access the XML value content.

Function Details

parseXML(string, XmlOptions)

Converts given XML string into JSON

function parseXML(str: string, opts?: XmlOptions): Promise<any>

Parameters

str

string

String containing the XML content to be parsed into JSON

opts
XmlOptions

Options that govern the parsing of given xml string includeRoot indicates whether the root element is to be included or not in the output

Returns

Promise<any>

stringifyXML(unknown, XmlOptions)

Converts given JSON object to XML string

function stringifyXML(obj: unknown, opts?: XmlOptions): string

Parameters

obj

unknown

JSON object to be converted into XML string

opts
XmlOptions

Options that govern the XML building of given JSON object rootName indicates the name of the root element in the resulting XML

Returns

string

Variable Details

XML_ATTRKEY

Default key used to access the XML attributes.

XML_ATTRKEY: "$"

Type

"$"

XML_CHARKEY

Default key used to access the XML value content.

XML_CHARKEY: "_"

Type

"_"