Skip to content
This repository was archived by the owner on May 18, 2022. It is now read-only.

aristov/xmlmodule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

XML DOM assembler library

Resources

License

Stars

Watchers

Forks

Packages

No packages published