npm

xmlmodule

0.1.1 • Public • Published

xmlmodule

work in progress

This JavaScript library provides a set of DOM assemblers for the following XML structures:

Example

import {
    XMLDocumentAssembler,
    base, cdata, element, id, instruction,
    lang, space, stylesheet, xmlns
} from 'xmlmodule'

new XMLDocumentAssembler([
    stylesheet({ href : 'example.xsl' }),
    element({
        attributes : [
            base('http://example.org/'),
            id('example'),
            lang('ru'),
            space('preserve'),
            xmlns('http://example.org/namespace')
        ],
        childNodes : [
            instruction('example'),
            cdata('<<example>>')
        ]
    })
])

This code produces an XML document with the following structure:

<?xml-stylesheet href="example.xsl"?>
<element xml:base="http://example.org/"
         xml:id="example"
         xml:lang="ru"
         xml:space="preserve"
         xmlns="http://example.org/namespace">
    <?instruction example?>
    <![CDATA[<<example>>]]>
</element>

Installation

npm install xmlmodule

Development

git clone git@github.com:aristov/xmlmodule.git
cd xmlmodule
npm install
npm run watch

License

The MIT License (MIT)

Readme

Keywords

Package Sidebar

Install

npm i xmlmodule

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

52.2 kB

Total Files

26

Last publish

Collaborators

  • aristov