Updated on 2022-02-21 GMT+08:00

JSON2XMLHelper

Path

com.huawei.livedata.util.JSON2XMLHelper

Description

This class is used to perform conversion between JSON and XML.

Method List

Returned Type

Method and Description

static String

JSON2XML(String json, boolean returnFormat)

Convert from JSON to XML.

static String

XML2JSON(String xml)

Convert from XML to JSON.

Method Details

  • public static String JSON2XML(String json, boolean returnFormat)

    Convert from JSON to XML.

    Input Parameter

    • json indicates a character string in JSON format.
    • returnFormat indicates the return format.

    Returns

    Character string in the XML format.

  • public static String XML2JSON(String xml)

    Convert from XML to JSON.

    Input Parameter

    xml indicates a character string in XML format.

    Returns

    Character string in the XML format.