XmlUtils
Path
com.roma.apic.livedata.common.v1.XmlUtils
Description
This class is used to provide the XML conversion function.
Example
1 2 3 4 5 |
importClass(com.roma.apic.livedata.common.v1.XmlUtils);
function execute(data) {
var xml = '<a><id>2</id><name>1</name></a>'
return XmlUtils.toMap(xml)
}
|
Method List
|
Returned Type |
Method and Description |
|---|---|
|
static String |
toJson(String xml) Convert a character string in the XML format into a JSON file. |
|
static Map<String,Object> |
toMap(String xml) Convert XML into Map. |
|
static String |
toXml(Object object) Convert an object into an XML file. |
|
static String |
toXml(Object object, Map<String,Object> config) Convert an object into an XML file. |
Method Details
- public static String toJson(String xml)
Convert a character string in the XML format into a JSON file.
Input Parameter
xml indicates the character string in XML format.
Returns
Character string in JSON format.
- public static Map<String,Object> toMap(String xml)
Convert XML into Map.
Input Parameter
xml indicates the character string in XML format.
Returns
Character string in MAP format.
- public static String toXml(Object object)
Convert an object into an XML file.
Input Parameter
object indicates the object to be converted.
Returns
Character string in XML format.
- public static String toXml(Object object, Map<String,Object> config)
Convert an object into XML.
Input Parameter
- object indicates the object to be converted.
- config indicates the conversion configuration.
Returns
Character string in XML format.
Last Article: TextUtils
Next Article: Developing Data API Statements
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.