json2XML: Convert a JSON string to XML

Description Usage Arguments Value Examples

Description

json2XML Convert a JSON string into a well-formed, element-normal XML string.

Usage

1
json2XML(jsonString)

Arguments

jsonString

A character string of JSON text

Value

An XML string to be parsed containing the structured data from the JSON string.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
library(RJSONIO)
library(XML)
jsonString <- toJSON(list(a=1, r = list(b = 2:3, c= 'd')), collapse = '')
xData <- json2XML(jsonString)
> xmlParse(json2XML(jsonString))
<?xml version="1.0"?>
<root>
 <r>
  <b>2</b>
  <b>3</b>
  <c>d</c>
 </r>
 <a>1</a>
</root>

## End(Not run)

johndharrison/JSON2XML documentation built on May 19, 2019, 4:22 p.m.