public class XmlUtil extends Object
| 构造器和说明 |
|---|
XmlUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Object |
xmlToJson(String xml)
xml转换为json,采用sf.json
|
static com.alibaba.fastjson.JSONObject |
xmlToJson2(String xmlStr)
xml转json,采用dom4j解析
|
static com.alibaba.fastjson.JSONArray |
xmlToJsonArray(String xml) |
static com.alibaba.fastjson.JSONObject |
xmlToJsonObject(String xml) |
public static com.alibaba.fastjson.JSONObject xmlToJsonObject(String xml)
xml - 源xml字符串public static com.alibaba.fastjson.JSONArray xmlToJsonArray(String xml)
xml - 源xml字符串public static com.alibaba.fastjson.JSONObject xmlToJson2(String xmlStr) throws org.dom4j.DocumentException
xmlStr - 源xml字符串org.dom4j.DocumentExceptionCopyright © 2024. All rights reserved.