Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

SFU​.getJSONObjectFromXml()

  • Last UpdatedJun 25, 2024
  • 1 minute read

Use getJSONObjectFromXml() method to convert an XML string to a JSON object.

Syntax

sRetVal = SFU.getJSONObjectFromXml(xmlString);

Parameters

Parameter

Description

xmlString

XML string to convert to JSON object.

Return Value

This method returns a JSON object.

Example

// Define an XML string.

var xmlString = "<MyRoot><FirstName>John</FirstName><LastName>Smith</LastName></MyRoot>";

// Convert the XML string to a JSON object.

var jsonObj = SFU.getJSONObjectFromXml(xmlString);

// The JSON object will be returned as:

// {

// "MyRoot" : {

//  "FirstName":"John",

//  "LastName":"Smith",

// }

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in