Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (40 sloc) 2.158 kB
f0c2d94 @jaredhanson Add README.
authored
1 # xmlb
2
3 XML builder templates for Node.js, based on [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js).
4
5 ## Installation
6
7 $ npm install xmlb
8
9 ## Usage
10
11 xmlb is an [Express](http://expressjs.com/)-compatible template engine. It also
12 exposes `compile` and `render` functions for integration with other frameworks.
13
14 Define views using XML builder syntax. `xml` is an instance of `XMLBuilder`
15 provided by the [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) module.
16 Refer to the [Usage](https://github.com/oozcitak/xmlbuilder-js/wiki/Usage)
17 section of xmlbuilder's [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki)
18 for a complete syntax reference.
19
20 xml.begin('hello')
21 .text(name);
22
23 Render the view with in a route, passing locals to be substituted into the XML
24 output.
25
26 res.render('hello.xmlb', { name: 'Dave' });
27
28 ## Tests
29
30 $ npm install --dev
31 $ make test
32
33 [![Build Status](https://secure.travis-ci.org/jaredhanson/xmlb.png)](http://travis-ci.org/jaredhanson/xmlb)
34
35 ## Credits
36
37 - [Jared Hanson](http://github.com/jaredhanson)
38
39 ## License
40
41 (The MIT License)
42
43 Copyright (c) 2012 Jared Hanson
44
45 Permission is hereby granted, free of charge, to any person obtaining a copy of
46 this software and associated documentation files (the "Software"), to deal in
47 the Software without restriction, including without limitation the rights to
48 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
49 the Software, and to permit persons to whom the Software is furnished to do so,
50 subject to the following conditions:
51
52 The above copyright notice and this permission notice shall be included in all
53 copies or substantial portions of the Software.
54
55 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
56 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
57 FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
58 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
59 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
60 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Something went wrong with that request. Please try again.