diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:32:53 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:32:53 +0100 |
| commit | f41387191bbb87ecd38e05742d61dc663595c3d0 (patch) | |
| tree | 090c852237421dee9c3088d0d5f95cc325afa70a /lib/xml | |
| parent | 9ff57bb770e0296bb2f5b7a41711c53954eb8c4e (diff) | |
Add writer for XML that can write out root nodes without attributes
Diffstat (limited to 'lib/xml')
| -rw-r--r-- | lib/xml/writer.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/xml/writer.js b/lib/xml/writer.js new file mode 100644 index 0000000..e48f3a1 --- /dev/null +++ b/lib/xml/writer.js @@ -0,0 +1,15 @@ +var xmlbuilder = require("xmlbuilder"); + + +exports.writeString = writeString; + + +function writeString(root) { + return xmlbuilder + .create(root.name, { + version: '1.0', + encoding: 'UTF-8', + standalone: true + }) + .end(); +} |
