Questions tagged [xml2js]

Simple XML to JavaScript object converter

Simple XML to JavaScript object converter. It supports bi-directional conversion. Uses sax-js and xmlbuilder-js.

More information on project page.

141 questions
0
votes
2 answers

Inserting XML data into MongoDB with Nodejs

xml data Workflow-MKRU Z:\MAITest\Cache Test WF I'm testing shit
Justin Miller
  • 21
  • 1
  • 10
0
votes
1 answer

Access Array and Object inside JSON

I call a get API which returns XML and I was to convert to JSON, but xml2js returns [Object] [Circular] and [Array] inside an Elements Array. How can I see what's inside the elements array? var XMLHttpRequest =…
0
votes
1 answer

How to convert XML enconding in Node

I'm trying to parse XML file in Node with xml2js library. The issue is that the file encoding is windows-1250 instead of utf-8. So when I try to get the values it contains wrong characters. For example, instead of ř I get Ĺ™. How can I convert the…
froston
  • 1,027
  • 1
  • 12
  • 24
0
votes
2 answers

nodejs: xml2js returns broken data structure because it inserted escape character

xml2js adds escape character which invalidates it's own json, my xml already contains escape characters. Is there anyway to tell xml2js to not insert escape characters? I know this because I took a look in the response and found this '5.4\\"' which…
mitchelangelo
  • 851
  • 4
  • 16
  • 42
0
votes
1 answer

Parsing XML Soap Request with xml2js Invalid Character

I am attempting to set up my Meteor application with an API endpoint to receive Ebay seller notifications when changes or transactions happen on my listed items. I followed theMeteorChef's guide to writing an api. The first problem I was having with…
Ticdoc
  • 248
  • 3
  • 15
0
votes
1 answer

XML to Json Nodejs

I'm using xml2js npm to parse xml to json and everything goes well except in xml file, there is an attribute key 20,000+ and xml2js parses it in json like this "ht:approx_traffic": [ "20,000+" ] Is there a…
KevinVuD
  • 581
  • 2
  • 5
  • 25
0
votes
0 answers

parsing xml attributes with xml2js

I would like to parse a the following XML
user294015
  • 65
  • 7
0
votes
1 answer

How to extract data out of non-tagged nested XML file?

I am trying to parse through an XML file in Node.js by using the xml2js library. However, I am not able to access the nested contents of that XML file. Here is how my XML file looks like:
0
votes
2 answers

How to creat xml file with custom tags with colun is node js usig xml2js

I am trying to create an xml file using xml2js in node js, var obj = {name: "Super", Surname: "Man", age: 23}; var builder = new xml2js.Builder(); var xml = builder.buildObject(obj); With the above code, I got the following xml …
Testimg198
  • 55
  • 1
  • 2
  • 8
0
votes
1 answer

'this' is undefined in Angular, XML2JS

export class ServerComponent { servers:string[]; getString:any; serversJSON:any; constructor() { } ngOnInit() { console.log("ngOnInit"); this.getXmlService.getData().subscribe((getString) => { …
vc669
  • 561
  • 5
  • 16
0
votes
0 answers

Accessing JSON Content in Javascript (NodeJS)

im working with nodejs an need to get a string value from a json. The json looks like this: `result["DIDL-Lite"]["item"] = [ { '$': { id: '0/Spotify/Track', parentID: '0/Spotify', restricted: '0' }, 'upnp:class': [ 'object.item.audioItem.musicTrack'…
0
votes
2 answers

Node.js xml2js http.request tag matching

I am trying to work with XML data from an https.request and display it to a web page in table format. I'm trying to follow this tutorial which describes what I would like to do very well: https://programmerblog.net/parse-xml-using-nodejs/ However, I…
Andrew Petersen
  • 163
  • 1
  • 9
0
votes
1 answer

Bind XML response to HTML in Angular2

I have a requirement that my API will return XML response. I want to display it on HTML page using Angular2. How do I achieve that? I am using xml2js node module to parse xml. this is my code import * as xml2js from 'xml2js'; /* This is sample…
hemantmali
  • 63
  • 2
  • 13
0
votes
1 answer

node.js transform xml into json with xml2js

I am using the node.js package xml2js to transform xml into json. Documentation is here: https://www.npmjs.com/package/xml2js My problem is that attributes for those xml are not correctly transformed. example XML with multiple…
Bene
  • 209
  • 1
  • 9
0
votes
0 answers

Parse XML Response from SAMHSA API

I am trying to obtain and display data in a React app from the samhsa.org API. I am able to console.log an XML string though I cannot seem get the node values. I have exhausted the last week trying to figure this out. Forgive me, I am learning…
danlauby
  • 45
  • 1
  • 6