1.0.0 • Published 8 years ago

strxml v1.0.0

Weekly downloads
8,189
License
ISC
Repository
github
Last release
8 years ago

Build Status

strxml

Create xml with strings and concatenation.

install

npm install --save strxml

api

  • tag(el, [attributes], contents)
  • tagClose(el, attributes)
  • encode(str)
  • attr(attributes)

example

var tag = require('xmlstr').tag;

tag('Layer',
    tag('StyleName', 'style-' + i) +
    tag('Datasource', {
      name: 'layer-' + i,
      srs: WGS84
    }));