Socket
Socket
Sign inDemoInstall

xmldom

Package Overview
Dependencies
0
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    xmldom

A W3C Standard based DOMParser and XMLSerializer (DOM Level2 CORE).


Version published
Weekly downloads
1.2M
decreased by-15.69%
Maintainers
1
Install size
1.21 MB
Created
Weekly downloads
 

Package description

What is xmldom?

The xmldom npm package is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. It allows users to parse XML data into a DOM tree structure and serialize DOM trees back into XML. This package is particularly useful for server-side applications where DOM manipulation is needed without a browser environment.

What are xmldom's main functionalities?

Parsing XML to DOM

This feature allows you to parse a string of XML into a DOM tree, enabling programmatic access and manipulation of the structure and content.

const { DOMParser } = require('xmldom');
const xmlString = '<root>Hello World</root>';
const doc = new DOMParser().parseFromString(xmlString, 'text/xml');
console.log(doc.documentElement.nodeName); // 'root'

Serializing DOM to XML

This feature enables you to take a DOM tree and serialize it back into a string of XML, useful for outputting modified XML data.

const { XMLSerializer } = require('xmldom');
const doc = new DOMParser().parseFromString('<root>Hello World</root>', 'text/xml');
const xmlString = new XMLSerializer().serializeToString(doc);
console.log(xmlString); // '<root>Hello World</root>'

Other packages similar to xmldom

Changelog

Source

0.1.31

Commits

The patch versions (v0.1.29 - v0.1.31) that have been released on the v0.1.x branch, to reflect the changed maintainers, are branched off from v0.1.27 so they don't include the breaking changes introduced in xmldom-alpha@v0.1.28:

Maintainer changes

After the last commit to the original repository https://github.com/jindw/xmldom on the 9th of May 2017, the first commit to https://github.com/xmldom/xmldom is from the 19th of December 2019. The fork has been announced in the original repository on the 2nd of March 2020.

The versions listed below have been published to one or both of the following packages:

It is currently not planned to continue publishing the xmldom-alpha package.

The new maintainers did not invest time to understand changes that led to the last xmldom version 0.1.27 published by the original maintainer, but consider it the basis for their work. A timeline of all the changes that happened from that version until 0.3.0 is available in https://github.com/xmldom/xmldom/issues/62. Any related questions should be asked there.

Keywords

FAQs

Last updated on 22 May 2012

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc