Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libxml-to-js

Package Overview
Dependencies
Maintainers
0
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libxml-to-js

XML to JavaScript object parser based on libxmljs

  • 0.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
374
increased by5.95%
Maintainers
0
Weekly downloads
 
Created
Source

About

This is a XML to JavaScript object parser. It uses the libxmljs module for the actual XML parsing. It aims to be an easy xml2js replacement, but it doesn't follow the xml2js API. I used xml2js for my own needs, but the error reporting of the underlying SAX parser is quite broken. This is how libxml-to-js saw the day light.

libxml-to-js uses the string parser method of libxmljs. Basically a modified version of the algorithm from here in order to fit the formal specifications of xml2js output.

Installation

Either manually clone this repository into your node_modules directory, or the recommended method:

npm install libxml-to-js

Usage mode

var parser = require('libxml-to-js');
var xml = 'xml string';

parser(xml, function (error, result) {
	if (error) {
		console.error(error);
	} else {
		console.log(result);
	}
});

Known issues

  • The namespace attribute isn't translated to the JavaScript object as the libxmljs treats it different from the sax-js parser. The sax-js simply places it as a simple attribute.
  • The behavior for nodes that use namespaces is untested vs. the output of xml2js.

Keywords

FAQs

Package last updated on 19 Jul 2011

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc