/** * 将json 转化成 xml * @param * @return * * <dependency> * <groupId>net.sf.json-lib</groupId> * <artifactId>json-lib</artifactId> * <version>2.4</version> * <classifier>jdk15</classifier> * </dependency> * * <dependency> * <groupId>xom</groupId> * <artifactId>xom</artifactId> * <version>1.3.5</version> * </dependency> * */ public static String jsonToXml(String jsonString) { String result=""; JSON json = JSONSerializer.toJSON(jsonString); XMLSerializer xmlSerializer = new XMLSerializer(); xmlSerializer.setTypeHintsCompatibility( false ); result = xmlSerializer.write(json); return result; }
java 将json 转化成 xml
最新推荐文章于 2024-06-29 02:57:21 发布