Created
January 24, 2015 00:42
-
-
Save benoror/08d7c4f0264b770cfd80 to your computer and use it in GitHub Desktop.
node-pate-example2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pate = require('node-pate'); | |
var formatter = require('./format_lib.js'); | |
var options = { | |
tpl: '{{ bread/@name }} price: $[[ formatMoney({{ bread/@price }}) ]] ([[ moneyToWords({{ bread/@price }}) ]])', | |
xml: '<data><row><bread name="Bretzel" price="42.56" /></row></data>', | |
xpath: '/*/*', | |
format_lib: formatter | |
}; | |
pate.parse(options, function (err, data) { | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment