JSON2XML
Methods to convert a XML string into a JSON string, and to covert a JSON string into an XML string.
Install / Use
/learn @johndharrison/JSON2XMLREADME
JSON2XML
USAGE
Using JSON2XML is straightforward. There are two functions for conversion: json2XML and xml2JSON.
xml2JSON
require(JSON2XML)
fileURL <- "http://api.sportsdatallc.org/nfl-t1/2013/REG/1/statistics.xml?api_key=4dhyq3f3rfkp2cbm4yqbcuag"
xData <- readLines(fileURL)
jData <- xml2JSON(paste(xData, collapse='')) # convert to JSON
out <- RJSONIO::fromJSON(jData)
do.call(rbind.data.frame, out$games$game[[1]]$team[[1]][[c('defense', 'player')]])
json2XML
require(JSON2XML)
jsonString <- RJSONIO::toJSON(list(a=1, r = list(b = 2:3, c= 'd')), collapse = '')
xData <- json2XML(jsonString)
XML::xmlParse(json2XML(jsonString))
Getting started
To install JSON2XML you will need the devtools package. If necessary (install.packages("devtools")) and run:
devtools::install_github("johndharrison/JSON2XML")
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
