@ls-age/xml
Modify XML documents in node.js with ease
Last updated 3 years ago by lhechenberger .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ls-age/xml 
SYNC missed versions from official npm registry.

@ls-age/xml

Modify XML documents in node.js with ease

CircleCI

An XML parsing, manipulation and serialization library. Implements some very basic DOM APIs (By far not complete).

Installation

As always, run npm install [--save] @ls-age/xml to install.

Usage

A basic example that parses an xml string, manipulates it and logs it's xml string again:

import { parse, build } from '@ls-age/xml';

parse(`<?xml version="1.0" ?>
<root>
  <content>content</content>
</root>`)
  .then(doc => {
    doc.documentElement.getElementsByTagName('content')[0].setAttribute('test', 'value');
    doc.documentElement.appendChild(doc.createElement('another'));
    
    console.log(build(doc, {
      indent: ' ',
      newline: '\r\n',
    }));
  });

/* Prints:
<?xml version="1.0" ?>\r\n
<root>\r\n
 <content test="value">content</content>\r\n
 <another />\r\n
</root>
*/

Current Tags

  • 0.1.6                                ...           latest (3 years ago)

6 Versions

  • 0.1.6                                ...           3 years ago
  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |