Revision 61016
Added by Andreas Czerniak almost 3 years ago
modules/dnet-collector-plugins/trunk/src/main/java/eu/dnetlib/data/collector/plugins/utils/JsonUtils.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.data.collector.plugins.oai.engine.XmlCleaner; |
4 | 4 |
import org.apache.commons.logging.Log; |
5 | 5 |
import org.apache.commons.logging.LogFactory; |
6 |
import |
|
7 | 6 |
|
8 | 7 |
public class JsonUtils { |
9 | 8 |
|
... | ... | |
100 | 99 |
public String convertToXML(final String jsonRecord){ |
101 | 100 |
String resultXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; |
102 | 101 |
|
103 |
log.trace("before convertToXML: " + resultXml);
|
|
102 |
log.trace("before convertToXML: " + jsonRecord);
|
|
104 | 103 |
org.json.JSONObject jsonObject = new org.json.JSONObject(syntaxConvertJsonKeyNames(jsonRecord)); |
105 | 104 |
resultXml += org.json.XML.toString(jsonObject, wrapName); // wrap xml in single root element |
106 | 105 |
log.trace("before inputStream: " + resultXml); |
Also available in: Unified diff
refine json to xml element-names