aboutsummaryrefslogtreecommitdiff
path: root/lib/xml
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-08-16 14:37:55 +0100
committerMichael Williamson <mike@zwobble.org>2015-08-16 14:37:55 +0100
commit63546974b87e3ce7167a3077db33b49e27006197 (patch)
tree0f2cdea8b2e44d87490664c0d8afe265d10f650e /lib/xml
parent82d14072f95eb6112f7617c5dae8817f35aa93ea (diff)
Write immediate children of root
Diffstat (limited to 'lib/xml')
-rw-r--r--lib/xml/writer.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/xml/writer.js b/lib/xml/writer.js
index e48f3a1..a97d17e 100644
--- a/lib/xml/writer.js
+++ b/lib/xml/writer.js
@@ -5,11 +5,14 @@ exports.writeString = writeString;
function writeString(root) {
- return xmlbuilder
+ var builder = xmlbuilder
.create(root.name, {
version: '1.0',
encoding: 'UTF-8',
standalone: true
- })
- .end();
+ });
+ root.children.forEach(function(child) {
+ builder.element(child.name);
+ });
+ return builder.end();
}