
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
xml-parser-xo
Advanced tools
XML parser based on xml-parser with eXtra Options (XO).
$ npm install xml-parser-xo
JavaScript:
var fs = require('fs');
var parse = require('xml-parser-xo');
var xml = fs.readFileSync('examples/developerforce.xml', 'utf8');
var inspect = require('util').inspect;
var obj = parse(xml);
console.log(inspect(obj, { colors: true, depth: Infinity }));
XML:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:enterprise.soap.sforce.com">
<soapenv:Body>
<createResponse>
<result>
<id>003D000000OY9omIAD</id>
<success>true</success>
</result>
<result>
<id>001D000000HTK3aIAH</id>
<success>true</success>
</result>
</createResponse>
</soapenv:Body>
</soapenv:Envelope>
Yields:
{ declaration: { attributes: { version: '1.0', encoding: 'utf-8' } },
root:
{ name: 'soapenv:Envelope',
attributes:
{ 'xmlns:soapenv': 'http://schemas.xmlsoap.org/soap/envelope/',
xmlns: 'urn:enterprise.soap.sforce.com' },
children:
[ { name: 'soapenv:Body',
attributes: {},
children:
[ { name: 'createResponse',
attributes: {},
children:
[ { name: 'result',
attributes: {},
children:
[ { name: 'id',
attributes: {},
children: [{name: '#text', content: '003D000000OY9omIAD'}]
{ name: 'success', attributes: {}, children: [{name: '#text', content: 'true'}] } ],
},
{ name: 'result',
attributes: {},
children:
[ { name: 'id',
attributes: {},
children: [{name: '#text', content: '001D000000HTK3aIAH'}]
{ name: 'success', attributes: {}, children: [{name: '#text', content: 'true'}] } ],
} ],
} ],
} ],
} }
JavaScript:
var inspect = require('util').inspect;
var parse = require('xml-parser-xo');
var options = {trim: false, stripComments: false};
var obj = parse(xml, options);
console.log(inspect(obj, { colors: true, depth: Infinity }));
trim
(Boolean, default=true) Set to true to trim the input before parsing it.stripComments
(Boolean, default=true) Set to true to strip the comments when parsing.MIT
FAQs
Parse a XML string into a proprietary syntax tree
The npm package xml-parser-xo receives a total of 486,678 weekly downloads. As such, xml-parser-xo popularity was classified as popular.
We found that xml-parser-xo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.