https://github.com/jaredhanson/xmlb
XML builder templates for Node.js.
https://github.com/jaredhanson/xmlb
Last synced: 8 months ago
JSON representation
XML builder templates for Node.js.
- Host: GitHub
- URL: https://github.com/jaredhanson/xmlb
- Owner: jaredhanson
- License: mit
- Created: 2012-07-18T05:07:46.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-08-01T03:31:35.000Z (over 13 years ago)
- Last Synced: 2025-04-07T06:03:00.040Z (9 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# xmlb
XML builder templates for Node.js, based on [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js).
## Installation
$ npm install xmlb
## Usage
xmlb is an [Express](http://expressjs.com/)-compatible template engine. It also
exposes `compile` and `render` functions for integration with other frameworks.
Define views using XML builder syntax. `xml` is an instance of `XMLBuilder`
provided by the [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) module.
Refer to the [Usage](https://github.com/oozcitak/xmlbuilder-js/wiki/Usage)
section of xmlbuilder's [wiki](https://github.com/oozcitak/xmlbuilder-js/wiki)
for a complete syntax reference.
xml.begin('hello')
.text(name);
Render the view with in a route, passing locals to be substituted into the XML
output.
res.render('hello.xmlb', { name: 'Dave' });
## Tests
$ npm install --dev
$ make test
[](http://travis-ci.org/jaredhanson/xmlb)
## Credits
- [Jared Hanson](http://github.com/jaredhanson)
## License
(The MIT License)
Copyright (c) 2012 Jared Hanson
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.