Questions tagged [xml-to-json]
82 questions
1
vote
0 answers
How to convert a single XML Object to JSONArray in Java
I am working on a solution to convert XML into JSON. Here I am facing an issue in which sometimes a node in XML comes as an object vs sometimes as an array. When a single node is found then it gets converted to single JSON object and array forms…

Suraj Shrivastava
- 11
- 1
1
vote
2 answers
Converting xml to json in Golang
I'm using github.com/basgys/goxml2json for xml to json conversion. Below is the example code:
package main
import (
"fmt"
"strings"
xj "github.com/basgys/goxml2json"
)
func main() {
xml := strings.NewReader(`

Avinash
- 875
- 6
- 20
1
vote
0 answers
How to convert xml file to json format with cdata in php?
I am trying to convert my xml file (large file) to json format in php. The problem is the cdata is missing in json format.
This is my code,

Senthur Kumaran
- 1,135
- 1
- 7
- 18
1
vote
1 answer
XSLT 3.0 - Not able to get Array of objects in XSLT 3.0 xml-to-json()
I am trying to convert given json data from one form to another using XSLT 3.0. I am using json-to-xml and xml-to-json functions provides by XSLT 3.0 to convert data from.to json to/from xml .
I am having below json data.
{
"id": "123456",
…

ved g
- 13
- 2
1
vote
0 answers
How to convert huge XML files to JSON in a multi-user concurrency environment without saturating RAM?
I am facing the problem with converting XML file to JSON with following code:
Console.WriteLine("Start");
string inputPath = "input.xml";
// Load XML document
XmlDocument doc = new XmlDocument();
doc.Load(inputPath);
string outputPath =…

Adam Gajdečka
- 305
- 1
- 4
- 13
1
vote
1 answer
StartTag: invalid element name error while JSON to XML Conversion
I'm getting an array from mongoDB formatted like this:
const data = await db.collection('myCollection').find(filterQuery).project(projection).toArray();
data.map(record => { record._id = record._id.toString() }); // Converting objectId to string
//…

Murat Colyaran
- 2,075
- 2
- 8
- 27
1
vote
1 answer
Why is xml-to-json function returning exponential notation?
All of my XSLT is working when using the xml-to-json() function except for this part,
1615842000
which returns
"send_at":1.615842E9
when I intend to get this result:
"send_at":1615842000

Jason Gregory
- 139
- 1
- 16
1
vote
0 answers
Requesting data from API with XML format
I am not new to programming, but I have some issues with some API requests.
I have the next route (example):
https://test.com/api/products
The return in postman is OK (example):
And my code is (example):
let url =…

ChilTest
- 461
- 5
- 18
1
vote
1 answer
fast-xml-parse returns only one of object instead of array in Nodejs
I'm doing tracking functionality using some service. It provides response in XML format. To parse XML response I have decided to use fast-xml-parser package.
But there is a problem:
When I get only one item in response, it works well, but if I have…

vladys.bo
- 730
- 2
- 11
- 34
1
vote
1 answer
Mapping to "" instead of null Jackson
I have a function that reads XML from a Kafka topic into String format, which I then want to convert to a JSON Object.
Example XML:

Jacob Mitchell
- 15
- 4
1
vote
1 answer
How to fetch xml attribute value in liquid template - XML to JSON Liquid
I am trying to fetch the xml attribute value using liquid template. Examples are as below.
XML example:

Suraj Revankar
- 135
- 9
1
vote
1 answer
XSLT 1.0: Format JSON output using XSLT/ Remove defualt quotes in an JSON Array
I have a the following JSON response, that I'm getting after a XSLT transformation. The values in the "name" array needed to be present as "ABC","XYZ"
Payload
001
1.00
…

Rooster
- 157
- 2
- 9
1
vote
1 answer
1
vote
2 answers
How to remove @ prefix while converting xml to json in Python
I'm trying to convert xml to json in python using xmltodict library. Though, the xml is getting converted to json, before every key in dict, '@' is getting prefixed. Below is the code snippet and sample output:
import xmltodict
import json
with…

Sumit
- 1,360
- 3
- 16
- 29
1
vote
1 answer
ModuleNotFoundError: No module named 'xmltodict'
I have installed xmltodict successfully using the below command
python -m pip install --upgrade --user xmltodict
But when I am executing a python script which contains import xmltodict I am getting the below error
import…

Jai
- 21
- 1
- 4