diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:46:33 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-16 14:46:33 +0100 |
| commit | bc1550787eec24964c506ebbddff9363d114b9e6 (patch) | |
| tree | 75ec9022ca1fb0f875601e7da4d5f34ddf0c3106 /lib/xml | |
| parent | 4900c2cf3e66822a33e528fc5f275a3031496006 (diff) | |
Write descendant nodes
Diffstat (limited to 'lib/xml')
| -rw-r--r-- | lib/xml/writer.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/xml/writer.js b/lib/xml/writer.js index a97d17e..239dd04 100644 --- a/lib/xml/writer.js +++ b/lib/xml/writer.js @@ -12,7 +12,15 @@ function writeString(root) { standalone: true }); root.children.forEach(function(child) { - builder.element(child.name); + writeElement(builder, child); }); return builder.end(); } + + +function writeElement(builder, element) { + var elementBuilder = builder.element(element.name); + element.children.forEach(function(child) { + writeElement(elementBuilder, child); + }); +} |
